/* ================= ROOT ================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --danger: #ef4444;
  --success: #16a34a;
  --dark: #0f172a;
  --muted: #64748b;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 18px;
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--dark);
}

/* ================= HEADER ================= */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #020617, #0f172a);
  color: white;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

header a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

/* ================= CART BADGE ================= */
.cart-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

#cartCount {
  background: var(--danger);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

/* ================= ANNOUNCEMENT ================= */
.announcement-bar {
  background: var(--primary);
  color: white;
  overflow: hidden;
  padding: 10px 0;
}

.announcement-track {
  display: inline-flex;
  gap: 60px;
  animation: marquee 18s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* ================= TOP BAR ================= */
.top-bar {
  padding: 24px 28px 10px;
}

.search-wrapper {
  background: white;
  padding: 12px 16px;
  border-radius: var(--radius);
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
}

.search-wrapper input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 15px;
}

/* ================= FILTERS ================= */
.filter-box {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-box button {
  background: #e5e7eb;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-box button.active {
  background: var(--primary);
  color: white;
}

/* ================= MAIN ================= */
main {
  padding: 16px 28px 40px;
}

/* ================= PRODUCT GRID ================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

/* ================= PRODUCT CARD ================= */
.product {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 45px rgba(2,6,23,.08);
  transition: transform .25s ease, box-shadow .25s ease;
}

.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 55px rgba(2,6,23,.12);
}

.product img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  background: #f1f5f9;
}

.product h3 {
  margin: 14px 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.product p {
  color: var(--primary);
  font-weight: 700;
  margin: 6px 0 14px;
}

/* ================= BUTTONS ================= */
button {
  margin-top: auto;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s ease;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ================= PRODUCT PAGE ================= */
.product-detail {
  max-width: 1100px;
  margin: 30px auto;
  background: var(--card);
  padding: 32px;
  border-radius: 22px;
  display: flex;
  gap: 40px;
  box-shadow: 0 20px 55px rgba(2,6,23,.1);
}

.product-images {
  flex: 1;
}

#mainImage {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
}

#thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

#thumbs img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
}

#thumbs img:hover {
  border-color: var(--primary);
}

.product-info {
  flex: 1;
}

.price {
  margin: 12px 0;
}

.price .mrp {
  text-decoration: line-through;
  color: var(--muted);
  margin-right: 8px;
}

.price .selling {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

#pDesc {
  line-height: 1.6;
  color: #334155;
  margin-bottom: 20px;
}

/* ================= REVIEWS ================= */
.reviews {
  max-width: 1100px;
  margin: 40px auto 60px;
  padding: 0 28px;
}

.reviews h3 {
  margin-bottom: 14px;
}

#reviewsList p {
  background: white;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(2,6,23,.08);
}

#reviewText {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  margin-top: 12px;
  resize: none;
}

/* ================= CART PAGE ================= */
.cart-item {
  background: white;
  padding: 16px;
  border-radius: 14px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 25px rgba(2,6,23,.06);
}

.cart-item img {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
}

.cart-info {
  flex: 1;
}

.cart-info input {
  width: 60px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #cbd5f5;
}

/* ================= COUPON ================= */
.coupon-box {
  background: white;
  padding: 18px;
  margin: 20px 28px;
  border-radius: 14px;
}

#couponMsg {
  margin-top: 8px;
  font-size: 14px;
}

/* ================= CART SUMMARY ================= */
.cart-summary {
  padding: 20px 28px;
  text-align: right;
  font-size: 18px;
}

/* ================= CHECKOUT ================= */
.checkout-container {
  padding: 30px;
  display: flex;
  gap: 24px;
}

.checkout-container form,
.order-summary {
  background: white;
  padding: 24px;
  border-radius: 16px;
  flex: 1;
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
}

.checkout-container input,
.checkout-container textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

/* ================= PAYMENT ================= */
.payment-box {
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin: 15px 0;
}

/* ================= ORDERS ================= */
.order-card {
  background: white;
  padding: 18px;
  margin: 16px 28px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
}

/* ================= TOAST ================= */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #020617;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.toast.show {
  opacity: 1;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .product-detail,
  .checkout-container {
    flex-direction: column;
  }

  header {
    padding: 16px 20px;
  }

  main {
    padding: 16px 20px 40px;
  }
}

.status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
}

.status.processing {
  background: #fde68a;
  color: #92400e;
}

.status.out {
  background: #bfdbfe;
  color: #1e40af;
}

.status.delivered {
  background: #bbf7d0;
  color: #065f46;
}

.status.cancelled {
  background: #fecaca;
  color: #7f1d1d;
}
/* ===== ORDER STATUS BADGE ===== */
.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
}

.status-badge.processing {
  background: #fde68a;
  color: #92400e;
}

.status-badge.out_for_delivery {
  background: #bfdbfe;
  color: #1e40af;
}

.status-badge.delivered {
  background: #bbf7d0;
  color: #065f46;
}

.status-badge.cancelled {
  background: #fecaca;
  color: #7f1d1d;
}

/* ===== ORDER TIMELINE ===== */
.order-timeline {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.order-timeline span {
  padding: 6px 10px;
  border-radius: 20px;
  background: #e5e7eb;
  font-size: 12px;
}

.order-timeline span.done {
  background: #22c55e;
  color: white;
}

/* ===== DELIVERED MESSAGE ===== */
.delivered-msg {
  margin-top: 10px;
  color: #16a34a;
  font-weight: 600;
}
