/* ============================================================
   cart.css — Shopping Cart, "Add to Cart" Button, Coming-Soon Modal
   ============================================================

   Online payments are temporarily disabled.
   Re-enable when client provides live Razorpay credentials.
   ============================================================ */

/* ── CSS variable fallbacks ────────────────────────────────── */
:root {
  --cart-dark:       #1a0d00;
  --cart-gold:       #d4a017;
  --cart-bg:         #f9f5ef;
  --cart-border:     #e8d8c0;
  --cart-text:       #2a1600;
  --cart-muted:      #7a6040;
  --cart-success:    #059669;
  --cart-error:      #dc2626;
  --cart-shadow:     0 20px 60px rgba(0,0,0,.22);
  --cart-radius:     16px;
  --cart-transition: 0.35s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   CART ICON — in nav / header
   ============================================================ */

.nav-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid rgba(107,72,0,.22);
  border-radius: 10px;
  background: rgba(59,31,14,.05);
  cursor: pointer;
  color: #3b1f0e;
  transition: background .22s, border-color .22s, transform .15s;
  flex-shrink: 0;
}
.nav-cart-btn:hover {
  background: rgba(212,160,23,.15);
  border-color: rgba(212,160,23,.45);
  transform: scale(1.06);
}
.nav-cart-btn svg { display: block; }

/* Wrapper that groups cart icon + back button in the product header */
.pd-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Product-page header cart button */
.pd-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--cart-border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cart-dark);
  cursor: pointer;
  transition: background .2s, border-color .2s;
  text-decoration: none;
  white-space: nowrap;
}
.pd-cart-btn:hover { background: var(--cart-bg); border-color: var(--cart-gold); }

/* Badge shared between both buttons */
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--cart-gold);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.nav-cart-btn .cart-badge { top: -5px; right: -5px; }

/* ============================================================
   PRODUCT CARD — layout fix + "Add to Cart" button
   ============================================================ */

/*
  Card layout: flex column → image link, body, button stack cleanly.
  The <a> now wraps only the image (structural fix in createProductCard).
  z-index:10 on hover prevents the lifted card from occluding neighbours.
*/
.product-card {
  display: flex;
  flex-direction: column;
  z-index: 0;
}

.product-card:hover {
  z-index: 10;
}

.product-card__actions {
  padding: 0 12px 12px;
  flex-shrink: 0;
}

.product-card__add-cart {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  background: var(--cart-dark, #1a0d00);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .12s, opacity .2s;
  letter-spacing: .01em;
  white-space: nowrap;
}
.product-card__add-cart:hover { background: #3a1800; }
.product-card__add-cart:active { transform: scale(.97); }
.product-card__add-cart--added {
  background: var(--cart-success, #059669) !important;
}

/* ============================================================
   PRODUCT DETAIL — "Add to Cart" button
   ============================================================ */

.pd-add-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--cart-dark, #1a0d00);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .12s;
  width: 100%;
  justify-content: center;
  margin-bottom: 12px;
}
.pd-add-cart-btn:hover { background: #3a1800; }
.pd-add-cart-btn:active { transform: scale(.98); }
.pd-add-cart-btn--added {
  background: var(--cart-success, #059669) !important;
}

/* ============================================================
   CART TOAST (brief notification)
   ============================================================ */

.cart-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--cart-dark, #1a0d00);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  transition: opacity .25s, transform .25s;
}
.cart-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   CART SIDEBAR
   ============================================================ */

/* Backdrop */
.cart-sidebar__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--cart-transition);
  z-index: 8998;
}

body.cart-open .cart-sidebar__backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Panel */
.cart-sidebar__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #fff;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform var(--cart-transition);
  z-index: 8999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.cart-open .cart-sidebar__panel {
  transform: translateX(0);
}

/* Header */
.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--cart-border);
  background: var(--cart-bg);
  flex-shrink: 0;
}

.cart-sidebar__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin: 0;
}

.cart-sidebar__count {
  font-weight: 400;
  color: var(--cart-muted);
  font-size: 0.9rem;
}

