/*! NILA Jewellery — Author: Karthikeya Dev */
/* ═══ NILA — phone menu, tab bar, product cards, sort sheet ═══════
   Loaded after the theme bundles. Brand tokens match nila.css and the app. */
:root { --n-ink:#14110F; --n-gold:#C5A059; --n-gold-d:#9A7B3E; --n-porc:#FBFAF8; --n-shell:#F3F0EB;
        --n-rule:#E2DCD2; --n-patina:#8A7B63; --n-green:#3E6B4F; --n-tab:62px; }

/* ── Offer line under prices ("Buy 2 · 20% off · NILA20") ── */
.nila-offer { display:block; margin-top:.3rem; font-size:.74rem; line-height:1.35; color:var(--n-green); font-weight:500; letter-spacing:.01em; }
.nila-offer b { font-weight:600; letter-spacing:.04em; }
.nila-offer em { font-style:normal; color:var(--n-patina); font-weight:400; }

/* ── Listing cards ── */
.grid-view-card { border:0 !important; background:transparent !important; box-shadow:none !important; }
.grid-view-card .img-box-h250 { position:relative; background:var(--n-shell); border-radius:2px; overflow:hidden; height:auto !important; }
.grid-view-card .img-box-h250 img { width:100%; aspect-ratio:3/4; height:auto !important; object-fit:cover; display:block; }
.grid-view-card .card-body { padding:.6rem .1rem 0 !important; text-align:left !important; }
.grid-view-card .card-title { font-family:'Jost',sans-serif !important; font-size:.86rem !important; font-weight:400 !important; color:var(--n-ink) !important;
  margin:0 0 .2rem !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.grid-view-card .card-price { font-family:'Jost',sans-serif !important; font-size:.95rem !important; font-weight:600 !important; color:var(--n-ink) !important; margin:0 !important; }
.grid-view-card .text-decoration-line-through { color:var(--n-patina) !important; font-weight:400 !important; }
.grid-view-card .product-discount-label { color:var(--n-gold-d) !important; font-weight:500 !important; }
.grid-view-card .text-success { color:var(--n-gold-d) !important; }
.grid-view-card .add-in-cart-btn { margin-top:.55rem; background:var(--n-ink) !important; border:1px solid var(--n-ink) !important; color:#fff !important;
  border-radius:2px !important; font-size:.68rem !important; letter-spacing:.14em; text-transform:uppercase; padding:.5rem .4rem !important; }
.grid-view-card .add-in-cart-btn:hover { background:#2A2320 !important; }
.grid-view-card .rating-div { position:absolute; top:8px; right:8px; z-index:3; }
.grid-view-card .add-to-fav-btn { width:32px; height:32px; border-radius:50%; background:#fff; display:flex; align-items:center; justify-content:center; box-shadow:0 1px 4px rgba(20,17,15,.12); }
.nila-rate-chip { position:absolute; left:8px; bottom:8px; z-index:2; background:rgba(255,255,255,.94); color:var(--n-ink); border-radius:20px;
  font-size:.7rem; font-weight:500; padding:.15rem .55rem; font-variant-numeric:tabular-nums; }
.nila-rate-chip i { font-style:normal; color:var(--n-gold); }
.pagination .page-link { color:var(--n-ink) !important; border-color:var(--n-rule) !important; background:#fff !important; }
.pagination .active .page-link, .pagination .page-item.active .page-link { background:var(--n-ink) !important; border-color:var(--n-ink) !important; color:#fff !important; }

/* ── Sort sheet: a list of rows, the chosen one shaded (phone) ── */
#sort-by.offcanvas-bottom { height:auto !important; max-height:80vh; border-radius:16px 16px 0 0; border:0; }
#sort-by .offcanvas-header { padding:1.1rem 1.25rem; border-bottom:1px solid var(--n-rule); }
#sort-by .offcanvas-title { font-family:'Cormorant Garamond',Georgia,serif; font-weight:400; font-size:1.5rem; }
#sort-by .offcanvas-body { padding:0; }
#sort-by .form-check { padding:0; margin:0; }
#sort-by .form-check-label { display:flex !important; align-items:center; width:100%; padding:1rem 1.25rem !important; border-bottom:1px solid var(--n-rule);
  font-size:.95rem; color:var(--n-ink); cursor:pointer; }
#sort-by .form-check-input { position:absolute; opacity:0; pointer-events:none; }
#sort-by .form-check-label:has(input:checked) { background:var(--n-shell); font-weight:600; }

/* ── Phone header icons ── */
.nila-hicons { display:flex; align-items:center; gap:.9rem; margin-left:auto; }
.nila-hicons a { position:relative; display:flex; color:var(--n-ink); }
.nila-hicons svg, .nila-tabbar svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.nila-hcount { position:absolute; top:-6px; right:-8px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:var(--n-gold); color:var(--n-ink);
  font-size:.6rem; font-weight:600; line-height:16px; text-align:center; }
.nila-hcount:empty { display:none; }

/* ── Phone menu (drawer) ── */
.offcanvas.nila-drawer { width:100vw !important; max-width:520px; background:#fff; border:0; }
.nd { display:flex; flex-direction:column; height:100%; color:var(--n-ink); font-family:'Jost',sans-serif; }
.nd-top { display:flex; align-items:center; justify-content:space-between; padding:1rem 1.1rem; border-bottom:1px solid var(--n-rule); }
.nd-acct { display:flex; align-items:center; gap:.6rem; color:var(--n-ink) !important; text-decoration:none; font-size:.95rem; }
.nd-acct svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.5; }
.nd-x { border:0; background:none; font-size:2rem; line-height:1; color:var(--n-ink); padding:0 .25rem; }
.nd-body { flex:1; display:flex; min-height:0; }
.nd-tabs { flex:0 0 38%; max-width:170px; background:var(--n-porc); border-right:1px solid var(--n-rule); overflow-y:auto; }
.nd-tabs button, .nd-tabs a { display:block; width:100%; text-align:left; border:0; background:none; padding:1.05rem 1rem; font-size:.92rem;
  color:var(--n-patina) !important; text-decoration:none; border-bottom:1px solid var(--n-rule); font-family:inherit; }
.nd-tabs .on { background:#fff; color:var(--n-ink) !important; font-weight:500; box-shadow:inset 3px 0 0 var(--n-gold); }
.nd-tabs .nd-play { color:var(--n-gold-d) !important; font-weight:500; }
.nd-panels { flex:1; overflow-y:auto; background:#F7F5F1; }
.nd-panel { display:none; grid-template-columns:1fr 1fr; gap:10px; padding:12px; align-content:start; }
.nd-panel.on { display:grid; }
.nd-tile { display:flex; flex-direction:column; align-items:center; gap:.45rem; background:#fff; border-radius:10px; padding:8px 8px 10px;
  text-decoration:none; color:var(--n-ink) !important; }
.nd-pic { width:100%; aspect-ratio:1; background:var(--n-shell); border-radius:6px; overflow:hidden; }
.nd-pic img { width:100%; height:100%; object-fit:cover; display:block; }
.nd-name { font-size:.8rem; text-align:center; line-height:1.2; }
.nd-band { grid-column:1 / -1; display:block; background:#fff; border:1px solid var(--n-rule); border-radius:8px; padding:1rem; text-align:center;
  font-family:'Cormorant Garamond',Georgia,serif; font-size:1.2rem; color:var(--n-ink) !important; text-decoration:none; }
.nd-all { grid-column:1 / -1; justify-self:center; margin:.4rem 0 1rem; font-size:.85rem; color:var(--n-ink) !important; text-decoration:underline; text-underline-offset:4px; }
.nd-foot { display:flex; flex-wrap:wrap; gap:.4rem 1.2rem; padding:.9rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)); border-top:1px solid var(--n-rule); }
.nd-foot a { font-size:.8rem; color:var(--n-patina) !important; text-decoration:none; }

/* ── Tab bar (phones and tablets, matching the phone header) ── */
.nila-tabbar { display:none; }
@media (max-width:1199.98px) {
  .nila-tabbar { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:1040; height:calc(var(--n-tab) + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom); background:rgba(255,255,255,.97); border-top:1px solid var(--n-rule);
    backdrop-filter:saturate(1.4) blur(8px); -webkit-backdrop-filter:saturate(1.4) blur(8px); }
  .nila-tabbar a { flex:1; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    color:var(--n-patina) !important; text-decoration:none; font-size:.66rem; letter-spacing:.02em; }
  .nila-tabbar a.on { color:var(--n-ink) !important; font-weight:500; }
  .nila-tabbar a.on svg { stroke-width:1.9; }
  .nila-tabbar .tb-play { color:var(--n-gold-d) !important; font-weight:500; }
  .nila-tabbar .tb-play svg { stroke:var(--n-gold-d); }
  .nila-tabbar b { position:absolute; top:7px; left:calc(50% + 6px); min-width:16px; height:16px; padding:0 4px; border-radius:8px;
    background:var(--n-gold); color:var(--n-ink); font-size:.6rem; line-height:16px; text-align:center; font-weight:600; }
  .nila-tabbar b:empty { display:none; }
  body { padding-bottom:calc(var(--n-tab) + env(safe-area-inset-bottom)); }
  /* Floating buttons sit above the bar rather than under it. */
  .floating-whatsapp, .whatsapp-float, #nila-wa-float, .back-to-top, #back-to-top, .nila-float { bottom:calc(var(--n-tab) + 16px) !important; }
}

/* ── Footer credit: readable on the dark/shell footer ── */
.copyright-section { color:var(--n-ink); }
.copyright-section .nila-credit { opacity:1 !important; color:var(--n-patina); }
/* The tab bar and header carry the bag on phones; the old one beside search goes. */
@media (max-width:1199.98px) { .searchcontainer + ul .shopingicon { display:none !important; } .nila-hicons { margin-right:6px; } }
.nila-tabbar b.is-zero, .nila-hcount.is-zero { display:none; }

/* Checkboxes, radios and switches in NILA ink (filters, checkout, account). */
.form-check-input:checked { background-color:#14110F !important; border-color:#14110F !important; }
.form-check-input:focus { border-color:#C5A059 !important; box-shadow:0 0 0 .2rem rgba(197,160,89,.2) !important; }
.form-range::-webkit-slider-thumb { background:#14110F; }
.form-range::-moz-range-thumb { background:#14110F; }

/* ── Foldables and small tablets (Galaxy Z Fold open ≈ 690–884px, iPad mini 744px) ──
   Bootstrap caps .container at 540px / 720px in this range, leaving wide empty
   gutters, and the grids stay at 2 tall columns. Use the full width and 3 columns. */
@media (min-width: 576px) and (max-width: 991.98px) {
  .container, .container-sm, .container-md { max-width: 100% !important; padding-left: 20px; padding-right: 20px; }
  .grid-card-container.col-6,
  .row > .col-6.col-md-3, .row > .col-6.col-md-4, .row > .col-md-4.col-6 { flex: 0 0 33.3333% !important; max-width: 33.3333% !important; }
  .nila-cat.col-6 { flex: 0 0 33.3333% !important; max-width: 33.3333% !important; }
  .nd-panel { grid-template-columns: repeat(3, 1fr); }
}
/* Product page on an open foldable: photo and buy box side by side. */
@media (min-width: 680px) and (max-width: 991.98px) {
  .Product-Detail-card > .d-lg-none.col-lg-6,
  .Product-Detail-card > .col-lg-6:not(.d-none) { flex: 0 0 50% !important; max-width: 50% !important; width: 50% !important; }
  .Product-Detail-card > .d-lg-none.col-lg-6 { position: sticky; top: 70px; align-self: flex-start; }
}
/* Wide unfolded screens (≥ 768px but below desktop): 4 home tiles. */
@media (min-width: 820px) and (max-width: 991.98px) {
  .row > .col-6.col-md-3 { flex: 0 0 25% !important; max-width: 25% !important; }
}
/* Galaxy Fold cover screen (≈ 344px): tighter gutters so two columns still breathe. */
@media (max-width: 360px) {
  .container, .container-fluid { padding-left: 10px !important; padding-right: 10px !important; }
  .grid-card-container .card-title, .nl-name, .nila-name { font-size: .78rem !important; }
  .nila-tabbar span { font-size: 9.5px !important; }
}
/* Product page buy buttons: even widths, wrap instead of being cut off. */
.nila-buy-row { flex-wrap: wrap; }
.nila-buy-row > *, .nila-buy-row > a > button { flex: 1 1 140px; min-width: 0; }
.nila-buy-row > a.nila-wa-order { flex: 1 1 100%; }
.nila-buy-row .btn { width: 100%; white-space: nowrap; min-height: 46px; }
.nila-buy-row .btn.whatsapp { background: #1F7A4A !important; border-color: #1F7A4A !important; color: #fff !important; }
