/* GLOBAL MOBILE SAFETY */
html, body {
  width: 100%;
  overflow-x: hidden;
}

:root{
  --blue-900:#0b3a6d;   /* sea */
  --blue-800:#0f4b8a;
  --blue-700:#1461b4;   /* sky */
  --bg:#f6f7fb;
  --text:#1b1f24;
  --muted:#6b7280;
  --card:#ffffff;
  --line:#e6e9f2;
  --ok:#10b981;
  --warn:#f59e0b;
  --bad:#ef4444;
}

*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
.page{max-width:1200px;margin:18px auto;padding:0 12px}

/* Header */
.site-header{background:var(--blue-700)}
.topbar{
  max-width:1200px;margin:0 auto;
  display:flex;align-items:center;gap:12px;
  padding:12px;
}
.brand{display:flex;align-items:center;gap:8px;color:#fff;font-weight:700}
.brand-name{font-size:24px;letter-spacing:.2px}
.country{display:flex;align-items:center;gap:8px;color:#fff}
.flag{width:18px;height:12px;object-fit:cover;border-radius:2px}
.country-select{border:0;border-radius:8px;padding:8px;background:rgba(255,255,255,.15);color:#fff}

.search{
  flex:1;display:flex;align-items:center;gap:8px;
  background:#fff;border-radius:12px;padding:6px;
}
.search-cat{border:0;background:#f2f5ff;border-radius:10px;padding:10px}
.search-input{border:0;outline:0;flex:1;font-size:14px;padding:10px}
.search-btn{border:0;background:var(--blue-800);color:#fff;border-radius:10px;padding:10px 14px;cursor:pointer}

.top-actions{display:flex;align-items:center;gap:16px;color:#fff}
.action-small{font-size:12px;opacity:.9}
.action-big{font-weight:700}
.icon-action{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:70px}
.badge{
  position:absolute;top:-6px;right:10px;
  background:#fff;color:var(--blue-800);
  font-size:12px;border-radius:999px;padding:2px 6px;font-weight:700
}

.navrow{
  background:rgba(255,255,255,.92);
  max-width:1200px;margin:0 auto;
  display:flex;gap:18px;align-items:center;
  padding:10px 12px;
  border-top:1px solid rgba(255,255,255,.25);
}
.allcats{border:0;background:transparent;font-weight:700;cursor:pointer}
.navrow a{color:#1f2937;font-size:14px}
.navrow .pill{font-weight:700}

/* Product grid */
.toolbar{
  display:flex;justify-content:space-between;align-items:center;
  gap:12px;margin-bottom:10px
}
.toolbar .select{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px}
.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  display:flex;flex-direction:column;
}
.card .thumb{height:170px;background:#e9eefc;display:flex;align-items:center;justify-content:center}
.card .thumb img{max-width:100%;max-height:100%;object-fit:contain}
.card .meta{padding:10px 12px;display:flex;flex-direction:column;gap:8px}
.badges-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.tag{font-size:12px;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#243b79;font-weight:700}
.tag.new{background:#e0f2fe;color:#075985}
.tag.old{background:#f1f5f9;color:#334155}
.tag.sale{background:#fee2e2;color:#991b1b}
.tag.oos{background:#111827;color:#fff}

.price{font-weight:800}
.price del{color:var(--muted);font-weight:600;margin-right:6px}
.stars{font-size:14px;color:#111827}
.small{font-size:12px;color:var(--muted)}
.btn{border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 12px;cursor:pointer}
.btn.primary{background:var(--blue-800);color:#fff;border-color:var(--blue-800)}
.btn[disabled]{opacity:.55;cursor:not-allowed}

/* Cart drawer */
.cart-drawer{
  position:fixed;top:0;right:0;height:100vh;width:360px;
  background:#fff;border-left:1px solid var(--line);
  transform:translateX(100%);
  transition:transform .25s ease;
  z-index:50;display:flex;flex-direction:column;
}
.cart-drawer.open{transform:translateX(0)}
.drawer-head{display:flex;justify-content:space-between;align-items:center;padding:14px;border-bottom:1px solid var(--line)}
.drawer-title{font-weight:800}
.drawer-close{border:0;background:transparent;font-size:18px;cursor:pointer}
.drawer-body{padding:12px;flex:1;overflow:auto}
.drawer-foot{padding:12px;border-top:1px solid var(--line);display:flex;gap:10px}
.drawer-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:40
}

/* Footer + mobile tabbar */
.site-footer{background:var(--blue-900);color:#fff;margin-top:22px}
.footer-grid{
  max-width:1200px;margin:0 auto;padding:18px 12px;
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px
}
.footer-title{font-weight:800;margin-bottom:10px}
.store-badges{display:flex;gap:10px}
.badge-box{display:inline-flex;align-items:center;justify-content:center;min-width:120px;padding:10px;border-radius:12px;background:rgba(255,255,255,.14)}
.social{display:flex;gap:10px;flex-wrap:wrap}
.social-ico{width:44px;height:44px;border-radius:999px;background:rgba(255,255,255,.14);display:inline-flex;align-items:center;justify-content:center;font-weight:800}
.links{display:flex;gap:12px;flex-wrap:wrap;color:rgba(255,255,255,.9)}
.footer-links{display:flex;flex-direction:column;gap:10px}
.mobile-tabbar{
  display:none;
  position:sticky;bottom:0;
  background:#fff;color:#111827;
  border-top:1px solid var(--line);
}
.mobile-tabbar a{
  flex:1;text-align:center;padding:12px 6px;font-weight:700
}

/* Responsive */
@media (max-width: 1024px){
  .grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width: 760px){
  .topbar{flex-wrap:wrap}
  .top-actions{width:100%;justify-content:space-between}
  .navrow{overflow:auto;white-space:nowrap}
  .grid{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr}
  .mobile-tabbar{display:flex}
}
/* =========================
   HEADER RESPONSIVE FIX
========================= */

.topbar {
  flex-wrap: wrap;
}

.search {
  flex: 1 1 100%;
  min-width: 0;
}

.search-input {
  min-width: 0;
  width: 100%;
}

.search-cat {
  max-width: 120px;
}

.top-actions {
  width: 100%;
  justify-content: space-between;
  margin-top: 8px;
}

.icon-action {
  min-width: auto;
}

/* MOBILE HEADER */
@media (max-width: 768px) {
  .topbar {
    gap: 8px;
  }

  .brand-name {
    font-size: 20px;
  }

  .country {
    display: none; /* hide country selector on mobile */
  }

  .navrow {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .navrow::-webkit-scrollbar {
    display: none;
  }
}
/* PRODUCT GRID MOBILE */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
/* TOOLBAR MOBILE */
@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .toolbar form {
    width: 100%;
  }

  .toolbar .select {
    width: 100%;
  }
}
/* MOBILE BOTTOM NAV */
.mobile-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--line);
    z-index: 999;
  }

  .mobile-tabbar a {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
  }

  body {
    padding-bottom: 60px; /* prevent content hidden behind nav */
  }
}
/* CART DRAWER ANIMATION */
.cart-drawer{
  position:fixed; top:0; right:0; height:100vh; width:360px;
  background:#fff; border-left:1px solid var(--line);
  transform:translateX(110%);
  transition:transform .28s ease;
  z-index:1000;
  display:flex; flex-direction:column;
  will-change: transform;
}
.cart-drawer.open{ transform:translateX(0); }

.drawer-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.38);
  opacity:0;
  transition:opacity .2s ease;
  z-index:999;
}
.drawer-backdrop.show{ opacity:1; }

body.lock-scroll{ overflow:hidden; }

@media (max-width: 420px){
  .cart-drawer{ width:92vw; }
}
/* SKELETON LOADER */
.skeleton{
  position:relative;
  overflow:hidden;
  background:#eef2ff;
  border-radius:12px;
}
.skeleton::after{
  content:"";
  position:absolute; inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shimmer 1.15s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.sk-card{ border:1px solid var(--line); border-radius:14px; background:#fff; overflow:hidden; }
.sk-thumb{ height:170px; }
.sk-line{ height:12px; margin:10px 12px; }
.sk-line.w60{ width:60%; }
.sk-line.w85{ width:85%; }
.sk-btn{ height:40px; margin:12px; border-radius:12px; }
/* TOUCH TARGETS */
.btn, .icon-action, .mobile-tabbar a, .pillopt, .allcats, .search-btn{
  min-height:44px;
}

.icon-action i{
  font-size:18px;
}

.mobile-tabbar a{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  justify-content:center;
}

.mobile-tabbar a i{
  font-size:18px;
}
/* ===== TOP HEADER LAYOUT ===== */
.topbar{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:22px;
  font-weight:900;
  color:#fff;
}

.brand-mark{
  font-size:22px;
}

.search{
  flex:1;
  display:flex;
  min-width:0;
}

.search-input{
  min-width:0;
  width:100%;
}

.top-icons{
  display:flex;
  align-items:center;
  gap:14px;
}

.icon-action{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  color:#fff;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.icon-action i{
  font-size:20px;
}

.icon-label{
  margin-top:2px;
}

.badge{
  position:absolute;
  top:-6px;
  right:-8px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:2px 6px;
}

/* MOBILE FIX */
@media (max-width:768px){
  .icon-label{ display:none; }
  .country{ display:none; }
}
/* =========================
   HEADER LAYOUT (FINAL)
========================= */

.site-header{
  background:#1664b8;
}

/* ROW 1 */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  color:#fff;
  font-size:22px;
  font-weight:900;
}

.brand-mark{
  font-size:22px;
}

/* ICONS */
.top-icons{
  display:flex;
  gap:18px;
}

.icon-action{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  color:#fff;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.icon-action i{
  font-size:20px;
}

.icon-label{
  margin-top:2px;
}

.badge{
  position:absolute;
  top:-6px;
  right:-10px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:2px 6px;
}

/* ROW 2 — FULL WIDTH SEARCH */
.search-row{
  padding:10px 14px;
}

.full-search{
  width:100%;
  display:flex;
}

.search-cat{
  border-radius:12px 0 0 12px;
}

.search-input{
  flex:1;
  min-width:0;
}

.search-btn{
  border-radius:0 12px 12px 0;
}

/* MOBILE TWEAKS */
@media (max-width:768px){
  .icon-label{
    display:none;
  }
}
/* =========================
   HEADER — DESKTOP DEFAULT
========================= */

.topbar{
  display:flex;
  align-items:center;            /* 🔴 ensures same vertical alignment */
  justify-content:space-between;
  gap:14px;
  padding:10px 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  color:#fff;
  font-size:22px;
  font-weight:900;
}

.brand-mark{
  font-size:22px;
}

/* SEARCH — DESKTOP INLINE */
.search{
  flex:1;
  display:flex;
  max-width:620px;
}

.search-input{
  flex:1;
  min-width:0;
}

.search-cat{
  border-radius:12px 0 0 12px;
}

.search-btn{
  border-radius:0 12px 12px 0;
}

/* ICONS */
.top-icons{
  display:flex;
  align-items:center;            /* 🔴 same height as logo */
  gap:18px;
}

.icon-action{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;        /* 🔴 vertical centering */
  color:#fff;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.icon-action i{
  font-size:20px;
}

.icon-label{
  margin-top:2px;
}

.badge{
  position:absolute;
  top:-6px;
  right:-10px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:2px 6px;
}

/* =========================
   MOBILE ONLY CHANGES
========================= */

@media (max-width:768px){

  /* keep logo + icons SAME ROW */
  .topbar{
    flex-wrap:wrap;
  }

  /* move search UNDER icons */
  .search{
    order:3;
    width:100%;
    max-width:none;
    margin-top:10px;
  }

  /* icons stay aligned with logo */
  .top-icons{
    order:2;
  }

  .brand{
    order:1;
  }

  /* labels hidden on mobile */
  .icon-label{
    display:none;
  }
}
/* =========================
   HEADER – DESKTOP DEFAULT
========================= */

.topbar{
  display:flex;
  align-items:center;                 /* SAME HEIGHT */
  justify-content:space-between;
  gap:14px;
  padding:10px 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  color:#fff;
  font-size:22px;
  font-weight:900;
}

.brand-mark{
  font-size:22px;
}

/* SEARCH – DESKTOP INLINE */
.search{
  flex:1;
  max-width:620px;
  display:flex;
}

.search-input{
  flex:1;
  min-width:0;
}

.search-cat{
  border-radius:12px 0 0 12px;
}

.search-btn{
  border-radius:0 12px 12px 0;
}

/* ICONS */
.top-icons{
  display:flex;
  align-items:center;                 /* SAME HEIGHT AS LOGO */
  gap:18px;
}

.icon-action{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.icon-action i{
  font-size:20px;
}

.icon-label{
  margin-top:2px;
}

.badge{
  position:absolute;
  top:-6px;
  right:-10px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:2px 6px;
}

/* =========================
   MOBILE ONLY (IMPORTANT)
========================= */

@media (max-width:768px){

  /* keep logo + icons same row */
  .topbar{
    flex-wrap:wrap;
  }

  /* move search UNDER logo + icons */
  .search{
    order:3;                           /* 🔴 moves down */
    width:100%;                        /* 🔴 full width */
    max-width:none;
    margin-top:10px;
  }

  .brand{ order:1; }
  .top-icons{ order:2; }

  /* hide text under icons */
  .icon-label{
    display:none;
  }
}
/* =====================================================
   MOBILE FORCE SEARCH UNDER LOGO + ICONS (FINAL FIX)
===================================================== */
@media (max-width: 768px) {

  /* Allow wrapping */
  .topbar {
    flex-wrap: wrap !important;
  }

  /* Logo stays first row */
  .brand {
    order: 1;
    flex: 0 0 auto;
  }

  /* Icons stay first row */
  .top-icons {
    order: 2;
    flex: 0 0 auto;
  }

  /* 🔴 FORCE SEARCH TO NEW ROW */
  .search {
    order: 3 !important;
    flex: 0 0 100% !important;   /* FULL ROW */
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px;
  }

  /* Make input stretch */
  .search-input {
    width: 100% !important;
  }
}
/* =========================
   AUTH (LOGIN / REGISTER)
========================= */

.auth-wrap{
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f5f7fb;
}

.auth-card{
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 20px 26px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  border: 1px solid #e5e7eb;
}

.auth-card h2{
  text-align: center;
  font-size: 22px;
  margin-bottom: 18px;
  color: #111827;
}

/* INPUT GROUP */
.input-group{
  position: relative;
  margin-bottom: 14px;
}

.input-group i{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #6b7280;
}

.input-group input{
  width: 100%;
  height: 44px;
  padding: 0 12px 0 40px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
}

.input-group input:focus{
  border-color: #1664b8;
  box-shadow: 0 0 0 2px rgba(22,100,184,.15);
}

/* LOGIN BUTTON */
.auth-card .btn{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
}

/* ERROR MESSAGE */
.alert.error{
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

/* LINKS */
.auth-links{
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: #374151;
}

.auth-links a{
  color: #1664b8;
  font-weight: 800;
  margin-left: 4px;
}

/* MOBILE TWEAK */
@media (max-width: 480px){
  .auth-card{
    padding: 20px 16px 24px;
  }
}
.toggle-pass{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  cursor:pointer;
  color:#6b7280;
  font-size:16px;
}
/* LOGIN ERROR ANIMATION */
@keyframes shake {
  0%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  50%{transform:translateX(6px)}
  75%{transform:translateX(-6px)}
  100%{transform:translateX(0)}
}

.auth-card.shake{
  animation: shake .35s ease;
}
.icon-heart.active{
  color:#ef4444;
}
updateCartBadge(response.total_items);
/* PASSWORD EYE TOGGLE (FIX POSITION) */
.input-group.has-toggle input{
  padding-right: 44px; /* reserve space for eye button */
}

.toggle-pass{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border:none;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#6b7280;
  border-radius:10px;
}

.toggle-pass:active{
  transform:translateY(-50%) scale(.96);
}

.input-group{ position:relative; }

.input-group.has-toggle input{
  padding-right: 46px;
}

.toggle-pass{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border:0;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:5;              /* important */
  color:#6b7280;
}
/* GOOGLE LOGIN BUTTON */
.btn.google{
  background:#ffffff;
  color:#111827;
  border:1px solid #d1d5db;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:700;
}

.btn.google img{
  width:18px;
  height:18px;
}

.btn.google:hover{
  background:#f9fafb;
}
@media (max-width:768px){
  .topbar{
    flex-wrap:wrap;
  }
  .search{
    order:3;
    flex:0 0 100%;
    width:100%;
    margin-top:10px;
  }
  .brand{ order:1; }
  .top-icons{ order:2; }
  .icon-label{ display:none; }
}
/* =========================
   USER AVATAR DROPDOWN
========================= */

.user-menu{
  position:relative;
}

.avatar-btn{
  background:none;
  border:0;
  cursor:pointer;
}

.user-dropdown{
  position:absolute;
  right:0;
  top:120%;
  width:180px;
  background:#ffffff;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.15);
  border:1px solid #e5e7eb;
  display:none;
  z-index:1000;
}

.user-dropdown a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  color:#111827;
  font-size:14px;
  text-decoration:none;
}

.user-dropdown a:hover{
  background:#f3f4f6;
}

.user-dropdown hr{
  margin:6px 0;
  border:0;
  border-top:1px solid #e5e7eb;
}

.user-dropdown .danger{
  color:#dc2626;
}

/* SHOW DROPDOWN */
.user-menu.open .user-dropdown{
  display:block;
}
/* ICON ANIMATION */
.anim-icon{
  transition:transform .2s ease, opacity .2s ease;
}

.anim-icon:hover{
  transform:scale(1.1);
}

.anim-icon:active{
  transform:scale(.95);
  opacity:.7;
}
.avatar-img{
  width:24px;height:24px;border-radius:50%;object-fit:cover;
}
.site-header{ position:sticky; top:0; z-index:1000; transition:transform .25s ease; }
.site-header.hide{ transform:translateY(-100%); }
.header-skeleton{
  height:64px;background:#e5e7eb;display:none;
  animation:pulse 1.1s infinite ease-in-out;
}
@keyframes pulse{50%{opacity:.6}}
body.loading .site-header{visibility:hidden}
body.loading .header-skeleton{display:block}
/* NOTIFICATION DROPDOWN */
.notif-menu{ position:relative; }

.notif-dropdown{
  position:absolute;
  right:0;
  top:120%;
  width:300px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  border:1px solid #e5e7eb;
  display:none;
  z-index:3000;
}

.notif-menu.open .notif-dropdown{ display:block; }

.notif-head{
  padding:10px 14px;
  font-weight:800;
  border-bottom:1px solid #e5e7eb;
}

.notif-list{
  max-height:260px;
  overflow:auto;
}

.notif-item{
  padding:10px 14px;
  font-size:14px;
  border-bottom:1px solid #f1f5f9;
}

.notif-item.unread{ background:#eef6ff; }

.notif-footer{
  display:block;
  padding:10px;
  text-align:center;
  font-weight:700;
}
/* --- FIX: Center auth pages on desktop --- */
.page{
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Login/Register wrapper */
.auth-wrap{
  width: 100%;
  display: flex;
  justify-content: center;   /* horizontal center */
  align-items: flex-start;   /* keep top nice */
  padding: 30px 0;
}

/* Center the card and prevent it from sticking left */
.auth-card{
  margin: 0 auto;
}

/* Optional: better vertical centering on large screens */
@media (min-width: 992px){
  .auth-wrap{
    min-height: calc(100vh - 180px);  /* smaller header estimate */
    align-items: center;              /* vertical center desktop */
    padding: 40px 0;
  }
}

/* =========================
   REGISTER PAGE (SCOPED)
========================= */

.register-page{
  display:flex;
  justify-content:center;
  padding:40px 15px;
}

.register-card{
  width:100%;
  max-width:460px;
  background:#fff;
  padding:28px 26px 30px;
  border-radius:18px;
  box-shadow:0 25px 60px rgba(0,0,0,.12);
}

.register-card h2{
  text-align:center;
  margin-bottom:20px;
  font-weight:800;
}

.register-error{
  background:#fee2e2;
  color:#991b1b;
  padding:10px;
  border-radius:10px;
  font-size:14px;
  margin-bottom:12px;
  text-align:center;
}

.reg-field{
  position:relative;
  margin-bottom:14px;
}

.reg-field i{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#64748b;
}

.reg-field input{
  width:100%;
  padding:12px 14px 12px 42px;
  border-radius:12px;
  border:1px solid #d1d5db;
  font-size:14px;
}

.reg-field input:focus{
  border-color:#1e40af;
  outline:none;
  box-shadow:0 0 0 3px rgba(30,64,175,.15);
}

/* Two columns for names */
.reg-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

/* Links */
.reg-links{
  margin-top:14px;
  text-align:center;
  font-size:14px;
}

.reg-links a{
  font-weight:700;
}

/* Mobile */
@media (max-width:520px){
  .reg-row{
    grid-template-columns:1fr;
  }
}
/* Register button (scoped) */
.register-btn{
  display:block;
  margin:20px auto 0;     /* center horizontally */
  width:85%;              /* wider but not full */
  max-width:320px;        /* nice desktop size */
  padding:14px 0;         /* taller button */
  font-size:16px;
  font-weight:800;
  border-radius:14px;
}
/* =========================
   VERIFY PAGE (SCOPED)
========================= */
.verify-page{
  display:flex;
  justify-content:center;
  padding:40px 15px;
}
.verify-card{
  width:100%;
  max-width:420px;
  background:#fff;
  padding:26px;
  border-radius:18px;
  box-shadow:0 25px 60px rgba(0,0,0,.12);
}
.verify-card h2{
  text-align:center;
  margin:0 0 10px;
  font-weight:800;
}
.verify-sub{
  text-align:center;
  color:#475569;
  font-size:14px;
  margin-bottom:16px;
}
.verify-error{
  background:#fee2e2;
  color:#991b1b;
  padding:10px;
  border-radius:10px;
  font-size:14px;
  margin-bottom:12px;
  text-align:center;
}
.verify-success{
  background:#dcfce7;
  color:#166534;
  padding:10px;
  border-radius:10px;
  font-size:14px;
  margin-bottom:12px;
  text-align:center;
}
.verify-input{
  width:100%;
  text-align:center;
  font-size:20px;
  letter-spacing:6px;
  padding:14px 12px;
  border-radius:14px;
  border:1px solid #d1d5db;
}
.verify-input:focus{
  border-color:#1e40af;
  outline:none;
  box-shadow:0 0 0 3px rgba(30,64,175,.15);
}
.verify-btn{
  display:block;
  width:80%;
  max-width:320px;
  margin:14px auto 0;
  padding:14px 0;
  border-radius:14px;
  font-weight:800;
}
.verify-resend{
  margin-top:14px;
  text-align:center;
}
.verify-resend-btn{
  padding:10px 14px;
  border-radius:12px;
}
.verify-timer{
  margin-top:8px;
  font-size:13px;
  color:#64748b;
}
/* =========================
   Lebanese Phone Input
========================= */
/* =========================
   Lebanese Phone Field
========================= */
.phone-field {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
}

.phone-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #475569;
  pointer-events: none;
  z-index: 2;
}

.phone-field input {
  width: 100%;
  padding: 14px 14px 14px 96px !important; /* space for 🇱🇧 +961 */
  border-radius: 14px;
  border: 1px solid #d1d5db;
  font-size: 15px;
}

.phone-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
/* =========================
   Lebanese Phone Field
========================= */
.phone-field {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
}

/* INLINE flag + code */
.phone-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;        /* 👈 forces horizontal layout */
  align-items: center;         /* 👈 vertical alignment */
  gap: 6px;                    /* 👈 space between flag and +961 */
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

.phone-prefix .lb-flag {
  width: 18px;
  height: 18px;
  display: inline-block;       /* 👈 prevents stacking */
  object-fit: cover;
  border-radius: 2px;
}

.phone-prefix .dial-code {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: #475569;
}

/* input padding leaves room for flag + +961 */
.phone-field input {
  width: 100%;
  padding: 14px 14px 14px 112px !important;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  font-size: 15px;
}

.phone-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.phone-error{
  margin-top:6px;
  font-size:13px;
  color:#dc2626;
  display:none;
}
.phone-error.show{
  display:block;
}
.otp-timer{
  text-align:center;
  font-size:13px;
  color:#64748b;
  margin-top:6px;
}
.verify-limit{
  margin-top:8px;
  font-size:13px;
  color:#b45309;
  text-align:center;
}
.verify-resend-btn.is-disabled{
  opacity:.55;
  cursor:not-allowed;
}
.verify-attempts{
  margin-top:10px;
  font-size:13px;
  color:#64748b;
  text-align:center;
}
/* Force top header icons to be white */
.top-icons .icon-action,
.top-icons .icon-action i,
.top-icons .icon-action span {
  color: #fff !important;
}

/* Badge text stays white */
.top-icons .badge {
  color: #fff !important;
}
/* =========================
   CHECKOUT (SCOPED)
   Put this at END of CSS
========================= */

.checkout-wrap{
  max-width: 980px;
  margin: 18px auto;
  padding: 0 12px;
}

.checkout-card{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
  overflow: hidden;
}

.checkout-head{
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.checkout-title{
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .2px;
}

.checkout-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Steps */
.checkout-steps{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.step{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  min-height: 52px;
}

.step-index{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: #eef2ff;
  color: #243b79;
  flex: 0 0 auto;
}

.step-text{
  font-weight: 800;
  font-size: 14px;
  color: #111827;
}

.step.is-active{
  border-color: var(--blue-800);
  box-shadow: 0 0 0 3px rgba(15,75,138,.12);
}

.step.is-active .step-index{
  background: var(--blue-800);
  color: #fff;
}

/* Body */
.checkout-body{
  padding: 16px 16px 18px;
}

.pane{ display: none; }
.pane.is-active{ display: block; }

/* Form */
.form .field label{
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #111827;
}

.form-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field{ grid-column: span 6; }
.field-full{ grid-column: span 12; }

.form input,
.form select,
.form textarea{
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.form textarea{
  min-height: 92px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus{
  border-color: var(--blue-800);
  box-shadow: 0 0 0 3px rgba(15,75,138,.12);
}

.hint{
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* Phone */
.phone-box{
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.phone-prefix{
  padding: 0 12px;
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  font-weight: 900;
  color: #111827;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.phone-box input{
  border: 0 !important;
  border-radius: 0 !important;
  padding: 12px 12px !important;
}

/* Row / actions */
.form-row{
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.checkbox{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  color: #111827;
}

.actions{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Verify */
.verify-box{
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.verify-box h3{
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
}

.muted{ color: var(--muted); }

.otp-row{
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-top: 12px;
}

.otp-input{
  height: 44px;
}

/* Prep layout */
.prep-layout{
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 14px;
}

.box{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.box-head h3{
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.box-head p{
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.invoice-box{
  margin-top: 12px;
  min-height: 80px;
}

.coupon-row{
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  margin-top: 12px;
}

.summary-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  position: sticky;
  top: 92px;
}

.summary-card h3{
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 900;
}

.sum-row{
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: #111827;
  font-weight: 700;
}

.sum-divider{
  height: 1px;
  background: var(--line);
  margin: 8px 0 10px;
}

.sum-total{
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 900;
}

.btn-block{
  width: 100%;
  margin-top: 12px;
}

/* Final */
.final-box{
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  background: #fff;
}

.final-icon{
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px){
  .checkout-steps{
    grid-template-columns: repeat(2, 1fr);
  }
  .prep-layout{
    grid-template-columns: 1fr;
  }
  .summary-card{
    position: static;
    top: auto;
  }
}

@media (max-width: 620px){
  .checkout-title{ font-size: 22px; }

  .field{ grid-column: span 12; }

  .otp-row{
    grid-template-columns: 1fr;
  }

  .coupon-row{
    grid-template-columns: 1fr;
  }

  .actions{
    justify-content: stretch;
  }
  .actions .btn{
    width: 100%;
  }
}

