/* ============================================================
   Gaon Dry Fruits — page layout styles (shop / product / cart /
   checkout / account / orders / tracking / auth pages)
   Builds on top of style.css design tokens.
   ============================================================ */

.page-hero { background: linear-gradient(135deg, var(--green-900), var(--green-600)); color: #fff; padding: 44px 0; text-align: center; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
.page-hero p { color: rgba(255,255,255,.75); margin-top: 8px; }

.wrap { padding: 40px 0 70px; min-height: 50vh; }

/* ---------------- generic cards / panels ---------------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.panel h3 { margin: 0 0 16px; font-size: 1.1rem; }
.muted { color: var(--muted); font-size: .88rem; }
.row { display: flex; justify-content: space-between; align-items: center; }

/* ---------------- shop page ---------------- */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: clamp(16px, 2.5vw, 28px); }
.side-filters { position: sticky; top: calc(72px + var(--safe-top, 0px)); align-self: start; }
.side-filters h4 { font-size: .95rem; margin-bottom: 12px; }
.side-filters .cat-btn { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: .9rem; color: var(--ink); margin-bottom: 3px; }
.side-filters .cat-btn:hover, .side-filters .cat-btn.active { background: var(--green-50); color: var(--green-700); font-weight: 700; }

.sf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sf-head h4 { margin-bottom: 0; }
.sf-apply { margin-top: 16px; }

.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); padding-top: 18px; }
.breadcrumbs a { color: var(--muted); transition: color .2s; }
.breadcrumbs a:hover { color: var(--green-700); }
.breadcrumbs b { color: var(--green-700); font-weight: 700; }
.breadcrumbs span { opacity: .5; }

.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--green-50); border: 1px solid var(--green-100);
  color: var(--green-700); font-weight: 700; font-size: .82rem;
  padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer;
  transition: background .2s, transform .2s;
}
.chip svg { width: 13px; height: 13px; }
.chip:hover { background: var(--green-100); transform: translateY(-1px); }

