/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --brand: #2e6bd6;
  --brand-dark: #1e4fa6;
  --brand-light: #eaf1fd;
  --ink: #14181f;
  --ink-muted: #6b7488;
  --ink-faint: #9aa2b1;
  --surface: #ffffff;
  --bg: var(--page-bg, #f6f7fb);
  --border: #e8eaf0;
  --danger: #d6284a;
  --success: #1a7a2e;
  --success-bg: #e3f9e5;
  --warning: #a05a00;
  --warning-bg: #fff4e5;
  --info: #1e40af;
  --info-bg: #e0f0ff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(20,24,35,.06);
  --shadow-md: 0 4px 16px rgba(20,24,35,.08);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.12);
}

/* ============ Reset & base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  /* Without this, one wide un-contained element anywhere on the page (a
     horizontally-scrolling nav, a wide table) lets the WHOLE document grow
     past the viewport, which then throws off every percentage-based width
     calculation elsewhere - this is what was causing buttons/forms to
     render at desktop width even inside an otherwise-correct mobile layout. */
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--page-bg, #f6f7fb);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: color .12s ease; }
img { max-width: 100%; display: block; }
h1, h2, h3 { letter-spacing: -.01em; }

/* ============ Top bar ============ */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
}
.menu-toggle {
  display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-logo { height: 40px; width: auto; }
.brand-name { font-weight: 700; font-size: 18px; color: var(--ink); }
.topbar-actions { display: flex; align-items: center; }
.cart-link { position: relative; font-size: 22px; }
.cart-count {
  position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 5px; border-radius: 10px; font-weight: 700;
}

/* ============ Layout: sidebar + main ============ */
.layout { display: flex; max-width: 1280px; margin: 0 auto; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--surface); padding: 20px 0;
  border-right: 1px solid var(--border); min-height: calc(100vh - 62px);
}
.menu { list-style: none; }
.menu-item > a {
  display: block; padding: 10px 20px; color: var(--ink); font-weight: 600; font-size: 14px;
  transition: background .12s ease;
}
.menu-item > a:hover { background: var(--brand-light); color: var(--brand-dark); }
.submenu { list-style: none; padding-left: 12px; }
.submenu a { display: block; padding: 8px 20px; color: var(--ink-muted); font-size: 13.5px; }
.submenu a:hover { color: var(--brand); }
.sidebar-overlay { display: none; }

.main-content { flex: 1; padding: 20px; min-width: 0; }

/* ============ Section titles ============ */
.section-title { font-size: 21px; font-weight: 700; margin-bottom: 16px; }

/* ============ Flash sale ============ */
.flash-sale { margin-bottom: 32px; }
.flash-scroll {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory;
}
.flash-card {
  flex: 0 0 240px; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); scroll-snap-align: start;
  transition: box-shadow .15s ease, transform .15s ease;
}
.flash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.flash-card-img { position: relative; aspect-ratio: 1/1; background: #f0f1f5; }
.flash-card-img img { width: 100%; height: 100%; object-fit: cover; }
.flash-card-body { padding: 12px; }
.flash-card-body h3 { font-size: 14px; margin-bottom: 4px; font-weight: 600; }
.short-desc { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 8px; min-height: 32px; }

/* ============ Pricing ============ */
.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.price-row.large { font-size: 22px; }
.promo-upcoming-tag {
  display: inline-block; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; margin-bottom: 6px;
}
.price-old { text-decoration: line-through; color: var(--ink-faint); font-size: 13px; }
.price-now { font-weight: 700; color: var(--danger); font-size: 16px; }
.stock-info { font-size: 12px; color: var(--ink-muted); margin-bottom: 10px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: var(--radius-pill); font-weight: 650;
  font-size: 13.5px; border: 1.5px solid transparent; cursor: pointer; text-align: center;
  letter-spacing: .01em; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .18s ease, color .15s ease;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-light), 0 0 0 4.5px var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(20,24,35,.16); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 6px 16px rgba(20,24,35,.2); transform: translateY(-1px); }
.btn-outline { background: var(--surface); color: var(--brand); border-color: var(--border); }
.btn-outline:hover { background: var(--brand-light); border-color: var(--brand); transform: translateY(-1px); }
.btn-outline.danger { color: var(--danger); border-color: var(--danger); }
.btn-outline.danger:hover { background: #fdecee; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { filter: brightness(0.95); }
.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline-block; }

