/* ══════════════════════════════════════════════════════════
   BigBoyPeps — Shared Styles
   Mobile-first: base = mobile, scale up with min-width
   Breakpoints:
     480px  = small phone landscape / large phone
     768px  = tablet
     1024px = laptop
     1200px = desktop (max-width container)
══════════════════════════════════════════════════════════ */

/* ── NAV ─────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(12,12,12,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center;
}
@media (min-width: 768px) { nav { height: 62px; } }

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  gap: 8px;
}
@media (min-width: 480px)  { .nav-inner { padding: 0 20px; } }
@media (min-width: 768px)  { .nav-inner { padding: 0 28px; } }
@media (min-width: 1024px) { .nav-inner { padding: 0 32px; } }

.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-d); font-size: 1.25rem; letter-spacing: .06em; color: var(--white);
  flex-shrink: 0;
}
@media (min-width: 480px) { .nav-brand { font-size: 1.4rem; } }
@media (min-width: 768px) { .nav-brand { font-size: 1.5rem; } }
.nav-brand span { color: var(--red); }

/* Hide nav links on mobile — show hamburger instead via JS or just hide */
.nav-links { display: none; gap: 2px; }
@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-link {
  font-family: var(--font-c); font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--smoke); padding: 6px 10px; transition: color .18s;
}
@media (min-width: 1024px) { .nav-link { padding: 7px 14px; } }
.nav-link:hover  { color: var(--white); }
.nav-link.active { color: var(--red); }

.nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
@media (min-width: 480px) { .nav-right { gap: 8px; } }
@media (min-width: 768px) { .nav-right { gap: 10px; } }

.nav-signin, .nav-signout {
  font-family: var(--font-c); font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  background: transparent; color: var(--smoke);
  padding: 6px 10px; transition: color .18s;
}
.nav-signin:hover  { color: var(--white); }
.nav-signout:hover { color: var(--red); }

.cart-nav-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-c); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  background: transparent;
  color: #B8892A;
  padding: 6px 14px;
  border: 1px solid rgba(184,137,42,.45);
  transition: background .18s, border-color .18s;
  position: relative;
}
@media (min-width: 480px) { .cart-nav-btn { padding: 7px 16px; gap: 9px; } }
@media (min-width: 768px) { .cart-nav-btn { padding: 7px 18px; font-size: .72rem; } }
.cart-nav-btn:hover {
  background: rgba(184,137,42,.08);
  border-color: #B8892A;
}

