/* ===== JoinHerGlow design system ===== */

/* Self-hosted variable fonts (no CDN - keeps the CSP strict). Each file
   covers its full weight range, so one @font-face per style is enough. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/lora-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/lora-italic.woff2') format('woff2');
}

:root {
  --rose: #d46a82;
  --rose-dark: #b03a5c;
  --gold: #b8863f;
  --cream: #fdf8f4;
  --cream-dark: #f4e8de;
  --ink: #241a1e;
  --ink-soft: #6b5560;
  --success: #3a8558;
  --error: #c0392b;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(36,26,30,0.08);
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; min-width: 0; }
html { overflow-x: hidden; width: 100%; }
html, body { margin: 0; padding: 0; max-width: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--cream); line-height: 1.65; overflow-x: hidden; width: 100%; }
/* Grid/flex items default to a content-based min-width floor (the longest
   unbreakable word), which silently forces tracks wider than their column
   and overflows the page. The reset above removes that floor globally. */
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; margin: 0 0 12px; color: var(--ink); letter-spacing: 0.2px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85em; }
.center { text-align: center; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---- promo bar ---- */
.promo-bar { background: var(--ink); color: #f2e6df; text-align: center; padding: 9px 12px; font-size: 13px; font-weight: 600; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-bar strong { color: var(--gold); }
.promo-bar .icon { display: inline; vertical-align: -3px; margin-right: 2px; }

/* ---- header ---- */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 20px; flex-wrap: nowrap; }
.logo { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--rose-dark); white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--gold); }
.search-form { flex: 1 1 auto; display: flex; max-width: 360px; min-width: 0; }
.search-form input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #e5d5cd; border-radius: 20px 0 0 20px; outline: none; font-family: var(--font-body); }
.search-form button { display: flex; align-items: center; border: 1px solid #e5d5cd; border-left: none; background: var(--cream-dark); border-radius: 0 20px 20px 0; padding: 0 14px; cursor: pointer; color: var(--rose-dark); }
.main-nav { display: flex; gap: 18px; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.main-nav a:hover { color: var(--rose-dark); }
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }
.icon-link { position: relative; display: flex; color: var(--ink); }
.icon-link:hover { color: var(--rose-dark); }
.cart-badge { position: absolute; top: -7px; right: -9px; background: var(--rose-dark); color: #fff; font-size: 10px; font-family: var(--font-body); border-radius: 50%; width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 4px; flex-shrink: 0; }

/* ---- flash ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 12px auto; font-size: 14px; }
.flash-success { background: #e6f4ea; color: var(--success); }
.flash-error { background: #fbe9e7; color: var(--error); }

/* ---- hero: real photography with a bold color-wash overlay for legibility ---- */
.hero {
  background-image:
    linear-gradient(100deg, rgba(24,15,19,0.94) 0%, rgba(74,31,48,0.88) 38%, rgba(74,31,48,0.55) 62%, rgba(74,31,48,0.3) 100%),
    url('/assets/img/hero-bg.webp');
  background-size: cover;
  background-position: center 30%;
  padding: 90px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(184,134,63,0.30), transparent 55%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 100%; }
.eyebrow { display: inline-block; max-width: 90%; text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; color: var(--gold); font-weight: 700; font-family: var(--font-body); border: 1px solid rgba(184,134,63,0.5); border-radius: 20px; padding: 6px 14px; margin-bottom: 18px; white-space: normal; overflow-wrap: break-word; }
.hero h1 { font-size: clamp(30px, 8vw, 58px); margin: 10px 0; line-height: 1.1; overflow-wrap: break-word; word-break: break-word; color: #fff; font-weight: 700; max-width: 100%; }
.hero h1 .accent { color: var(--rose); font-style: italic; }
.hero-sub { max-width: min(540px, 92%); margin: 0 auto 30px; color: #e8d9d0; font-size: 17px; overflow-wrap: break-word; }
.hero .btn-primary { background: var(--rose); box-shadow: 0 8px 24px rgba(212,106,130,0.35); }
.hero .btn-primary:hover { background: var(--rose-dark); transform: translateY(-1px); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 30px; font-weight: 700; font-size: 14px; font-family: var(--font-body); cursor: pointer; border: none; text-align: center; transition: transform .15s, box-shadow .15s, background .15s; }
.btn-primary { background: var(--rose-dark); color: #fff; box-shadow: 0 4px 14px rgba(176,58,92,0.28); }
.btn-primary:hover { background: var(--rose); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(176,58,92,0.35); }
.btn-outline { background: transparent; border: 1.5px solid var(--rose-dark); color: var(--rose-dark); }
.btn-outline:hover { background: var(--rose-dark); color: #fff; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-block { display: flex; width: 100%; }
.link-btn { background: none; border: none; color: var(--rose-dark); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }
.link-btn.danger { color: var(--error); }

/* ---- sections / grids ---- */
.section { padding: 44px 0; }
.section-title { font-size: 30px; margin-bottom: 22px; position: relative; display: inline-block; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: -8px; width: 46px; height: 3px; background: var(--gold); border-radius: 2px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.category-tile { background: #fff; border-radius: var(--radius); padding: 28px 12px; text-align: center; font-weight: 700; font-family: var(--font-body); font-size: 14.5px; box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.category-tile:hover { border-color: var(--gold); transform: translateY(-2px); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(36,26,30,0.14); }
.product-card-media { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--cream-dark); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-card-media img { transform: scale(1.04); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 3px; z-index: 2; }
.badge-sale { left: auto; right: 10px; background: var(--rose-dark); color: #fff; }
.product-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 700; font-size: 14.5px; font-family: var(--font-body); }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price { font-weight: 800; color: var(--rose-dark); }
.price-row.lg .price { font-size: 26px; }
.price-compare { text-decoration: line-through; color: var(--ink-soft); font-size: 13px; }
.low-stock { color: var(--error); font-size: 12px; font-weight: 700; }
.stars { color: var(--gold); position: relative; display: inline-block; }
.stars-bg { position: absolute; left: 0; top: 0; overflow: hidden; color: #ddd; width: 100%; z-index: -1; }
.add-to-cart-form { margin-top: auto; }

/* ---- social proof ticker ---- */
.social-proof-ticker { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 20px; font-size: 13px; overflow: hidden; }
.ticker-item { padding: 4px 0; }

/* ---- trust ---- */
.trust-section { text-align: center; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; }
.trust-grid div { background: #fff; border-radius: var(--radius); padding: 26px 20px; box-shadow: var(--shadow); }
.trust-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--cream-dark); color: var(--rose-dark); margin-bottom: 10px; }
.trust-grid strong { display: block; font-family: var(--font-body); font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.trust-mini { font-size: 12px; color: var(--ink-soft); margin-top: 14px; }
.trust-mini.center { text-align: center; }

/* ---- shop page ---- */
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.shop-layout { display: grid; grid-template-columns: 200px 1fr; gap: 30px; }
.shop-filters { display: flex; flex-direction: column; gap: 8px; }
.shop-filters a { padding: 6px 0; font-size: 14px; }
.shop-filters a.active, .shop-filters a:hover { color: var(--rose-dark); font-weight: 700; }
.pagination { display: flex; gap: 8px; margin-top: 24px; }
.pagination a { padding: 6px 12px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.pagination a.active { background: var(--rose-dark); color: #fff; }

/* ---- product detail ---- */
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-detail-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.product-detail-info form.add-to-cart-form { display: flex; gap: 12px; align-items: center; margin: 18px 0; }
.product-detail-info input[type=number] { width: 70px; padding: 8px; border-radius: 8px; border: 1px solid #e5d5cd; }
.wishlist-form { margin-bottom: 14px; }
.product-description { margin-top: 24px; padding-top: 20px; border-top: 1px solid #eee; }
.reviews-section { margin-top: 50px; border-top: 1px solid #eee; padding-top: 30px; }
.review { background: #fff; padding: 14px; border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); }
.review-form { background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin-top: 20px; }
.review-form input, .review-form select, .review-form textarea { padding: 9px; border-radius: 8px; border: 1px solid #e5d5cd; }

/* ---- cart / checkout ---- */
.free-ship-nudge { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 20px; font-size: 14px; }
.free-ship-nudge.success { background: #e6f4ea; color: var(--success); font-weight: 700; }
.progress-bar { background: #eee; border-radius: 10px; height: 8px; margin-top: 8px; overflow: hidden; }
.progress-fill { background: var(--rose-dark); height: 100%; transition: width .3s; }
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 60px 1fr 70px 90px 60px; gap: 12px; align-items: center; background: #fff; border-radius: var(--radius); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.qty-form input { width: 55px; padding: 6px; border-radius: 6px; border: 1px solid #e5d5cd; }
.cart-summary { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: sticky; top: 90px; }
.coupon-form { display: flex; gap: 6px; margin-bottom: 14px; }
.coupon-form input { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #e5d5cd; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.total { font-weight: 800; font-size: 17px; border-top: 1px solid #eee; margin-top: 8px; padding-top: 10px; }
.summary-row.discount { color: var(--success); }

.checkout-form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.checkout-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.checkout-form input, .checkout-form textarea { padding: 10px; border-radius: 8px; border: 1px solid #e5d5cd; font-family: inherit; }
.payment-option { display: block; background: var(--cream-dark); padding: 12px; border-radius: 8px; }

.confirmation { text-align: center; }
.confirmation-card { max-width: 480px; margin: 0 auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; }
.check-icon { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--success); color: #fff; margin: 0 auto 16px; }
.order-items-list { text-align: left; margin: 20px 0; }

/* ---- auth ---- */
.auth-section { display: flex; justify-content: center; padding: 60px 0; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; width: 100%; max-width: 380px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.auth-card label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.auth-card input { padding: 10px; border-radius: 8px; border: 1px solid #e5d5cd; }

/* ---- account ---- */
.account-layout { display: grid; grid-template-columns: 180px 1fr; gap: 30px; }
.account-nav { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; height: fit-content; }
.account-nav a, .account-nav button { padding: 8px 0; font-size: 14px; text-align: left; }
.order-row { display: grid; grid-template-columns: 1fr 100px 100px 100px 60px; gap: 10px; align-items: center; background: #fff; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); font-size: 14px; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.status-pending { background: #fdf1d6; color: #916b00; }
.status-processing { background: #dceafd; color: #1d5fbf; }
.status-shipped { background: #e3dcfd; color: #5b3bd6; }
.status-completed { background: #e6f4ea; color: var(--success); }
.status-cancelled { background: #fbe9e7; color: var(--error); }

/* ---- footer ---- */
.site-footer { background: var(--ink); color: #eadfe0; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding: 50px 20px 30px; }
.footer-col h4 { color: #fff; }
.footer-col a { display: block; padding: 4px 0; color: #cbb; font-size: 14px; }
.newsletter-form { display: flex; gap: 6px; margin: 10px 0; }
.newsletter-form input { flex: 1; padding: 10px; border-radius: 8px; border: none; }
.hp-wrap { position: absolute; left: -9999px; top: -9999px; }
.trust-strip { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid #443; font-size: 13px; }
.copyright { padding: 14px 20px; font-size: 12px; color: #998; border-top: 1px solid #443; }

/* ---- modal (exit intent) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: #fff; border-radius: var(--radius); padding: 34px; text-align: center; max-width: 340px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 22px; cursor: pointer; }
.coupon-pill { background: var(--cream-dark); border: 2px dashed var(--gold); border-radius: 8px; padding: 10px; font-weight: 800; letter-spacing: 2px; margin: 14px 0; }

/* ---- sticky add-to-cart (mobile) ---- */
.sticky-add-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.1); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 60; }
.sticky-add-bar[hidden] { display: none; }

/* ---- admin ---- */
.admin-body { background: #f5f2ee; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--ink); color: #eee; padding: 20px; display: flex; flex-direction: column; }
.admin-logo { font-family: var(--font-heading); font-size: 18px; margin-bottom: 24px; }
.admin-logo span { color: var(--gold); }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-sidebar nav a { padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.08); }
.admin-logout { margin-top: 16px; }
.admin-logout button { color: #eadfe0; }
.admin-main { flex: 1; padding: 30px 40px; }
.admin-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--rose-dark); }
.stat-card .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.admin-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: var(--cream-dark); text-align: left; padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table td { padding: 10px 14px; border-top: 1px solid #f0ebe6; font-size: 14px; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.thumb-lg { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.admin-form { display: flex; flex-direction: column; gap: 12px; }
.admin-form label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.admin-form input, .admin-form select, .admin-form textarea { padding: 9px; border-radius: 8px; border: 1px solid #e5d5cd; font-family: inherit; }
.admin-form .form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.review-mod-card { margin-bottom: 14px; }

/* ---- tables: horizontal-scroll on narrow screens instead of breaking layout ---- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .admin-table { min-width: 640px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .product-detail-grid, .cart-layout, .checkout-layout, .shop-layout, .account-layout, .admin-two-col, .footer-inner { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 50px 1fr; grid-template-rows: auto auto; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}

@media (max-width: 760px) {
  .search-form { display: none; }
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; box-shadow: var(--shadow);
    padding: 6px 20px 14px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; border-bottom: 1px solid #f2e9e4; }
  .nav-toggle { display: flex; }
  .header-inner { position: relative; }
  .order-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; row-gap: 6px; }
  .order-row a.link-btn { grid-column: span 2; }
}

@media (max-width: 480px) {
  .hero { padding: 60px 0 54px; }
  .footer-inner { padding: 40px 16px 20px; }
  .trust-strip { justify-content: center; text-align: center; gap: 14px 18px; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}

/* Force a predictable 2-up grid on narrow screens rather than trusting
   auto-fit's track calculation, which was overflowing on some viewports. */
@media (max-width: 640px) {
  .category-grid, .trust-grid, .product-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