/* ============ Product grid ============ */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px;
}
.product-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card img { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.product-card-img-wrap { position: relative; display: block; }
.img-promo-tag {
  position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(0,0,0,.78), rgba(0,0,0,.35));
  color: #fff; font-size: 11.5px; font-weight: 700; padding: 7px 10px 6px; text-align: center; line-height: 1.3;
}
.product-card-body { padding: 13px; }
.product-card-body h3 { font-size: 14px; margin-bottom: 4px; font-weight: 600; }
.product-card-body h3 a { color: var(--ink); }

/* ============ Product detail ============ */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: var(--surface); padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.main-image-wrap { position: relative; aspect-ratio: 1/1; background: #f0f1f5; border-radius: var(--radius); overflow: hidden; }
.main-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.thumb-row { display: flex; gap: 8px; margin-top: 10px; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; transition: border-color .12s ease; }
.thumb.active { border-color: var(--brand); }
.product-info h1 { font-size: 25px; margin-bottom: 8px; font-weight: 700; }
.qty-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.qty-row input { width: 76px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); transition: border-color .12s ease, box-shadow .12s ease; }
.qty-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.purchase-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.out-of-stock-msg { color: var(--danger); font-weight: 600; margin: 14px 0; }
.details-block { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }

/* ============ Cart ============ */
.cart-page, .checkout-page, .order-success { background: var(--surface); padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.cart-table th { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.cart-product-cell { display: flex; align-items: center; gap: 10px; }
.cart-product-cell img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-table-wrap { overflow-x: auto; }
.cart-summary { margin-top: 20px; text-align: right; }
.qty-form input[type=number] { width: 60px; padding: 5px; }

/* ============ Checkout ============ */
.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.checkout-form label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.checkout-form input, .checkout-form textarea, .checkout-form select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 400; transition: border-color .12s ease, box-shadow .12s ease;
}
.checkout-form input:focus, .checkout-form textarea:focus, .checkout-form select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.req { color: var(--danger); }
.hint { font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.payment-options { display: flex; gap: 16px; margin: 12px 0 18px; }
.pay-option { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.bank-accounts-box { background: var(--bg); padding: 14px; border-radius: var(--radius); margin-bottom: 18px; }
.bank-account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; }
.order-summary { background: var(--bg); border-radius: var(--radius); padding: 18px; align-self: start; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-line.total { font-weight: 700; font-size: 17px; }

/* ============ Order success ============ */
.order-no { color: var(--ink-muted); margin-bottom: 16px; }
.order-summary-box { background: var(--bg); padding: 16px; border-radius: var(--radius); margin-bottom: 20px; }
.notice-box { background: #fff8e6; border: 1px solid #ffe4a3; padding: 16px; border-radius: var(--radius); margin-bottom: 20px; }
.muted { color: var(--ink-muted); font-size: 13px; }

/* ============ Footer ============ */
.site-footer {
  background: var(--footer-bg, #12151f); color: var(--footer-ink, #b7bfd4);
  padding: 36px 20px 20px; margin-top: 46px; border-top: 1px solid var(--border);
}
.footer-grid { display: flex; gap: 40px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; }
.footer-grid h4 { color: #fff; margin-bottom: 10px; font-weight: 700; }
.footer-grid a { color: #8bb4f5; }
.footer-grid a:hover { color: #fff; }
.footer-copy {
  text-align: center; font-size: 12px; margin-top: 26px; padding-top: 18px;
  color: var(--ink-faint); border-top: 1px solid var(--border);
}

/* ============ WhatsApp floating button ============ */
.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px; background: #25d366; width: 56px; height: 56px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); z-index: 60; transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }

/* ============ Responsive: mobile ============ */
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; top: 0; left: -280px; height: 100vh; width: 260px; z-index: 100;
    transition: left .25s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(10,14,25,.45); z-index: 90;
  }
  .sidebar-overlay.show { display: block; }
  .brand-name { font-size: 15px; }
  .product-detail { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .flash-card { flex: 0 0 200px; }
  /* Grid/flex items default to min-width:auto, which lets wide content
     (long text, a table, an unwrapping row) force these single-column
     layouts wider than the screen even though the column itself is 1fr -
     without this, some content silently overflows or gets clipped. */
  .product-detail > *, .checkout-grid > *, .form-row > * { min-width: 0; }
}

/* ============================================================
   Store header (utility bar / main header / categories)
   ============================================================ */
.utility-bar {
  background: var(--topbar-bg, #12151f); color: var(--topbar-ink, #b7bfd4);
  font-size: 12.5px; border-bottom: 1px solid var(--border);
}
.utility-inner {
  max-width: 1280px; margin: 0 auto; padding: 7px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.utility-left, .utility-right { display: flex; gap: 16px; align-items: center; }
.utility-right a { color: var(--topbar-ink, #b7bfd4); }
.utility-right a:hover { color: #fff; }

.main-header { background: var(--surface); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50; }
.main-header-inner {
  max-width: 1280px; margin: 0 auto; padding: 15px 16px;
  display: flex; align-items: center; gap: 20px;
}
.search-bar { flex: 1; display: flex; max-width: 520px; }
.search-bar input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--brand); border-right: none;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill); font-size: 14px; outline: none; padding-left: 18px;
}
.search-bar button {
  background: var(--brand); color: #fff; border: none; padding: 0 20px; border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  cursor: pointer; transition: background .12s ease;
}
.search-bar button:hover { background: var(--brand-dark); }
.header-actions { margin-left: auto; }
.cart-label { margin-left: 4px; font-size: 13px; font-weight: 600; }

.categories-bar { background: var(--brand); color: #fff; }
.categories-bar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 20px;
}
.categories-btn {
  background: var(--brand-dark); color: #fff; border: none; padding: 12px 18px; font-weight: 700;
  font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .12s ease;
}
.categories-btn:hover { background: #163d80; }
.top-menu { display: flex; gap: 4px; }
.top-menu-item { position: relative; }
.top-menu-item > a { display: block; padding: 12px 14px; color: #fff; font-size: 13.5px; font-weight: 600; }
.top-menu-item:hover > a { background: rgba(255,255,255,.12); }
.top-menu-dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: var(--surface); min-width: 200px;
  box-shadow: var(--shadow-lg); border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 60; padding: 6px 0;
}
.top-menu-item:hover .top-menu-dropdown { display: block; }
.top-menu-dropdown a { display: block; padding: 8px 16px; color: var(--ink); font-size: 13.5px; }
.top-menu-dropdown a:hover { background: var(--brand-light); color: var(--brand-dark); }

.sidebar-title { padding: 14px 20px; font-weight: 700; background: var(--brand); color: #fff; font-size: 14px; }

/* ============================================================
   Category grid sections
   ============================================================ */
.category-grids { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 28px 0; }
.category-block { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.category-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.category-block-head h3 { font-size: 14.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.category-block-head a { font-size: 12px; color: var(--brand); font-weight: 600; }
.category-block-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.category-block-grid .product-card { box-shadow: none; border: 1px solid var(--border); }
.category-block-grid .product-card-body { padding: 8px; }
.category-block-grid .product-card-body h3 { font-size: 12px; }

.hide-mobile { display: inline; }

@media (max-width: 860px) {
  .main-header-inner { flex-wrap: wrap; }
  .search-bar { order: 3; width: 100%; max-width: none; margin-top: 8px; }
  .top-menu { display: none; }
  .hide-mobile { display: none; }
  .category-grids { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .category-grids { grid-template-columns: 1fr; }
}

/* ============================================================
   Tool pages: warranty check + SDK keygen
   ============================================================ */
.tool-page { background: var(--surface); padding: 28px; border-radius: var(--radius-lg); max-width: 720px; border: 1px solid var(--border); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eef1f7; color: var(--ink-muted); }
.status-confirmed, .status-delivered { background: var(--success-bg); color: var(--success); }
.status-shipped { background: var(--info-bg); color: var(--info); }
.status-pending_payment_review, .status-pending_confirmation { background: var(--warning-bg); color: var(--warning); }
.status-declined_no_payment, .status-declined_customer_unreachable, .status-cancelled, .status-delivery_failed { background: #fde2e2; color: var(--danger); }
.tool-page h1 { font-size: 25px; margin-bottom: 8px; font-weight: 700; }
.tool-intro { color: var(--ink-muted); font-size: 14px; margin-bottom: 20px; }
.tool-form label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.tool-form input, .tool-form select, .tool-form textarea,
.main-content input[type="text"], .main-content input[type="email"], .main-content input[type="tel"],
.main-content input[type="password"], .main-content input[type="number"], .main-content input[type="date"],
.main-content input[type="datetime-local"], .main-content input[type="url"],
.main-content select, .main-content textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 400; font-family: inherit; background: var(--surface);
  color: var(--ink); box-sizing: border-box; transition: border-color .12s ease, box-shadow .12s ease;
}
.tool-form input:focus, .tool-form select:focus, .tool-form textarea:focus,
.main-content input:focus, .main-content select:focus, .main-content textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.main-content select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px;
}
.main-content textarea { resize: vertical; min-height: 70px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; border: 1px solid transparent; }
.alert-error { background: #fde2e2; color: #991b3a; border-color: #f5b5b5; }
.alert-info  { background: var(--info-bg); color: #1e3a8a; border-color: #b3d4f5; }

.warranty-result { margin-top: 22px; border-radius: var(--radius); padding: 22px; border: 2px solid; }
.warranty-result.in-warranty { border-color: #28a745; background: #f2fbf5; }
.warranty-result.expired     { border-color: var(--danger); background: #fff5f6; }
.warranty-status { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.warranty-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.warranty-table th, .warranty-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.07); font-size: 14px; }
.warranty-table th { color: var(--ink-muted); font-weight: 600; width: 170px; }

.quota-bar { display: flex; justify-content: space-between; background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13.5px; margin-bottom: 18px; }
.quota-remaining { font-weight: 700; color: var(--brand); }
.keygen-result { margin-top: 22px; background: #0f172a; color: #fff; border-radius: var(--radius); padding: 24px; text-align: center; }
.keygen-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; color: #8bb4f5; margin-bottom: 10px; }
.keygen-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; font-weight: 700;
  letter-spacing: 2px; background: rgba(255,255,255,.08); padding: 14px; border-radius: var(--radius-sm); margin-bottom: 14px; word-break: break-all; }
.keygen-result .muted { color: #aab2c8; margin-top: 10px; }

/* ============================================================
   Minimal theme overrides (Settings -> Storefront Theme)
   ============================================================ */
.theme-minimal .utility-bar { background: #2f4fd8; text-align: center; }
.theme-minimal .utility-inner { justify-content: center; font-size: 12px; }
.theme-minimal .utility-left { display: none; }
.theme-minimal .main-header { background: #0e1a4a; }
.theme-minimal .brand-name { color: #fff; letter-spacing: 2px; text-transform: uppercase; }
.theme-minimal .categories-bar { background: #0e1a4a; }
.theme-minimal .categories-btn { background: transparent; font-weight: 600; }
.theme-minimal .search-bar input { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; }
.theme-minimal .search-bar input::placeholder { color: rgba(255,255,255,.6); }
.theme-minimal .search-bar button { background: rgba(255,255,255,.15); }
.theme-minimal .cart-link, .theme-minimal .cart-label { color: #fff; }
.theme-minimal .hero { grid-template-columns: 1fr; }
.theme-minimal .hero-main { border-radius: 0; padding: 70px 60px; min-height: 380px; }
.theme-minimal .hero-tiles { display: none; }
.theme-minimal .hero-main h1 { font-size: 34px; }
.theme-minimal .btn { border-radius: 999px; }
.theme-minimal .product-card { border: 1px solid #e4e7ee; box-shadow: none; border-radius: 10px; }
.theme-minimal .product-card-body { text-align: left; padding: 14px; }
.theme-minimal .product-card-body .card-actions { display: block; }
.theme-minimal .product-card-body .card-actions .btn { width: 100%; margin-top: 6px; }
.theme-minimal .price-now { color: #0e1a4a; }
.theme-minimal .section-title { text-align: left; color: #0e1a4a; font-size: 22px; }
.theme-minimal .flash-sale-banner { background: #0e1a4a; }
.theme-minimal .flash-sale .flash-scroll { background: #fff; border-color: #e4e7ee; }

/* ============================================================
   HERO SLIDER - single consolidated definition.
   (Earlier versions of this section were rewritten 3 times across past
   rounds, each overriding the last rather than replacing it, which left
   duplicate/conflicting rules for .hero-main, .hero-slides, .hero-nav,
   .hero-dots and others still sitting in the file. Consolidated here into
   one authoritative version - same visual behavior, no leftover rules.)
   ============================================================ */
.hero { display: block; margin-bottom: 30px; }

.hero-main {
  position: relative; overflow: hidden; padding: 0; display: block;
  min-height: var(--hero-h-desktop, 360px);
  border-radius: var(--hero-radius, 16px);
  background: #0b1a3f;
  box-shadow: var(--shadow-lg);
}
.hero-slides {
  position: relative; width: 100%; height: var(--hero-h-desktop, 360px); display: block;
}
.hero-slide {
  position: absolute; inset: 0; width: 100%; min-width: 0; min-height: 0; margin: 0;
  display: none; align-items: center; padding: 0 46px; box-sizing: border-box;
}
.hero-slide.is-active {
  display: flex; opacity: 1; visibility: visible; z-index: 2;
  animation: heroFadeIn .65s ease both;
}
@keyframes heroFadeIn { from { opacity: 0; } to { opacity: 1; } }

.hero-bg {
  position: absolute; inset: 0;
  background-size: var(--hero-bg-size, cover);
  background-position: var(--hero-bg-position, center);
  background-repeat: no-repeat;
  transform: scale(var(--hero-zoom-start, 1.06)); transition: transform 8s ease-out;
}
.hero-slide.is-active .hero-bg { transform: scale(var(--hero-zoom-end, 1.16)); }
.hero-bg--brand { background: linear-gradient(115deg, #0b1a3f 0%, #14306e 55%, #1d3f8f 100%); }
.hero-slide .hero-bg--brand ~ .hero-overlay { background: none; }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--hero-tint, 10,22,56), calc(var(--hero-shade, .85) * 1))    0%,
    rgba(var(--hero-tint, 10,22,56), calc(var(--hero-shade, .85) * .92))  45%,
    rgba(var(--hero-tint, 10,22,56), calc(var(--hero-shade, .85) * .55)) 100%
  );
}
.hero-align-center .hero-content { max-width: 720px; margin: 0 auto; align-items: center; text-align: center; }
.hero-align-center .hero-cta { justify-content: center; }
.hero-align-center .hero-overlay {
  background: linear-gradient(180deg,
    rgba(var(--hero-tint,10,22,56), calc(var(--hero-shade,.85) * .75)) 0%,
    rgba(var(--hero-tint,10,22,56), calc(var(--hero-shade,.85) * .95)) 100%);
}

.hero-content {
  position: relative; z-index: 3; max-width: 560px; color: #fff; gap: 14px;
  display: flex; flex-direction: column; align-items: flex-start;
}
.hero-eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .8px;
  color: #7fb0ff; background: none; border: none; padding: 0;
}
.hero-content h1 {
  font-size: var(--hero-title, 34px); line-height: 1.15; font-weight: 800; letter-spacing: -.5px; margin: 0;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.hero-content p { font-size: 16px; color: #c9d6f0; max-width: 460px; margin: 0; }

.hero-timed-promo-banner {
  display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(120deg, #ff5722, #ff9800);
  color: #fff; font-weight: 700; font-size: 10.5px; padding: 4px 10px; border-radius: 16px;
  animation: heroTimedPromoPulse 1.8s ease-in-out infinite;
}
@keyframes heroTimedPromoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,87,34,.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,87,34,0); }
}

.hero-price { display: flex; align-items: baseline; gap: 12px; }
.hero-price-old { text-decoration: line-through; color: #94a3c8; font-size: 16px; }
.hero-price-now { font-size: 30px; font-weight: 800; color: #ffd166; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn-hero {
  background: #fff; color: #0b1220; padding: 13px 30px; border-radius: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: .3px;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .2s ease, box-shadow .2s ease;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.btn-hero-ghost {
  background: transparent; color: #fff; padding: 13px 28px; border-radius: 8px;
  font-weight: 700; font-size: 14px; border: 1.5px solid rgba(255,255,255,.55);
  transition: background .2s ease;
}
.btn-hero-ghost:hover { background: rgba(255,255,255,.14); }

.hero-figure {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%);
  width: var(--hero-img-size, 260px); z-index: 3;
}
.hero-figure img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 18px; background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.hero-slide [data-anim] { opacity: 0; transform: translateY(26px); }
.hero-slide.is-active [data-anim] {
  opacity: 1; transform: translateY(0);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.hero-slide.is-active [data-anim="1"] { transition-delay: .18s; }
.hero-slide.is-active [data-anim="2"] { transition-delay: .30s; }
.hero-slide.is-active [data-anim="3"] { transition-delay: .42s; }
.hero-slide.is-active [data-anim="4"] { transition-delay: .54s; }
.hero-slide.is-active [data-anim="5"] { transition-delay: .66s; }

.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s ease, background .2s ease;
}
.hero-main:hover .hero-nav { opacity: 1; }
.hero-nav:hover { background: rgba(255,255,255,.3); }
.hero-nav.prev { left: 18px; }
.hero-nav.next { right: 18px; }

.hero-dots { position: absolute; bottom: 26px; left: 60px; display: flex; gap: 9px; z-index: 6; }
.hero-dot {
  width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.45); transition: all .3s ease;
}
.hero-dot.active { background: #fff; width: 30px; border-radius: 5px; }

.hero-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.15); z-index: 6; }
.hero-progress span { display: block; height: 100%; width: 0; background: #ffd166; box-shadow: 0 0 10px rgba(255,209,102,.7); }

.hero-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.hero-tile {
  background: var(--surface); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.hero-tile span { font-weight: 700; font-size: 13.5px; }
.hero-tile a { font-size: 12.5px; color: var(--brand); font-weight: 600; }

.countdown { display: flex; gap: 6px; margin-bottom: 8px; }
.cd-box { background: #14181f; color: #fff; border-radius: 6px; padding: 4px 6px; text-align: center; min-width: 34px; }
.cd-num { display: block; font-weight: 700; font-size: 13px; line-height: 1.1; }
.cd-label { display: block; font-size: 8.5px; opacity: .7; }

/* ---- Flash sale banner strip ---- */
.flash-sale-banner {
  background: linear-gradient(135deg, #ff5a1f, #ff8a00); color: #fff; border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 20px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.flash-kicker { font-size: 14px; font-weight: 600; opacity: .9; }
.flash-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.flash-sub { font-size: 13px; font-weight: 600; }
.flash-cta { margin-left: auto; background: #fff; color: #ff5a1f; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 12.5px; }
.flash-sale .flash-scroll { background: #fff8f2; border: 1px solid #ffd9b3; border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 16px; margin: 0; }

@media (max-width: 1024px) {
  .hero-figure { width: calc(var(--hero-img-size, 260px) * 0.75); right: 40px; }
  .hero-content h1 { font-size: calc(var(--hero-title, 34px) * 0.9); }
  .hero-slide { padding: 0 40px; }
  .hero-dots { left: 40px; }
}
@media (max-width: 860px) {
  .hero-main   { min-height: var(--hero-h-mobile, 280px); border-radius: 12px; }
  .hero-slides { height: var(--hero-h-mobile, 280px); }
  .hero-slide { padding: 0 22px; }
  .hero-figure { display: none; }
  .hero-overlay { background: linear-gradient(180deg, rgba(8,13,28,.7) 0%, rgba(8,13,28,.9) 100%); }
  .hero-content { max-width: 100%; gap: 11px; }
  .hero-content h1 { font-size: calc(var(--hero-title, 34px) * 0.7); }
  .hero-content p { font-size: 14px; }
  .hero-price-now { font-size: 24px; }
  .hero-nav { opacity: 1; width: 38px; height: 38px; }
  .hero-nav.prev { left: 10px; } .hero-nav.next { right: 10px; }
  .hero-dots { left: 22px; bottom: 18px; }
  .btn-hero, .btn-hero-ghost { padding: 11px 22px; font-size: 13px; }
  .hero-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .hero-tiles { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   MOBILE POLISH - phone-first refinements
   ============================================================ */
@media (max-width: 860px) {
  .btn { min-height: 42px; }
  .menu-toggle { font-size: 26px; padding: 6px 10px; }
  .cart-link { font-size: 24px; padding: 4px 8px; }

  .brand-logo { height: 34px; }
  .brand-name { font-size: 13.5px; line-height: 1.15; }
  .utility-inner { justify-content: center; font-size: 11.5px; gap: 10px; }

  .mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  }
  .mobile-bar a {
    flex: 1; text-align: center; padding: 9px 4px 7px; font-size: 10.5px; font-weight: 600;
    color: #4b5567; display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .mobile-bar a span.ic { font-size: 18px; line-height: 1; }
  .mobile-bar a.active { color: var(--brand); }
  body { padding-bottom: 58px; }
  .whatsapp-float { bottom: 70px; width: 50px; height: 50px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card-body { padding: 10px; }
  .product-card-body h3 { font-size: 12.5px; line-height: 1.3; }
  .product-card-body .card-actions { flex-direction: column; gap: 6px; }
  .product-card-body .card-actions .btn,
  .product-card-body .card-actions form { width: 100%; }
  .product-card-body .card-actions form .btn { width: 100%; }
  .price-now { font-size: 15px; }

  .flash-card { flex: 0 0 78%; }
  .flash-scroll { gap: 10px; padding: 12px; -webkit-overflow-scrolling: touch; }
  .flash-sale-banner { padding: 12px 14px; }
  .flash-title { font-size: 18px; }
  .flash-cta { margin-left: 0; margin-top: 6px; }

  input, select, textarea { font-size: 16px !important; }

  .cart-table-wrap, .admin-table { display: block; overflow-x: auto; }
  .warranty-table th { width: 120px; font-size: 12.5px; }
  .tool-page { padding: 18px; }
  .tool-page h1 { font-size: 20px; }

  .category-block-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { flex-direction: column; gap: 18px; }
}

.mobile-bar { display: none; }

/* ============================================================
   Downloads page
   ============================================================ */
.downloads-page { background: var(--surface); padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.dl-cat { margin-bottom: 26px; }
.dl-cat h2 { font-size: 17px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); font-weight: 700; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dl-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.dl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dl-card h3 { font-size: 15px; margin: 0; font-weight: 600; }
.dl-card p { font-size: 13px; color: var(--ink-muted); margin: 0; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.dl-chip { font-size: 11px; background: var(--brand-light); color: var(--brand-dark); padding: 4px 11px; border-radius: var(--radius-pill); font-weight: 600; }
.dl-card .btn { margin-top: auto; }
.dl-count { font-size: 11.5px; color: var(--ink-faint); }
@media (max-width: 860px) { .dl-grid { grid-template-columns: 1fr; } .downloads-page { padding: 18px; } }

/* ============================================================
   Cascading location picker (Province / District / Tehsil)
   ============================================================ */
.loc-wrap { position: relative; }
.loc-input { width: 100%; }
.loc-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%;
  background: var(--surface); border: 1.5px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 230px; overflow-y: auto; box-shadow: var(--shadow-md);
}
.loc-option { padding: 9px 13px; font-size: 14px; cursor: pointer; }
.loc-option:hover { background: var(--brand-light); color: var(--brand-dark); }
.loc-none { padding: 9px 13px; font-size: 12.5px; color: var(--ink-faint); }

/* The three location pickers need more room than a normal 3-up form row -
   a 120px-wide dropdown can't show "Islamabad Capital Territory". Give them
   their own full-width row that wraps instead of squeezing. */
.location-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.location-row .loc-list { min-width: 240px; }
@media (max-width: 860px) { .location-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   Hero figure: proper two-column layout.

   It was absolutely positioned at right:70px, so on narrower screens it
   overlapped the headline or ran past the slide edge and got clipped.
   Making the slide a flex row instead means the text and photo share the
   space properly and the photo is always fully visible and centred.
   ========================================================================== */
.hero-slide.is-active {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.hero-slide .hero-content { flex: 1 1 auto; min-width: 0; }

.hero-figure {
  position: static;          /* was absolute - the cause of the clipping */
  transform: none;
  flex: 0 0 auto;
  width: var(--hero-img-size, 260px);
  max-width: 38%;
  align-self: center;        /* vertically centred within the slide */
  z-index: 3;
}
.hero-figure img {
  width: 100%; aspect-ratio: 1/1; object-fit: contain;
  background: #fff; padding: 10px; border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

@media (max-width: 1024px) {
  .hero-figure { width: calc(var(--hero-img-size, 260px) * 0.72); max-width: 34%; }
}
@media (max-width: 860px) {
  /* On a phone the photo would leave no room for the headline, so the
     text-only hero is the better experience. */
  .hero-figure { display: none; }
  .hero-slide.is-active { justify-content: flex-start; }
}

/* Product sort control on the storefront listing */
.products-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.products-head .section-title { margin-bottom: 0; }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-form label { font-size: 13px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.sort-form select { margin-top: 0 !important; min-width: 180px; }
@media (max-width: 560px) {
  .products-head { flex-direction: column; align-items: stretch; }
  .sort-form select { width: 100%; }
}