.cart-badge {
  background: #B8892A; color: #EEF4FF;
  font-size: .58rem; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
@media (min-width: 480px) { .cart-badge { width: 17px; height: 17px; } }

/* ── NAV ICONS — hidden on desktop, shown on mobile ─── */
.nav-icon  { display: none; }
.nav-label { /* label always visible on desktop */ }

/* ── MOBILE NAV — full-width tab bar at top ─────────── */
@media (max-width: 767px) {
  nav { height: 56px; }

  .nav-inner {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0 !important;
    height: 56px;
    /* display:contents on children lets them participate directly in this flex */
  }

  /* Hide logo on mobile — tabs fill the full width */
  .nav-brand   { display: none !important; }

  /* Make nav-links and nav-right transparent containers */
  .nav-links { display: contents !important; }
  .nav-right  { display: contents !important; }

  /* Hide sign out — accessed via dashboard */
  .nav-signout { display: none !important; }

  /* Each tab — equal width, stacked icon + label */
  .nav-link, .cart-nav-btn {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 4px !important;
    height: 56px;
    color: var(--smoke) !important;
    background: transparent !important;
    clip-path: none !important;
    border-right: 1px solid var(--border);
    position: relative;
    letter-spacing: .08em !important;
    font-size: .5rem !important;
    transition: color .18s;
  }
  .nav-link:last-child, .cart-nav-btn { border-right: none; }
  .nav-link.active  { color: var(--red) !important; background: rgba(184,137,42,.08) !important; }
  .nav-link:hover   { color: var(--light) !important; }
  .cart-nav-btn:hover { color: var(--light) !important; }

  /* Show icon on mobile */
  .nav-icon {
    display: block !important;
    font-size: 1.1rem;
    line-height: 1;
  }

  /* Cart badge — repositioned for tab layout */
  .cart-badge {
    position: absolute !important;
    top: 6px !important; right: calc(50% - 18px) !important;
    width: 14px !important; height: 14px !important;
    font-size: .46rem !important;
  }

  /* Remove bottom body padding (no bottom bar) */
  body { padding-bottom: 0 !important; }
}

/* ── MOBILE SIGN OUT TAB ─────────────────────────────── */
/* Hidden on desktop — appears as 5th tab on mobile only */
.nav-signout-tab { display: none; }

@media (max-width: 767px) {
  .nav-signout-tab {
    flex: 0.75 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 4px !important;
    height: 56px;
    color: #555 !important;
    background: transparent !important;
    border: none !important;
    border-left: 1px solid var(--border) !important;
    cursor: pointer;
    font-size: .5rem !important;
    font-family: var(--font-c) !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    transition: color .18s, background .18s;
  }
  .nav-signout-tab:hover,
  .nav-signout-tab:active { color: var(--red) !important; background: rgba(184,137,42,.09) !important; }
  .nav-signout-tab .nav-icon { font-size: 1rem !important; }
}

/* Kill any bottom-nav remnants */
.bottom-nav, .bottom-tab, .bottom-tab-icon,
.bottom-tab-label, .bottom-tab-badge { display: none !important; }


.research-banner {
  background: #F6F6F6;
  border-bottom: 1px solid #E0E0E0;
  padding: 7px 16px;
  text-align: center;
}
@media (min-width: 768px) { .research-banner { padding: 9px 32px; } }
.research-banner p {
  font-family: var(--font-c); font-size: .62rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--red);
  display: inline;
}
.research-banner p span {
  font-family: var(--font-b); font-size: .62rem; font-weight: 400;
  letter-spacing: .04em; text-transform: none; color: var(--smoke); margin-left: 6px;
}
@media (min-width: 480px) {
  .research-banner p, .research-banner p span { font-size: .68rem; }
  .research-banner p span { margin-left: 8px; }
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0; background: #F6F6F6; margin-top: auto;
}
@media (min-width: 768px) { footer { padding: 36px 0; } }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
@media (min-width: 480px)  { .footer-inner { padding: 0 20px; } }
@media (min-width: 768px)  { .footer-inner { padding: 0 28px; gap: 12px; } }
@media (min-width: 1024px) { .footer-inner { padding: 0 32px; } }
.footer-brand { font-family: var(--font-d); font-size: 1.2rem; letter-spacing: .08em; color: var(--white); }
@media (min-width: 768px) { .footer-brand { font-size: 1.3rem; } }
.footer-brand span { color: var(--red); }
.footer-copy {
  font-family: var(--font-c); font-size: .6rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--smoke);
}
@media (min-width: 480px) { .footer-copy { font-size: .65rem; letter-spacing: .16em; } }

/* ── CHECKOUT MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  z-index: 500; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  padding: 0;
}
/* On tablet+ center vertically */
@media (min-width: 480px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: #F6F6F6; border: 1px solid var(--border);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(40px); transition: transform .28s;
  display: flex; flex-direction: column;
  border-radius: 0;
}
@media (min-width: 480px) {
  .modal { max-width: 580px; transform: translateY(20px); border-radius: 0; }
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--border); }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #F6F6F6; z-index: 1;
}
@media (min-width: 480px) { .modal-head { padding: 22px 28px; } }
.modal-title { font-family: var(--font-d); font-size: 1.5rem; letter-spacing: .06em; color: var(--white); }
@media (min-width: 480px) { .modal-title { font-size: 1.8rem; } }
.modal-close {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: var(--smoke); font-size: 1.4rem; line-height: 1; transition: color .18s;
  border: 1px solid var(--border); flex-shrink: 0;
}
.modal-close:hover { color: var(--white); border-color: var(--ash); }

.modal-body { padding: 16px 20px; }
@media (min-width: 480px) { .modal-body { padding: 28px; } }
.modal-section { margin-bottom: 24px; }
@media (min-width: 480px) { .modal-section { margin-bottom: 28px; } }
.modal-section-title {
  font-family: var(--font-c); font-size: .65rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--red);
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
@media (min-width: 480px) { .modal-section-title { font-size: .68rem; margin-bottom: 16px; padding-bottom: 10px; letter-spacing: .22em; } }

/* Form rows — stack on mobile, grid on tablet+ */
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 480px) { .form-row { grid-template-columns: 1fr 1fr; gap: 14px; } }

