/* ==========================================================================
   ANRAF Studio — E-Commerce Storefront CSS
   Luxury Pakistani Couture & Ready-to-Wear (Lawn, Embroidered, Heritage)
   Fonts: Cormorant Garamond (headings/editorial), DM Sans (UI/body)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Sans:wght@200;300;400;500;600;700&family=Dancing+Script:wght@400;500;600&display=swap');

:root {
  --studio-bg: #dfd7cc;
  --ink:       #111111;
  --dark:      #1a1a1a;
  --mid:       #4a4a46;
  --muted:     #777777;
  --border:    rgba(0, 0, 0, 0.08);
  --border-dark: #222222;
  --cream:     #f8f6f0;
  --white:     #ffffff;
  --gold:      #c9a96e;
  --gold-dark: #b08d52;
  --sale-red:  #c0392b;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);

  --font-serif: 'Cormorant', Georgia, serif;
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script:'Dancing Script', cursive;

  --header-height: 68px;
  --max-w: 1400px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
  line-height: 1.5;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── HEADER ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: transform 0.35s var(--ease);
}
.site-header.nav-hidden { transform: translateY(-100%); }
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ham-btn {
  background: none;
  border: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ham-btn span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
}
.logo {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  position: relative;
  padding: 4px;
}
.cart-badge {
  font-size: 11px;
  font-weight: 500;
  margin-left: 3px;
}

/* ── DRAWER ──────────────────────────────────────────────────────────── */
.d-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.d-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--white);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 50px rgba(0,0,0,0.1);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.drawer-logo { font-family: var(--font-serif); font-size: 1.8rem; letter-spacing: 0.18em; }
.drawer-close { background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--muted); }
.drawer-nav { display: flex; flex-direction: column; gap: 1.25rem; }
.drawer-nav a { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 400; color: var(--ink); }
.drawer-nav a:hover { color: var(--gold-dark); }

/* ── SEARCH OVERLAY ─────────────────────────────────────────────────── */
.srch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 250;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.5rem;
}
.srch-overlay.open { display: flex; }
.srch-inner { width: 100%; max-width: 600px; display: flex; flex-direction: column; gap: 1.5rem; }
.srch-bar { display: flex; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; }
.srch-bar input { flex: 1; border: none; outline: none; font-size: 1.3rem; font-family: var(--font-serif); background: transparent; }
.srch-results { display: flex; flex-direction: column; gap: 0.75rem; max-height: 60vh; overflow-y: auto; }
.srch-item { display: flex; align-items: center; gap: 1rem; padding: 8px 0; border-bottom: 1px solid var(--border); }
.srch-item img { width: 50px; height: 65px; object-fit: cover; }


/* ── FILTER & SORT BAR ──────────────────────────────────────────────── */
.filter-bar {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  padding: 0.9rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.filter-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}
.pill-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.pill-btn:hover, .pill-btn.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.filter-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sort-select {
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  outline: none;
  cursor: pointer;
}
.item-count { font-size: 0.8rem; color: var(--muted); }

/* ── PRODUCT GRID ────────────────────────────────────────────────────── */
.store-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  width: 100%;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 1.25rem;
}
@media (min-width: 768px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 3.5rem 2rem; }
}
@media (min-width: 1100px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 4rem 2rem; }
}

/* Product Card */
.p-card {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}
.p-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f4efe8;
  margin-bottom: 0.85rem;
}
.p-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.p-img-wrap .img-secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.p-card:hover .img-primary { opacity: 0; }
.p-card:hover .img-secondary { opacity: 1; transform: scale(1.04); }

.badge-sale {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--sale-red);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 2;
}
.badge-sold {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(17, 17, 17, 0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 2;
}

.p-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: center;
  padding: 6px 4px 8px;
}
.p-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.2;
}
.p-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 6px;
  min-height: 2.7em; /* Exactly 2 lines height: keeps all titles & prices in row aligned */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.p-card:hover .p-title { color: var(--gold-dark); }
.p-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-top: auto;
  white-space: nowrap;
}
.p-price-row span,
.p-was-price,
.p-now-sale {
  white-space: nowrap;
}
.p-was-price {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 300;
}
.p-now-sale { color: var(--sale-red); font-weight: 600; }

/* ── FLOATING WHATSAPP BUTTON ────────────────────────────────────────── */
.wa-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0, 0, 0, 0.15);
  color: #ffffff !important;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.wa-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.6), 0 3px 8px rgba(0, 0, 0, 0.2);
  color: #ffffff !important;
}
.wa-bubble svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}
@media (max-width: 768px) {
  .wa-bubble {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 18px;
    width: 48px;
    height: 48px;
    z-index: 9999;
  }
  .wa-bubble svg {
    width: 26px;
    height: 26px;
  }
}



/* ── PRODUCT DETAIL PAGE ────────────────────────────────────────────── */
.product-page-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  width: 100%;
}
.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .product-hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4.5rem;
  }
}