.cart-sidebar__close {
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--cart-muted);
  font-size: 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cart-sidebar__close:hover { background: #f5ece0; color: var(--cart-dark); }

/* Body — scrollable item list */
.cart-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  overscroll-behavior: contain;
}

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 40px;
  text-align: center;
  height: 100%;
  min-height: 200px;
}
.cart-empty__icon  { font-size: 3rem; margin-bottom: 14px; opacity: .65; }
.cart-empty__text  { font-size: 1rem; font-weight: 600; color: var(--cart-dark); margin: 0 0 6px; }
.cart-empty__sub   { font-size: 0.85rem; color: var(--cart-muted); margin: 0; line-height: 1.5; }

/* Cart item */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0e8db;
  transition: background .15s;
}
.cart-item:hover { background: #fdf9f3; }
.cart-item:last-child { border-bottom: none; }

.cart-item__image-wrap {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f0e6d6;
}
.cart-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cart-item__image-placeholder {
  width: 100%;
  height: 100%;
  background: #ede4d5;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cart-dark);
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}
.cart-item__name:hover { text-decoration: underline; }

.cart-item__price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cart-dark);
}
.cart-item__price--contact {
  font-style: italic;
  font-weight: 400;
  color: var(--cart-muted);
}

/* Quantity control */
.cart-item__qty-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.cart-qty-btn {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--cart-border);
  background: #fff;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-dark);
  line-height: 1;
  padding: 0;
  transition: background .15s;
}
.cart-qty-btn:hover { background: var(--cart-bg); }
.cart-item__qty {
  min-width: 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cart-dark);
}

/* Remove button */
.cart-item__remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: #c4a880;
  font-size: 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  margin-top: 2px;
  padding: 0;
}
.cart-item__remove:hover { background: #fef2f2; color: var(--cart-error); }

/* Footer */
.cart-sidebar__footer {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--cart-border);
  background: var(--cart-bg);
  flex-shrink: 0;
}
.cart-footer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--cart-muted);
}
.cart-footer__total strong {
  font-size: 1.1rem;
  color: var(--cart-dark);
}
.cart-footer__checkout {
  width: 100%;
  padding: 13px;
  background: var(--cart-dark);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .12s;
  margin-bottom: 8px;
}
.cart-footer__checkout:hover { background: #3a1800; }
.cart-footer__checkout:active { transform: scale(.98); }
.cart-footer__note {
  font-size: 0.76rem;
  color: var(--cart-muted);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* Mobile: full-width panel */
@media (max-width: 500px) {
  .cart-sidebar__panel {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    top: auto;
    height: 92dvh;
    height: 92vh;
  }
}

/* ============================================================
   "COMING SOON" MODAL
   ============================================================ */

.coming-soon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.coming-soon-overlay[hidden] { display: none; }

.coming-soon-modal {
  position: relative;
  background: #fff;
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow);
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 32px;
  text-align: center;
  animation: cs-pop .35s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes cs-pop {
  from { opacity: 0; transform: scale(.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* Top gold bar */
.coming-soon-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--cart-gold), #f0c830);
  border-radius: var(--cart-radius) var(--cart-radius) 0 0;
}

.coming-soon-modal__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--cart-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
}
.coming-soon-modal__close:hover { background: #f5ece0; color: var(--cart-dark); }

.coming-soon-modal__icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  display: block;
}

.coming-soon-modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin: 0 0 10px;
}

.coming-soon-modal__subtitle {
  font-size: 0.92rem;
  color: var(--cart-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.coming-soon-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.coming-soon-modal__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .12s, opacity .15s;
}
.coming-soon-modal__btn:hover { transform: scale(1.03); opacity: .92; }
.coming-soon-modal__btn--wa {
  background: #25d366;
  color: #fff;
}
.coming-soon-modal__btn--call {
  background: var(--cart-dark);
  color: #fff;
}

.coming-soon-modal__dismiss {
  background: none;
  border: 1.5px solid var(--cart-border);
  color: var(--cart-muted);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .15s;
}
.coming-soon-modal__dismiss:hover { background: var(--cart-bg); }

/* ── Buy Now button hidden until payments go live ── */
/* Online payments temporarily disabled.             */
/* Re-enable when client provides live Razorpay credentials. */
#pd-buy-now-btn {
  display: none !important;
}

/* ── Mobile adjustments ── */
@media (max-width: 480px) {
  .coming-soon-modal {
    padding: 36px 20px 26px;
  }
  .coming-soon-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .coming-soon-modal__btn {
    justify-content: center;
  }
}