.form-field { margin-bottom: 12px; }
@media (min-width: 480px) { .form-field { margin-bottom: 14px; } }
.form-field label {
  display: block; font-family: var(--font-c); font-size: .64rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ash); margin-bottom: 6px;
}
.form-field input, .form-field select {
  width: 100%; padding: 12px 14px;
  background: #FFFFFF; color: var(--light);
  border: 1px solid var(--border); font-size: .9rem;
  outline: none; transition: border-color .18s;
  /* Larger touch targets on mobile */
  min-height: 44px;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184,137,42,.12);
}
.form-field input::placeholder { color: #3a3a3a; }
.form-field select { color: var(--light); appearance: none; cursor: pointer; }
.form-field select option { background: #FFFFFF; }

.modal-order-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .83rem;
}
.modal-order-row:last-of-type { border-bottom: none; }
.modal-order-name { color: var(--light); }
.modal-order-qty  { color: var(--smoke); font-size: .76rem; margin-left: 5px; }
.modal-order-price { font-family: var(--font-d); font-size: 1rem; color: var(--white); }

.modal-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 0; margin-top: 4px;
}
.modal-total-label {
  font-family: var(--font-c); font-size: .68rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--smoke);
}
.modal-total-val { font-family: var(--font-d); font-size: 1.6rem; color: var(--white); }
@media (min-width: 480px) { .modal-total-val { font-size: 1.8rem; } }

.modal-submit {
  width: 100%; padding: 15px;
  font-family: var(--font-c); font-size: .82rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  background: var(--red); color: var(--white);
  clip-path: polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,8px 100%,0 calc(100% - 8px));
  transition: background .2s; margin-top: 16px;
  min-height: 48px;
}
.modal-submit:hover:not(:disabled) { background: var(--red-hot); }
.modal-submit:disabled { background: var(--border); color: var(--smoke); cursor: not-allowed; clip-path: none; }

.modal-disclaimer {
  font-size: .64rem; color: var(--smoke); text-align: center;
  margin-top: 12px; line-height: 1.6; font-style: italic;
}

/* ── SUCCESS STATE ───────────────────────────────────── */
.order-success { text-align: center; padding: 40px 20px; }
@media (min-width: 480px) { .order-success { padding: 48px 28px; } }
.order-success-icon {
  width: 60px; height: 60px; background: rgba(184,137,42,.15);
  border: 1px solid rgba(184,137,42,.3); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 18px;
}
.order-success h2 { font-family: var(--font-d); font-size: 1.8rem; letter-spacing: .06em; color: var(--white); margin-bottom: 10px; }
.order-success p  { font-size: .85rem; color: var(--smoke); line-height: 1.7; }

/* ── FIELD ERRORS ────────────────────────────────────── */
.field-err {
  font-size: .66rem; color: #D4A843;
  min-height: 16px; margin-top: 4px;
  font-family: var(--font-c); letter-spacing: .06em;
}
.req-note {
  font-family: var(--font-b); font-size: .62rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--smoke); margin-left: 6px;
}

/* ── PAYMENT BUTTONS ─────────────────────────────────── */
.pay-method-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; width: 100%; min-height: 48px;
  border: 1px solid var(--border); background: #FFFFFF;
  color: var(--smoke); font-family: var(--font-c); font-size: .72rem;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; transition: all .18s;
}
.pay-method-btn:hover  { border-color: var(--ash); color: var(--light); }
.pay-method-btn.active { border-color: var(--red); color: var(--white); background: rgba(184,137,42,.1); }

