/* ============================================================
   Additions on top of style.css / shop.css / home.css / admin.css
   for the server-rendered PHP build (alerts, banner, tracking,
   admin sidebar layout, order tables, gateway toggle cards).
   ============================================================ */

.promo-banner-bar{
  background:var(--amber);
  color:var(--charcoal);
  text-align:center;
  font-weight:600;
  font-size:14px;
  padding:10px 0;
}
.promo-banner-bar a{ color:var(--charcoal); text-decoration:underline; }

/* Homepage banner carousel — fixed canvas: every slide displays at this
   consistent aspect ratio via object-fit:cover, so admin can upload any
   size image without it ever breaking the layout. Slides rotate
   automatically (see main.js); dots/arrows only render for 2+ slides. */
.promo-carousel{
  position:relative;
  width:100%;
  aspect-ratio: 21 / 6;
  border-radius:16px;
  overflow:hidden;
  background:var(--cream-dim);
}
.promo-carousel-track{
  display:flex;
  width:100%;
  height:100%;
  transition:transform .5s ease;
}
.promo-carousel-slide{ flex:0 0 100%; width:100%; height:100%; }
.promo-carousel-slide a{ display:block; width:100%; height:100%; }
.promo-carousel-slide img{ width:100%; height:100%; object-fit:cover; display:block; }
.promo-carousel-dots{
  position:absolute;
  bottom:16px; left:50%;
  transform:translateX(-50%);
  display:flex; gap:8px;
  z-index:3;
}
.promo-carousel-dot{
  width:9px; height:9px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,.55);
  cursor:pointer;
  padding:0;
}
.promo-carousel-dot.active{ background:#fff; width:22px; border-radius:5px; }
.promo-carousel-arrow{
  position:absolute;
  top:50%; transform:translateY(-50%);
  width:38px; height:38px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,.85);
  color:var(--charcoal);
  font-size:14px;
  cursor:pointer;
  z-index:3;
  display:flex; align-items:center; justify-content:center;
}
.promo-carousel-arrow:hover{ background:#fff; }
.promo-carousel-arrow.prev{ left:14px; }
.promo-carousel-arrow.next{ right:14px; }
@media (max-width: 700px){
  .promo-carousel{ aspect-ratio: 4 / 3; border-radius:12px; }
  .promo-carousel-arrow{ width:32px; height:32px; font-size:12px; }
}

.alert{
  margin:18px 0;
  padding:14px 18px;
  border-radius:10px;
  font-size:14.5px;
  font-weight:600;
}
.alert-success{ background:rgba(20,164,77,.14); color:var(--green-shade); }
.alert-error{ background:rgba(198,84,29,.14); color:var(--rust); }
.alert-info{ background:rgba(11,110,54,.08); color:var(--charcoal); }

/* ---------- breadcrumbs / small page furniture ---------- */
.breadcrumbs{ font-size:13px; color:var(--charcoal-60); margin:18px 0; }
.breadcrumbs a{ color:var(--charcoal-60); text-decoration:none; }
.breadcrumbs a:hover{ color:var(--green-shade); }

/* ---------- order tracking timeline ---------- */
.tracking-timeline{ list-style:none; padding:0; margin:30px 0; }
.tracking-timeline li{
  position:relative;
  padding:0 0 30px 34px;
  border-left:2px solid var(--cream-dim);
}
.tracking-timeline li:last-child{ border-color:transparent; padding-bottom:0; }
.tracking-timeline li::before{
  content:"";
  position:absolute; left:-9px; top:0;
  width:16px; height:16px; border-radius:50%;
  background:var(--cream-dim);
  border:2px solid var(--white);
}
.tracking-timeline li.done::before{ background:var(--green-bright); }
.tracking-timeline .t-status{ font-weight:700; text-transform:capitalize; }
.tracking-timeline .t-note{ color:var(--charcoal-60); font-size:13.5px; margin-top:2px; }
.tracking-timeline .t-time{ color:var(--charcoal-60); font-size:12px; margin-top:2px; }

/* ---------- pay method cards on checkout ---------- */
.pay-methods{ display:grid; gap:12px; }
.pay-method{
  border:2px solid var(--cream-dim);
  border-radius:12px;
  padding:14px 16px;
  display:flex; align-items:center; gap:12px;
  cursor:pointer;
}
.pay-method input{ margin:0; }
.pay-method.selected{ border-color:var(--green-bright); background:rgba(20,164,77,.06); }
.pay-method .pm-name{ font-weight:700; }
.pay-method .pm-sub{ font-size:12.5px; color:var(--charcoal-60); }

/* ---------- ADMIN: sidebar shell (multi-page, not tabbed SPA) --- */
.admin-shell{ display:flex; min-height:calc(100vh - 68px); }
.admin-sidebar{
  width:230px; flex:0 0 230px;
  background:var(--charcoal);
  color:rgba(255,255,255,.85);
  padding:20px 0;
}
.admin-sidebar a{
  display:block;
  padding:11px 24px;
  color:rgba(255,255,255,.7);
  text-decoration:none;
  font-size:14px;
  font-weight:600;
  border-left:3px solid transparent;
}
.admin-sidebar a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.admin-sidebar a.active{ border-left-color:var(--amber); color:#fff; background:rgba(255,255,255,.08); }
.admin-sidebar .side-group{ padding:16px 24px 6px; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:rgba(255,255,255,.35); }
.admin-main{ flex:1; padding:28px; max-width:1180px; }
.admin-main h1{ font-size:24px; font-weight:800; margin-bottom:20px; }

.gateway-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }
.gateway-card{ background:var(--white); border-radius:14px; padding:20px; box-shadow:var(--shadow-sm); }
.gateway-card .gc-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.gateway-card h4{ font-size:16px; }
.switch{ position:relative; display:inline-block; width:44px; height:24px; }
.switch input{ opacity:0; width:0; height:0; }
.switch .slider{ position:absolute; inset:0; background:#ccc; border-radius:24px; transition:.2s; cursor:pointer; }
.switch .slider::before{ content:""; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + .slider{ background:var(--green-bright); }
.switch input:checked + .slider::before{ transform:translateX(20px); }

.status-badge{ display:inline-block; padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:700; text-transform:capitalize; }
.status-badge.pending{ background:rgba(232,169,59,.2); color:var(--amber-deep); }
.status-badge.processing{ background:rgba(11,110,54,.12); color:var(--green-deep); }
.status-badge.dispatched{ background:rgba(70,130,180,.15); color:#3a6ea5; }
.status-badge.delivered{ background:rgba(20,164,77,.14); color:var(--green-shade); }
.status-badge.cancelled, .status-badge.failed{ background:rgba(198,84,29,.14); color:var(--rust); }
.status-badge.paid{ background:rgba(20,164,77,.14); color:var(--green-shade); }
.status-badge.refunded{ background:rgba(120,120,120,.15); color:#555; }

.qty-stepper{ display:inline-flex; align-items:center; border:1px solid var(--cream-dim); border-radius:8px; overflow:hidden; }
.qty-stepper button{ background:var(--cream); border:none; width:32px; height:32px; cursor:pointer; font-size:16px; }
.qty-stepper input{ width:40px; text-align:center; border:none; }

/* ---- Mobile admin/seller sidebar: collapsible off-canvas panel,
   not a horizontal-scrolling strip. Toggled by #sidebar-toggle. ---- */
.sidebar-overlay{
  display:none;
  position:fixed; inset:0;
  background:rgba(0,0,0,.5);
  z-index:998;
}
.sidebar-overlay.open{ display:block; }
.sidebar-toggle{
  display:none;
  background:rgba(255,255,255,.12);
  border:none;
  color:#fff;
  width:38px; height:38px;
  border-radius:8px;
  font-size:16px;
  cursor:pointer;
}

@media (max-width: 860px){
  .admin-shell{ flex-direction:column; }
  .sidebar-toggle{ display:inline-flex; align-items:center; justify-content:center; }
  .admin-sidebar{
    position:fixed;
    top:0; left:0;
    width:270px; max-width:82vw;
    height:100vh;
    overflow-y:auto;
    z-index:999;
    transform:translateX(-100%);
    transition:transform .25s ease;
    box-shadow:0 0 30px rgba(0,0,0,.25);
  }
  .admin-sidebar.open{ transform:translateX(0); }
}


/* ============================================================
   RESPONSIVE / OVERFLOW HARDENING
   Added for the full mobile-responsiveness pass — every
   fixed-ratio two/three column layout in the site now uses one
   of these classes instead of an inline grid-template-columns,
   so it can actually collapse to one column on small screens.
   ============================================================ */

html, body{ overflow-x:hidden; max-width:100%; }
.site-header .container{ flex-wrap:wrap; }
*, *::before, *::after{ min-width:0; } /* prevents grid/flex children from forcing overflow */
img, svg, video, canvas{ max-width:100%; height:auto; }
table{ max-width:100%; }
pre, code{ white-space:pre-wrap; word-break:break-word; }
.hint, .breadcrumbs, td, .admin-topbar .tag{ overflow-wrap:anywhere; }

.field-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.two-col-card{ display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.order-view-grid{ display:grid; grid-template-columns:1.4fr 1fr; gap:20px; align-items:start; }
.checkout-grid{ display:grid; grid-template-columns:1.4fr 1fr; gap:36px; align-items:start; }
.cart-grid{ display:grid; grid-template-columns:2fr 1fr; gap:36px; align-items:start; }
.product-detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:start; }

@media (max-width: 900px){
  .order-view-grid, .checkout-grid, .cart-grid, .product-detail-grid, .two-col-card{
    grid-template-columns:1fr;
    gap:20px;
  }
}
@media (max-width: 700px){
  .field-grid-2{ grid-template-columns:1fr; gap:0; }
}

/* Any admin/data table gets a horizontal scroll rail on narrow
   screens instead of forcing the whole page to scroll sideways. */
.table-scroll{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-scroll .admin-table{ min-width:560px; }

/* Header: shrink to fit small phones so icons/logo never overflow */
@media (max-width: 520px){
  .site-header .container{ padding-top:12px; padding-bottom:12px; gap:8px; }
  .logo{ font-size:0; gap:0; }
  .logo .mark{ width:32px; height:32px; font-size:14px; }
  .header-actions{ gap:6px; }
  .icon-btn{ width:34px; height:34px; font-size:14px; }
  .nav-toggle{ font-size:20px; padding:4px; }
  .form-panel{ padding:22px 18px; }
  .page-hero h1{ font-size:26px; }
  .section-head h2{ font-size:24px; }
  .admin-main{ padding:16px; }
}

@media (max-width: 380px){
  .header-actions{ gap:4px; }
  .icon-btn{ width:30px; height:30px; font-size:13px; }
}

/* Buttons/labels never force a row wider than its container */
.btn{ max-width:100%; white-space:normal; text-align:center; }
.pay-methods label{ word-break:break-word; }
.pill, .status-badge{ white-space:normal; }

/* Star rating + product card action row */
.star-rating{ color:var(--amber); font-size:13px; letter-spacing:1px; white-space:nowrap; }
.vendor-tag{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:var(--charcoal-60); margin-left:8px; text-decoration:none; }
a.vendor-tag:hover{ color:var(--green-shade); text-decoration:underline; }
.star-rating .count{ color:var(--charcoal-60); font-weight:400; margin-left:4px; }
.product-card .actions-row{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.product-card .actions-row .btn{ flex:1; min-width:0; padding:10px 12px; font-size:12.5px; }

/* Cart line item: wraps to two rows on small phones instead of
   squeezing image + name + stepper + price + delete into one line. */
@media (max-width: 480px){
  .cart-line-item{ flex-wrap:wrap; }
  .cart-line-item > *{ flex:none; }
  .cart-line-item > div:first-of-type{ flex:1 1 100%; order:1; }
  .cart-line-item img{ order:0; }
}