/* Gallery */
.gallery-wrapper {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
}
@media (min-width: 640px) {
  .gallery-wrapper {
    flex-direction: row;
    gap: 1.25rem;
  }
}
.gallery-thumbs {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
}
@media (min-width: 640px) {
  .gallery-thumbs {
    flex-direction: column;
    width: 80px;
    flex-shrink: 0;
  }
}
.thumb-img {
  width: 75px;
  height: 100px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid transparent;
  opacity: 0.65;
  transition: all 0.2s ease;
  background: #f4efe8;
}
.thumb-img.active, .thumb-img:hover {
  border-color: var(--ink);
  opacity: 1;
}
.main-img-box {
  flex: 1;
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f4efe8;
}
.main-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s var(--ease);
}
.main-img-box:hover img { transform: scale(1.05); }

/* Product Info Column */
.product-details-col {
  display: flex;
  flex-direction: column;
}
.p-detail-cat {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.p-detail-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.p-detail-price {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.p-detail-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--mid);
  margin-bottom: 2rem;
  white-space: pre-line;
}

/* Size & Option Selector */
.option-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.6rem;
  display: block;
}
.size-selector {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.size-pill {
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.size-pill.active, .size-pill:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* Actions */
.purchase-row {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}
.qty-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  padding: 0 4px;
}
.qty-btn {
  background: none;
  border: none;
  width: 36px;
  height: 48px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-num {
  width: 32px;
  text-align: center;
  font-weight: 500;
}
.btn-add-cart {
  flex: 1;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  padding: 14px 24px;
  transition: all 0.25s ease;
}
.btn-add-cart:hover {
  background: #333;
}
.btn-whatsapp-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  border: none;
  padding: 13px 24px;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  transition: background 0.25s ease;
  margin-bottom: 2rem;
}
.btn-whatsapp-order:hover { background: #1eb956; }

/* Accordions */
.accordion {
  border-top: 1px solid var(--border);
}
.acc-item {
  border-bottom: 1px solid var(--border);
}
.acc-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.acc-panel {
  display: none;
  padding-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--mid);
  line-height: 1.7;
}
.acc-panel.open { display: block; }

/* ── CHECKOUT PAGE ──────────────────────────────────────────────────── */
.checkout-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  width: 100%;
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 850px) {
  .checkout-grid {
    grid-template-columns: 1.35fr 0.9fr;
    gap: 4rem;
  }
}
.checkout-section-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.form-row {
  margin-bottom: 1.25rem;
}
.form-row label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d8d4cb;
  border-radius: 2px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
  background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--ink);
}

.payment-method-box {
  border: 1px solid var(--ink);
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.payment-method-box input[type="radio"] {
  margin-top: 3px;
}
.payment-title { font-weight: 500; font-size: 0.95rem; display: block; margin-bottom: 2px; }
.payment-desc { font-size: 0.82rem; color: var(--muted); }

/* Order Summary Box */
.order-summary-box {
  background: var(--cream);
  padding: 2rem;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}
.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.summary-item-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.summary-thumb {
  width: 58px;
  height: 76px;
  object-fit: cover;
  background: #fff;
}
.summary-info { flex: 1; }
.summary-name { font-size: 0.9rem; font-weight: 500; line-height: 1.3; }
.summary-sub { font-size: 0.78rem; color: var(--muted); }
.summary-price { font-size: 0.9rem; font-weight: 500; }

.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}
.total-line {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  border-top: 1px solid rgba(0,0,0,0.12);
  padding-top: 1rem;
  margin-top: 1rem;
}

.btn-place-order {
  width: 100%;
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 15px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-top: 1.5rem;
  transition: background 0.25s ease;
}
.btn-place-order:hover { background: #333; }

/* ── SLIDE-IN MINI CART ──────────────────────────────────────────────── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  z-index: 310;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0,0,0,0.15);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-drawer-title { font-family: var(--font-serif); font-size: 1.35rem; }
.cart-drawer-close { background: none; border: none; font-size: 1.5rem; line-height: 1; }
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-drawer-foot {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cream);
}

/* ── FOOTER ─────────────────────────────────────────────────────────── */
footer {
  background: #111111;
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 1.5rem 3rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 3rem;
}
.footer-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.footer-links a:hover { color: #fff; }
.footer-copy {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Loading placeholders reserve image space and respect reduced-motion preferences. */
[hidden] { display: none !important; }
.loading-status { color: var(--muted); font-size: .85rem; padding: .75rem 0; }
.skeleton { background: linear-gradient(100deg, #f0ece6 20%, #faf8f4 45%, #f0ece6 70%); background-size: 240% 100%; animation: skeleton-shimmer 1.6s ease-in-out infinite; border-radius: 2px; }
.skeleton-photo { width: 100%; aspect-ratio: 3 / 4; }
.skeleton-line { width: 78%; height: 14px; margin-top: 18px; }
.skeleton-line.short { width: 42%; height: 12px; margin-top: 12px; }
.skeleton-copy { height: 130px; margin-top: 36px; }
@keyframes skeleton-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