/* ── SKELETON LOADING ────────────────────────────────── */
.skeleton-card { background: #FFFFFF; border: 1px solid var(--border); }
.skeleton-thumb { height: 180px; background: #222; }
@media (min-width: 480px) { .skeleton-thumb { height: 200px; } }
.skeleton-info  { padding: 14px 16px 16px; }
@media (min-width: 480px) { .skeleton-info { padding: 18px 20px 20px; } }
.skeleton-line  { border-radius: 2px; background: #222; }
.skeleton-pulse { animation: skeletonPulse 1.4s ease-in-out infinite; }

/* ── MOBILE CHECKOUT FIXES ────────────────────────────── */
@media (max-width: 480px) {
  /* Stripe card element full width */
  #stripe-card-element { padding: 11px 12px; }

  /* PayPal button container full width */
  #paypal-button-container { width: 100%; }

  /* Payment grid single column on mobile */
  .pay-method-btns,
  [style*="grid-template-columns:1fr 1fr"] { 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 10px !important; 
  }

  /* Modal submit button full width */
  .modal-submit { font-size: .75rem; padding: 14px; }

  /* Form inputs readable size */
  .form-field input, .form-field select { font-size: 16px; } /* prevents iOS zoom */
}

/* ══════════════════════════════════════════════════════════
   PAGE-LEVEL MOBILE FIXES
══════════════════════════════════════════════════════════ */

/* ── SHOP PAGE ───────────────────────────────────────── */
@media (max-width: 767px) {
  /* Reduce oversized header padding */
  .shop-header { padding: 28px 0 24px !important; }

  /* Scrollable filter bar */
  .filters-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0 !important;
    gap: 6px !important;
    scrollbar-width: none;
  }
  .filters-bar::-webkit-scrollbar { display: none; }
  .filters-label { display: none !important; }
  .filter-btn { flex-shrink: 0; padding: 8px 14px !important; font-size: .68rem !important; }

  /* 2-col product grid */
  .products-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .products-section { padding: 20px 0 60px !important; }

  /* Product card touches */
  .product-thumb { height: 160px !important; }
  .product-info  { padding: 12px 14px 14px !important; }
  .product-name  { font-size: .88rem !important; }
  .product-desc  { display: none !important; } /* hide on mobile to keep cards tight */
  .product-price { font-size: 1.2rem !important; }
  .add-btn { width: 30px !important; height: 30px !important; font-size: 1.1rem !important; }

  /* Add-to-cart flash — keep above bottom nav space */
  .add-flash { bottom: 16px !important; font-size: .7rem !important; padding: 10px 18px !important; }
}

/* ── CART PAGE ───────────────────────────────────────── */
@media (max-width: 767px) {
  .cart-header { padding: 28px 0 20px !important; }
  .cart-body   { padding: 24px 0 60px !important; }
  .cart-layout { grid-template-columns: 1fr !important; gap: 0 !important; }

  /* Summary goes on top on mobile — more intuitive */
  .cart-items-col { order: 2; }
  .summary-panel  { order: 1; position: static !important; margin-bottom: 20px; padding: 20px !important; }

  .cart-item { grid-template-columns: 52px 1fr auto !important; gap: 10px !important; padding: 14px 0 !important; }
  .cart-item-thumb { width: 52px !important; height: 52px !important; }
  .cart-item-name  { font-size: .78rem !important; }
  .cart-item-price { font-size: 1rem !important; }
  .qty-btn { width: 32px !important; height: 32px !important; } /* bigger touch target */
}

/* ── ORDERS PAGE ─────────────────────────────────────── */
@media (max-width: 767px) {
  .orders-header { padding: 28px 0 20px !important; }
  .orders-body   { padding: 24px 0 60px !important; }
  .orders-summary { gap: 20px !important; padding: 16px 0 20px !important; }
  .summary-stat-val { font-size: 1.6rem !important; }

  .order-row { gap: 10px !important; padding: 14px 0 !important; }
  .order-thumb { width: 44px !important; height: 44px !important; flex-shrink: 0; }
  .order-name { font-size: .78rem !important; }
  .order-total { font-size: 1rem !important; }
  .order-arrow { display: none; }
}

/* ── PRODUCT PAGE ────────────────────────────────────── */
@media (max-width: 767px) {
  /* Product layout stacks */
  .product-layout,
  [class*="product-layout"] { 
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  /* Visual panel (image) comes first */
  .product-visual { order: 1; position: static !important; }
  .product-info-col { order: 2; }

  /* Lab report section stacks */
  .lab-report-section { flex-direction: column-reverse !important; gap: 16px !important; }
  .lab-report-doc { width: 200px !important; }

  /* Reviews */
  .reviews-grid { grid-template-columns: 1fr !important; }
}

/* ── DASHBOARD PAGE ──────────────────────────────────── */
@media (max-width: 767px) {
  .dashboard-header { padding: 28px 0 20px !important; }
  .dashboard-grid,
  .dash-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
}

/* ── GLOBAL MOBILE TWEAKS ────────────────────────────── */
@media (max-width: 767px) {
  /* Prevent iOS zoom on inputs */
  input, select, textarea { font-size: 16px !important; }

  /* Page headers — universal size reduction */
  [class*="-title"] { word-break: break-word; }

  /* Clamp all Bebas display text so it doesn't overflow */
  .shop-title,
  .cart-page-title,
  .orders-title,
  .dashboard-title { font-size: clamp(2rem, 8vw, 3.5rem) !important; }
}

/* ── Blue & Gold design polish ─────────────────────────── */
nav {
  background: #FFFFFF;
  backdrop-filter: blur(12px);
}


/* Mobile nav tab gold */
@media (max-width: 767px) {
  nav { background: #FFFFFF !important; }
  .nav-link.active {
    color: var(--red) !important;
    background: rgba(184,137,42,.08) !important;
  }
  .nav-signout-tab:hover,
  .nav-signout-tab:active { color: var(--red) !important; background: rgba(184,137,42,.07) !important; }
  .cart-badge { top: 6px !important; background: #B8892A !important; color: #EEF4FF !important; }
}