.shop-topbar { margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.filter-toggle { flex: none; }
.u-grow { flex: 1; min-width: 200px; }

/* ---------------- product detail ---------------- */
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 44px); min-width: 0; }
.pd-grid .breadcrumbs { grid-column: 1 / -1; margin-bottom: 6px; }
.pd-img { border-radius: var(--r-md); overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; aspect-ratio: 1 / 1; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-img img.zoomable { cursor: zoom-in; transition: transform .4s ease; }
.pd-img:hover img.zoomable { transform: scale(1.04); }

/* image lightbox */
#imgLightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(16,24,17,.92); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
#imgLightbox.open { opacity: 1; pointer-events: auto; }
#imgLightbox img {
  max-width: min(880px, 94vw); max-height: 88vh;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
#imgLightbox .lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  font-size: 1.7rem; line-height: 1; display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
#imgLightbox .lb-close:hover { background: rgba(255,255,255,.25); transform: rotate(90deg); }

/* sticky mobile buy-bar */
#stickyBuyBar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  z-index: 160; display: none;
  width: min(560px, calc(100% - 20px)); margin-inline: auto;
  align-items: center; gap: 14px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
}
.sbb-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sbb-name { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sbb-price { font-size: 1.05rem; font-weight: 800; color: var(--green-700); }
.sbb-add { flex: none; padding: 11px 22px; }

@media (max-width: 760px) {
  #stickyBuyBar { display: flex; animation: sbbIn .45s cubic-bezier(.22,.9,.3,1); }
}
@keyframes sbbIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

.g-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.g-thumb { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--bg-soft); cursor: pointer; padding: 0; opacity: .7; transition: .2s; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb.active { border-color: var(--green-600); opacity: 1; }
.g-thumb:hover { opacity: 1; }
.pd-info h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.pd-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.pd-desc { color: var(--muted); line-height: 1.7; margin: 16px 0; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ---------------- cart page ---------------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: clamp(16px, 2.5vw, 28px); align-items: start; min-width: 0; }
.cart-line { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line img { width: 90px; height: 90px; object-fit: cover; border-radius: 12px; }
.cart-line h4 { font-size: 1rem; margin-bottom: 4px; }
.cart-line .price { font-weight: 800; color: var(--green-700); }
.cart-line .rm { color: var(--danger); font-size: .82rem; font-weight: 700; background: none; }
.summary-card { position: sticky; top: 100px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .95rem; }
.summary-row.grand { font-weight: 800; font-size: 1.2rem; border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 12px; color: var(--green-700); }
.coupon-inline { display: flex; gap: 8px; margin: 14px 0; }
.coupon-inline input { flex: 1; height: 42px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 0 12px; text-transform: uppercase; outline: none; }

/* ---------------- checkout ---------------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 400px; gap: clamp(16px, 2.5vw, 28px); align-items: start; min-width: 0; }
.checkout-form .field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.checkout-form input, .checkout-form textarea, .checkout-form select {
  width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0 15px; font-size: .95rem; outline: none; background: #fdfdfb;
}
.checkout-form textarea { height: auto; min-height: 84px; padding: 12px 15px; resize: vertical; }
.checkout-form input:focus, .checkout-form textarea:focus, .checkout-form select:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(52,119,78,.12); }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* .pay-opt styles live in style.css (single source) */

/* ---------------- auth pages ---------------- */
.auth-page { min-height: 82vh; display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(440px, 94%); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 34px; }
.auth-card h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.auth-card .field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; }
.auth-card input { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0 15px; font-size: .95rem; outline: none; background: #fdfdfb; transition: border-color .3s, box-shadow .3s; }
.auth-card input:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(52,119,78,.12); }
.auth-switch { text-align: center; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.auth-switch a { color: var(--green-700); font-weight: 700; }
.divider { display:flex; align-items:center; gap:12px; margin:18px 0 6px; color:var(--muted); font-size:.82rem; font-weight:600; }
.divider::before, .divider::after { content:''; flex:1; height:1px; background:var(--line); }

/* ---------------- account ---------------- */
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: clamp(16px, 2.5vw, 28px); align-items: start; min-width: 0; }
.acct-nav { position: sticky; top: calc(72px + var(--safe-top, 0px)); }
.acct-nav a { display: block; padding: 11px 14px; border-radius: 8px; font-size: .92rem; color: var(--ink); margin-bottom: 3px; }
.acct-nav a:hover, .acct-nav a.active { background: var(--green-50); color: var(--green-700); font-weight: 700; }
.acct-nav .logout { color: var(--danger); }
.addr-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; position: relative; }
.addr-card .label { font-weight: 800; color: var(--green-700); }
.addr-card .default-tag { position: absolute; top: 14px; right: 14px; font-size: .7rem; background: var(--gold-soft); color: #6b5200; padding: 3px 10px; border-radius: 999px; font-weight: 700; }

/* ---------------- tables (orders) ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; position: relative; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.table th { text-align: left; padding: 12px 14px; background: var(--bg-soft); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

/* ---------------- status pills ---------------- */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-pill.pending { background: var(--warning-soft); color: var(--warning); }
.status-pill.confirmed, .status-pill.processing { background: var(--info-soft); color: var(--info); }
.status-pill.shipped { background: #e9ecf7; color: #4b3ea8; }
.status-pill.delivered, .status-pill.paid { background: var(--success-soft); color: var(--success); }
.status-pill.cancelled, .status-pill.failed { background: var(--danger-soft); color: var(--danger); }
.status-pill.refunded, .status-pill.returned { background: #f0ede0; color: #6b5f3a; }

/* ---------------- tracking ---------------- */
.track-card { max-width: 560px; margin: 0 auto; }
.track-steps { list-style: none; margin: 18px 0 0; padding: 0; }
.track-steps li { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.track-steps li:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 34px; bottom: -6px; width: 2px; background: var(--line); }
.track-steps .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); flex: 0 0 auto; margin-top: 2px; }
.track-steps li.done .dot { background: var(--green-600); }
.track-steps li.pending .dot { background: #cfd4c8; }
.track-steps .st { font-weight: 700; } .track-steps .tm { color: var(--muted); font-size: .8rem; }

/* .empty-state styles live in style.css (single source) */

/* ---------------- misc ---------------- */
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .9rem; }
.alert.success { background: var(--success-soft); color: var(--success); border: 1px solid #bfe3c8; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c6c1; }
.center-text { text-align: center; }
.mt-20 { margin-top: 20px; }
