/*
==============================================================================
URBANNEST — FINAL SINGLE PREMIUM RESPONSIVE STYLESHEET
Includes:
- Complete original website styling
- Premium desktop/tablet/mobile responsiveness
- Responsive header, drawer and bottom navigation
- Correct shop filters and sorting toolbar
- Equal-height product cards and contained product images
- Responsive cart table/card layout
- Authentication, admin, product detail, footer and newsletter styling
==============================================================================
*/

:root{--navy:#0b1739;--blue:#175cd3;--sky:#eaf2ff;--accent:#ff7a1a;--green:#138a4b;--ink:#101828;--muted:#667085;--line:#e4e7ec;--bg:#f5f7fb;--white:#fff;--shadow:0 16px 45px rgba(16,24,40,.09);--radius:18px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,Arial,sans-serif;color:var(--ink);background:var(--bg)}body.no-scroll{overflow:hidden}a{text-decoration:none;color:inherit}img{max-width:100%;display:block}.shell{width:min(1280px,calc(100% - 32px));margin:auto}.announcement{background:var(--navy);color:white;height:34px;display:flex;align-items:center;justify-content:center;gap:42px;font-size:12px;font-weight:600}.site-header{background:white;position:sticky;top:0;z-index:80;box-shadow:0 1px 0 var(--line)}.header-main{height:86px;display:flex;align-items:center;gap:28px}.logo{display:flex;align-items:center;gap:10px;min-width:max-content}.logo-mark{width:48px;height:48px;border-radius:14px;background:linear-gradient(135deg,#f7c948,#d79a00);display:grid;place-items:center;font-weight:900;color:#101828;box-shadow:0 8px 22px #d79a0030}.logo strong{font-family:'Playfair Display',serif;font-size:25px;line-height:1}.logo small{display:block;text-transform:uppercase;letter-spacing:1.5px;font-size:9px;color:var(--muted);margin-top:4px}.global-search{height:52px;display:flex;flex:1;border:1px solid #d7deea;border-radius:14px;overflow:hidden;background:#f9fbff}.global-search input{border:0;background:transparent;outline:0;padding:0 18px;flex:1;font-size:15px}.global-search button{border:0;background:var(--navy);color:#fff;padding:0 25px;font-weight:800;cursor:pointer}.header-actions{display:flex;gap:22px;align-items:center;font-size:14px;font-weight:700}.cart-pill{background:var(--navy);color:white;padding:13px 15px;border-radius:13px}.cart-pill b{background:#f7c948;color:#111;padding:2px 7px;border-radius:99px;margin-left:5px}.category-nav{border-top:1px solid #f1f3f7}.category-nav .shell{display:flex;align-items:center;justify-content:center;gap:42px;height:48px;overflow:auto}.category-nav a{font-size:13px;font-weight:700;color:#475467;white-space:nowrap}.category-nav a:hover{color:var(--blue)}.hamburger{display:none}.icon-btn{border:0;background:transparent;cursor:pointer}.hamburger span{display:block;width:22px;height:2px;background:var(--navy);margin:5px}.drawer-overlay{position:fixed;inset:0;background:#10182888;z-index:98;opacity:0;visibility:hidden;transition:.25s}.drawer-overlay.show{opacity:1;visibility:visible}.mobile-drawer{position:fixed;left:-360px;top:0;bottom:0;width:min(340px,88vw);background:white;z-index:99;padding:20px;transition:.3s;overflow:auto}.mobile-drawer.open{left:0}.drawer-head{display:flex;justify-content:space-between;align-items:center}.drawer-head .icon-btn{font-size:32px}.drawer-search{display:flex;margin:24px 0}.drawer-search input{width:100%;padding:13px;border:1px solid var(--line);border-radius:10px 0 0 10px}.drawer-search button{background:var(--navy);color:white;border:0;padding:0 14px;border-radius:0 10px 10px 0}.drawer-links a{display:block;padding:12px 8px;border-bottom:1px solid #f1f2f5;font-weight:600}.alert{width:min(1280px,calc(100% - 32px));margin:14px auto;padding:13px 16px;border-radius:12px}.alert-success{background:#dcfae6;color:#067647}.alert-danger{background:#fee4e2;color:#b42318}.alert-warning{background:#fef0c7;color:#93370d}
.hero{position:relative;background:#08163c;min-height:510px;overflow:hidden}.hero-slide{position:absolute;inset:0;opacity:0;transition:opacity .7s;background-size:cover;background-position:center}.hero-slide.active{opacity:1}.hero-slide:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#07163ff5 0%,#07163fd9 38%,#07163f42 75%,transparent)}.hero-content{position:relative;z-index:2;color:white;padding:86px 0;max-width:600px}.eyebrow{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:2px;color:#f7c948}.hero h1{font-family:'Playfair Display',serif;font-size:58px;line-height:1.08;margin:14px 0 20px}.hero p{font-size:18px;line-height:1.7;color:#e8edf8}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:11px;padding:13px 20px;font-weight:800;cursor:pointer}.btn-primary{background:var(--accent);color:white}.btn-secondary{background:white;color:var(--navy)}.btn-dark{background:var(--navy);color:white}.btn-light{background:#eff3fa;color:var(--navy)}.btn-accent{background:var(--accent);color:white}.hero-actions{display:flex;gap:12px;margin-top:30px}.hero-offer{display:inline-flex;gap:12px;align-items:center;background:#ffffff14;border:1px solid #ffffff2e;border-radius:12px;padding:10px 14px;margin-top:24px}.hero-offer b{color:#f7c948}.trust-strip{margin-top:-34px;position:relative;z-index:5}.trust-grid{display:grid;grid-template-columns:repeat(4,1fr);background:white;border-radius:18px;box-shadow:var(--shadow);overflow:hidden}.trust-item{padding:24px;display:flex;gap:14px;align-items:center;border-right:1px solid var(--line)}.trust-item:last-child{border:0}.trust-icon{width:46px;height:46px;border-radius:13px;background:var(--sky);display:grid;place-items:center;font-size:22px}.trust-item strong{display:block}.trust-item small{color:var(--muted)}.section{padding:64px 0}.section-sm{padding:38px 0}.section-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:24px}.section-head h2{font-family:'Playfair Display',serif;font-size:35px;margin:5px 0}.section-head p{color:var(--muted);margin:0}.section-link{font-weight:800;color:var(--blue)}.category-cards{display:grid;grid-template-columns:repeat(6,1fr);gap:16px}.category-card{background:white;border:1px solid var(--line);border-radius:16px;padding:18px;text-align:center;transition:.25s}.category-card:hover{transform:translateY(-5px);box-shadow:var(--shadow);border-color:#b8cdf4}.category-icon{height:110px;border-radius:13px;background:#f2f5fa;overflow:hidden;margin-bottom:14px}.category-icon img{width:100%;height:100%;object-fit:cover}.category-card strong{display:block}.category-card small{color:var(--muted)}.promo-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:20px}.promo-card{border-radius:20px;min-height:300px;padding:38px;background-size:cover;background-position:center;position:relative;overflow:hidden;color:white}.promo-card:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#07163fdf,#07163f25)}.promo-card>*{position:relative}.promo-card h3{font-family:'Playfair Display',serif;font-size:34px;margin:8px 0}.promo-card p{max-width:420px;line-height:1.6}.deal-band{background:linear-gradient(135deg,#0b1739,#1849a9);color:white}.deal-band .section-head p{color:#dbe8ff}.countdown{font-size:22px;font-weight:900;background:white;color:var(--navy);padding:10px 16px;border-radius:10px}.products-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.product-card{background:white;border:1px solid var(--line);border-radius:17px;overflow:hidden;transition:.25s;position:relative}.product-card:hover{box-shadow:var(--shadow);transform:translateY(-4px)}.product-media{height:230px;background:#f7f8fa;display:flex;align-items:center;justify-content:center;padding:14px;position:relative}.product-media img{width:100%;height:100%;object-fit:contain;transition:.25s}.product-card:hover .product-media img{transform:scale(1.04)}.sale-tag{position:absolute;top:12px;left:12px;background:var(--green);color:white;font-size:11px;padding:6px 8px;border-radius:7px;font-weight:800}.wishlist{position:absolute;right:12px;top:12px;width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:white;font-size:22px;cursor:pointer}.wishlist.active{color:#e31b54}.product-info{padding:17px}.product-brand{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:1px}.product-title{font-size:15px;line-height:1.4;height:42px;margin:7px 0;overflow:hidden}.rating{display:inline-flex;background:var(--green);color:white;border-radius:6px;padding:4px 6px;font-size:11px;font-weight:800}.review-count{font-size:12px;color:var(--muted)}.prices{display:flex;align-items:center;gap:8px;margin:12px 0 6px}.current-price{font-size:20px;font-weight:900}.old-price{text-decoration:line-through;color:#98a2b3;font-size:13px}.discount{color:var(--green);font-size:12px;font-weight:800}.product-benefits{font-size:12px;color:var(--muted);line-height:1.7}.card-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.brand-row{display:grid;grid-template-columns:repeat(6,1fr);gap:15px}.brand-box{height:90px;background:white;border:1px solid var(--line);border-radius:14px;display:grid;place-items:center;font-weight:900;color:#475467}.brand-box img{max-height:50px;max-width:120px}.newsletter{background:#eaf2ff;padding:48px 0}.newsletter .shell{display:flex;align-items:center;justify-content:space-between}.newsletter h2{font-family:'Playfair Display',serif;font-size:34px;margin:8px 0}.newsletter p{color:var(--muted)}
.shop-shell{display:grid;grid-template-columns:270px 1fr;gap:22px;padding:30px 0 60px}.filter-panel{background:white;border:1px solid var(--line);border-radius:16px;padding:20px;height:max-content;position:sticky;top:184px}.filter-head{display:flex;justify-content:space-between;align-items:center}.filter-group{padding:18px 0;border-top:1px solid var(--line)}.filter-group label{display:flex;gap:9px;margin:10px 0;font-size:13px}.filter-group input[type=text],.filter-group input[type=number],.filter-group select{width:100%;padding:11px;border:1px solid var(--line);border-radius:9px}.price-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.shop-main .products-grid{grid-template-columns:repeat(3,1fr)}.shop-toolbar{background:white;border:1px solid var(--line);border-radius:14px;padding:16px;margin-bottom:18px;display:flex;justify-content:space-between;align-items:center}.sort-tabs{display:flex;gap:14px;flex-wrap:wrap}.sort-tabs a{font-size:13px;font-weight:700;color:var(--muted)}.sort-tabs a.active{color:var(--blue)}.filter-toggle{display:none}.form-card,.card{background:white;border:1px solid var(--line);border-radius:18px;padding:26px;box-shadow:0 8px 30px #10182808}.form-card{max-width:650px;margin:40px auto}.form-card h1{font-family:'Playfair Display',serif}.form-card label{display:block;font-weight:700;margin:14px 0}.form-card input,.form-card textarea,.form-card select,.card input,.card textarea,.card select{width:100%;padding:12px;border:1px solid var(--line);border-radius:9px;margin-top:6px}.dashboard{display:grid;grid-template-columns:240px 1fr;gap:22px;padding:35px 0}.sidebar{background:var(--navy);color:white;padding:20px;border-radius:16px;height:max-content}.sidebar a{display:block;padding:11px;border-radius:8px}.sidebar a:hover{background:#ffffff17}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stat{background:white;padding:20px;border:1px solid var(--line);border-radius:14px}.stat b{font-size:26px}.table-wrap{overflow:auto;background:white;border-radius:14px;border:1px solid var(--line)}table{width:100%;border-collapse:collapse}th,td{padding:13px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}th{background:#f8fafc;font-size:12px;text-transform:uppercase}.badge{display:inline-block;background:#dcfae6;color:#067647;padding:5px 9px;border-radius:99px;font-size:11px;font-weight:800}.badge.danger{background:#fee4e2;color:#b42318}.product-detail{display:grid;grid-template-columns:1fr 1fr;gap:30px;padding:36px 0}.product-gallery{background:white;border:1px solid var(--line);border-radius:20px;padding:25px}.product-gallery img{width:100%;height:520px;object-fit:contain}.detail-info{background:white;border:1px solid var(--line);border-radius:20px;padding:32px}.detail-info h1{font-family:'Playfair Display',serif;font-size:38px}.spec-list{white-space:pre-line;line-height:1.8}.site-footer{background:#081126;color:#dce4f4;padding-top:55px}.footer-grid{display:grid;grid-template-columns:1.5fr repeat(3,1fr);gap:45px}.site-footer p{color:#aebbd3;line-height:1.7}.site-footer h4{color:white}.site-footer a,.site-footer span{display:block;color:#bec9dc;margin:11px 0;font-size:13px}.footer-bottom{border-top:1px solid #ffffff18;margin-top:40px;padding:18px 0;font-size:12px;color:#9daac1}.footer-bottom .shell{display:flex;justify-content:space-between}.mobile-bottom{display:none}
@media(max-width:1050px){.header-actions a:not(.cart-pill){display:none}.hamburger{display:block}.category-cards{grid-template-columns:repeat(3,1fr)}.products-grid{grid-template-columns:repeat(3,1fr)}.shop-main .products-grid{grid-template-columns:repeat(2,1fr)}.brand-row{grid-template-columns:repeat(3,1fr)}}
@media(max-width:780px){.announcement{display:none}.header-main{height:70px;gap:12px}.logo strong{font-size:20px}.logo small{display:none}.logo-mark{width:42px;height:42px}.global-search{display:none}.category-nav{display:none}.hero{min-height:500px}.hero-content{padding:70px 0}.hero h1{font-size:42px}.hero p{font-size:16px}.trust-strip{margin-top:-20px}.trust-grid{grid-template-columns:repeat(2,1fr)}.trust-item:nth-child(2){border-right:0}.category-cards{grid-template-columns:repeat(2,1fr)}.promo-grid{grid-template-columns:1fr}.products-grid,.shop-main .products-grid{grid-template-columns:repeat(2,1fr)}.shop-shell{grid-template-columns:1fr}.filter-panel{position:fixed;left:-310px;top:0;bottom:0;width:300px;z-index:110;border-radius:0;overflow:auto;transition:.25s}.filter-panel.open{left:0}.filter-toggle{display:inline-flex}.product-detail{grid-template-columns:1fr}.product-gallery img{height:350px}.newsletter .shell{display:block}.footer-grid{grid-template-columns:1fr 1fr}.mobile-bottom{position:fixed;bottom:0;left:0;right:0;background:white;border-top:1px solid var(--line);display:flex;justify-content:space-around;z-index:90;padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.mobile-bottom a{font-size:19px;text-align:center}.mobile-bottom span{display:block;font-size:10px}.site-footer{margin-bottom:58px}.stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.shell{width:min(100% - 22px,1280px)}.hero h1{font-size:36px}.hero-actions{display:grid}.trust-grid{grid-template-columns:1fr}.trust-item{border-right:0;border-bottom:1px solid var(--line)}.category-cards{grid-template-columns:repeat(2,1fr);gap:10px}.category-icon{height:90px}.products-grid,.shop-main .products-grid{grid-template-columns:1fr 1fr;gap:9px}.product-media{height:165px}.product-info{padding:11px}.product-title{font-size:13px}.card-actions{grid-template-columns:1fr}.card-actions .btn{padding:10px;font-size:11px}.section{padding:42px 0}.section-head h2{font-size:29px}.brand-row{grid-template-columns:repeat(2,1fr)}.footer-grid{grid-template-columns:1fr}.footer-bottom .shell{display:block}.dashboard{grid-template-columns:1fr}.sidebar{display:flex;overflow:auto}.sidebar a{white-space:nowrap}.stats{grid-template-columns:1fr 1fr}.product-gallery img{height:280px}.detail-info h1{font-size:30px}}


/* V6.1 authentication and legacy form compatibility */
.form,
.form-card {
  width:min(680px,calc(100% - 32px));
  margin:40px auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:30px;
  box-shadow:0 18px 50px rgba(16,24,40,.08);
}
.form h1,.form-card h1{font-family:'Playfair Display',serif;margin:0 0 22px}
.form label,.form-card label{display:block;font-weight:700;margin:15px 0 0}
.form input,.form textarea,.form select,
.form-card input,.form-card textarea,.form-card select{
  display:block;width:100%;min-height:46px;padding:12px 14px;margin-top:7px;
  border:1px solid #d0d5dd;border-radius:10px;background:#fff;font:inherit;outline:none
}
.form input:focus,.form textarea:focus,.form select:focus,
.form-card input:focus,.form-card textarea:focus,.form-card select:focus{
  border-color:#3468d4;box-shadow:0 0 0 4px rgba(52,104,212,.12)
}
.form .btn,.form-card .btn{margin-top:20px}

.auth-section{padding:58px 16px 78px;background:
 radial-gradient(circle at 10% 10%,rgba(52,104,212,.10),transparent 28%),
 radial-gradient(circle at 90% 0,rgba(247,201,72,.17),transparent 25%),
 #f5f8fd}
.auth-card{width:min(1050px,100%);margin:auto;background:#fff;border:1px solid #e3e8f1;border-radius:26px;box-shadow:0 24px 70px rgba(16,24,40,.10);display:grid;grid-template-columns:.9fr 1.1fr;overflow:hidden}
.auth-intro{padding:52px;background:linear-gradient(145deg,#091838,#163d8c);color:#fff;position:relative;overflow:hidden}
.auth-intro:after{content:"";position:absolute;width:260px;height:260px;border-radius:50%;background:rgba(255,255,255,.06);right:-90px;bottom:-110px}
.auth-intro h1{font-family:'Playfair Display',serif;font-size:42px;line-height:1.13;margin:12px 0 18px}
.auth-intro p{color:#d9e4f8;line-height:1.75;font-size:16px}
.auth-benefits{display:grid;gap:13px;margin-top:32px;color:#fff;font-weight:700;font-size:14px}
.auth-form{padding:46px 52px}
.field{margin-bottom:18px}.field label{display:block;font-size:13px;font-weight:800;margin-bottom:8px;color:#344054}
.field input{width:100%;height:50px;border:1px solid #d0d5dd;border-radius:11px;padding:0 14px;font:inherit;outline:none;background:#fff}
.field input:focus{border-color:#3468d4;box-shadow:0 0 0 4px rgba(52,104,212,.12)}
.password-wrap{position:relative}.password-wrap input{padding-right:72px}.password-toggle{position:absolute;right:8px;top:8px;height:34px;border:0;border-radius:8px;padding:0 10px;background:#eef3fb;color:#163d8c;font-weight:800;cursor:pointer}
.auth-submit{width:100%;min-height:50px;font-size:15px;margin-top:4px}
.auth-switch{text-align:center;color:#667085;margin:19px 0 0;font-size:14px}.auth-switch a{color:#1849a9;font-weight:800}

.otp-card{width:min(540px,100%);margin:auto;text-align:center;background:#fff;border:1px solid #e3e8f1;border-radius:24px;padding:44px;box-shadow:0 24px 70px rgba(16,24,40,.10)}
.otp-icon{width:62px;height:62px;border-radius:18px;background:#eaf2ff;color:#1849a9;display:grid;place-items:center;font-size:28px;margin:0 auto 20px}
.otp-card h1{font-family:'Playfair Display',serif;font-size:36px;margin:10px 0}.otp-card>p{color:#667085;line-height:1.7}
.otp-input{width:100%;height:64px;border:1px solid #bfc9d8;border-radius:13px;text-align:center;font-size:30px;font-weight:900;letter-spacing:12px;margin:18px 0;padding-left:12px;outline:none}
.otp-input:focus{border-color:#3468d4;box-shadow:0 0 0 4px rgba(52,104,212,.12)}
.resend-form{margin-top:17px}.link-button{border:0;background:transparent;color:#1849a9;font-weight:800;cursor:pointer;padding:8px}.link-button:disabled{color:#98a2b3;cursor:not-allowed}
.change-email{display:inline-block;margin-top:12px;color:#475467;font-size:13px;font-weight:700}

/* Admin pages */
body:has(.dashboard) main, body:has(.table-wrap) main{min-height:60vh}
.dashboard>section{min-width:0}
.dashboard>section>h1{font-family:'Playfair Display',serif;font-size:34px;margin-top:0}
.admin-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.admin-form-grid .full{grid-column:1/-1}

@media(max-width:760px){
 .auth-section{padding:28px 12px 55px}
 .auth-card{grid-template-columns:1fr;border-radius:19px}
 .auth-intro{padding:31px 25px}.auth-intro h1{font-size:32px}
 .auth-form{padding:28px 22px}
 .otp-card{padding:30px 20px}.otp-card h1{font-size:30px}
 .otp-input{font-size:26px;letter-spacing:8px}
 .form,.form-card{padding:22px;width:calc(100% - 24px);margin:24px auto}
 .admin-form-grid{grid-template-columns:1fr}
}


/* ==========================================================================
   V7.0 — PREMIUM RESPONSIVE UPGRADE
   Keeps the existing design intact and fixes viewport overflow, cart layout,
   mobile tables, header spacing, touch controls and small-screen usability.
   ========================================================================== */

/* ---------- Global safety and polish ---------- */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

main,
section,
header,
footer,
nav,
div,
form,
article,
aside {
  min-width: 0;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(23, 92, 211, .28);
  outline-offset: 3px;
}

::selection {
  background: rgba(23, 92, 211, .18);
}

.shell {
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  margin-inline: auto;
}

/* Prevent long text, prices and URLs from widening the page */
.product-title,
.product-name,
.detail-info,
.form-card,
.card,
.auth-card,
.otp-card,
.newsletter,
.site-footer {
  overflow-wrap: anywhere;
}

/* ---------- Header improvements ---------- */
.header-main {
  width: 100%;
  min-width: 0;
}

.global-search {
  min-width: 180px;
}

.global-search input {
  min-width: 0;
}

.header-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}

.category-nav .shell {
  scrollbar-width: thin;
}

.category-nav .shell::-webkit-scrollbar {
  height: 4px;
}

.category-nav .shell::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px;
  text-align: center;
  line-height: 1.2;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ---------- Generic table safety ---------- */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 720px;
}

table {
  max-width: 100%;
}

/* ==========================================================================
   SHOPPING CART — DESKTOP AND TABLET
   Works with the current cart.php structure:
   <h1>Shopping Cart</h1>
   <form><table>...</table><div class="card">...</div></form>
   ========================================================================== */

/* Cart page background and width */
main:has(> h1 + form > table),
main:has(> h1 + .card) {
  width: 100%;
  max-width: none;
  padding: 34px 0 64px;
  background:
    radial-gradient(circle at 8% 0%, rgba(23, 92, 211, .07), transparent 28%),
    linear-gradient(180deg, #f7f9fd 0%, #f3f6fb 100%);
}

main:has(> h1 + form > table) > h1,
main:has(> h1 + .card) > h1 {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 22px;
  color: var(--navy);
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -.03em;
}

/* Fallback for browsers/layouts where :has() is not applied */
main > h1 + form,
main > h1 + .card {
  width: min(1280px, calc(100% - 32px));
  margin-inline: auto;
}

main:has(> h1 + form > table) > form {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

/* Cart table card */
main > h1 + form > table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e8f1;
  border-radius: 20px;
  box-shadow: 0 14px 42px rgba(16, 24, 40, .07);
}

main > h1 + form > table th,
main > h1 + form > table td {
  vertical-align: middle;
  border-bottom: 1px solid #e8edf4;
}

main > h1 + form > table th {
  padding: 16px 20px;
  background: linear-gradient(180deg, #fbfcfe, #f6f8fc);
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

main > h1 + form > table td {
  padding: 20px;
  background: #fff;
  color: #101828;
  font-size: 15px;
}

main > h1 + form > table tbody tr:last-child td {
  border-bottom: 0;
}

main > h1 + form > table tbody tr {
  transition: background-color .2s ease;
}

main > h1 + form > table tbody tr:hover td {
  background: #fbfcff;
}

main > h1 + form > table th:nth-child(1),
main > h1 + form > table td:nth-child(1) {
  width: 43%;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 750;
}

main > h1 + form > table th:nth-child(2),
main > h1 + form > table td:nth-child(2) {
  width: 20%;
}

main > h1 + form > table th:nth-child(3),
main > h1 + form > table td:nth-child(3) {
  width: 15%;
}

main > h1 + form > table th:nth-child(4),
main > h1 + form > table td:nth-child(4) {
  width: 22%;
}

main > h1 + form > table td:nth-child(2),
main > h1 + form > table td:nth-child(4) {
  white-space: nowrap;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

main > h1 + form > table input[type="number"] {
  width: 82px !important;
  min-width: 72px;
  height: 44px;
  margin: 0;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #101828;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}

main > h1 + form > table input[type="number"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 92, 211, .12);
}

/* Cart total panel */
main > h1 + form > .card {
  width: 100%;
  margin-top: 18px !important;
  padding: 26px;
  border: 1px solid #e3e8f1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(16, 24, 40, .07);
}

main > h1 + form > .card h3 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

main > h1 + form > .card .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

main > h1 + form > .card .actions .btn {
  min-height: 46px;
  padding: 13px 20px;
  border-radius: 11px;
}

/* Empty cart */
main:has(> h1 + .card) > .card {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 28px;
  text-align: center;
  border-radius: 20px;
}

main:has(> h1 + .card) > .card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Newsletter responsive safety ---------- */
.newsletter .shell {
  gap: 24px;
}

.newsletter .shell > * {
  min-width: 0;
}

.newsletter .btn {
  flex: 0 0 auto;
}

/* ---------- Product cards ---------- */
.product-card,
.category-card,
.promo-card,
.brand-box,
.form-card,
.card {
  max-width: 100%;
}

.product-card {
  isolation: isolate;
}

.current-price,
.old-price,
.discount {
  white-space: nowrap;
}

/* ---------- Tablet ---------- */
@media (max-width: 1050px) {
  .header-main {
    gap: 16px;
  }

  .header-actions {
    gap: 12px;
  }

  main > h1 + form > table th,
  main > h1 + form > table td {
    padding-inline: 16px;
  }
}

@media (max-width: 780px) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    width: min(100% - 24px, 1280px);
  }

  .header-main {
    height: 70px;
    gap: 10px;
  }

  .hamburger {
    flex: 0 0 auto;
  }

  .logo {
    min-width: 0;
    gap: 9px;
  }

  .logo strong {
    font-size: 20px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 8px;
  }

  .cart-pill {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  /* Mobile cart changes from a wide table to clean product cards */
  main:has(> h1 + form > table),
  main:has(> h1 + .card) {
    padding: 24px 0 48px;
  }

  main:has(> h1 + form > table) > h1,
  main:has(> h1 + .card) > h1,
  main:has(> h1 + form > table) > form,
  main > h1 + form,
  main > h1 + .card {
    width: min(100% - 24px, 1280px);
  }

  main:has(> h1 + form > table) > h1,
  main:has(> h1 + .card) > h1 {
    margin-bottom: 18px;
    font-size: 32px;
  }

  main > h1 + form > table {
    display: block;
    width: 100%;
    table-layout: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  main > h1 + form > table thead {
    display: none;
  }

  main > h1 + form > table tbody {
    display: grid;
    width: 100%;
    gap: 14px;
  }

  main > h1 + form > table tr {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 13px 16px;
    padding: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3e8f1;
    border-radius: 17px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .06);
  }

  main > h1 + form > table td {
    display: block;
    width: auto !important;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent !important;
    white-space: normal;
  }

  main > h1 + form > table td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 13px;
    border-bottom: 1px solid #edf0f5;
    color: var(--navy);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.4;
  }

  main > h1 + form > table td:nth-child(2) {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    font-size: 15px;
  }

  main > h1 + form > table td:nth-child(2)::before {
    content: "Price";
    color: #667085;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  main > h1 + form > table td:nth-child(3) {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  main > h1 + form > table td:nth-child(3)::before {
    content: "Qty";
    color: #667085;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  main > h1 + form > table td:nth-child(4) {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 13px;
    border-top: 1px solid #edf0f5;
    color: var(--navy);
    font-size: 17px;
    font-weight: 900;
  }

  main > h1 + form > table td:nth-child(4)::before {
    content: "Total";
    color: #475467;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  main > h1 + form > table input[type="number"] {
    width: 76px !important;
    min-width: 76px;
    height: 42px;
  }

  main > h1 + form > .card {
    margin-top: 14px !important;
    padding: 20px;
    border-radius: 17px;
  }

  main > h1 + form > .card h3 {
    margin-bottom: 16px;
  }

  .newsletter .shell {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .newsletter h2 {
    font-size: clamp(28px, 7vw, 34px);
  }

  .newsletter .btn {
    width: fit-content;
  }

  .footer-grid > * {
    min-width: 0;
  }
}

/* ---------- Small mobile ---------- */
@media (max-width: 520px) {
  .shell {
    width: calc(100% - 20px);
  }

  .header-main {
    gap: 8px;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .logo strong {
    font-size: 19px;
  }

  .cart-pill {
    padding: 10px 11px;
    font-size: 13px;
  }

  .cart-pill b {
    margin-left: 4px;
  }

  main:has(> h1 + form > table) > h1,
  main:has(> h1 + .card) > h1,
  main:has(> h1 + form > table) > form,
  main > h1 + form,
  main > h1 + .card {
    width: calc(100% - 20px);
  }

  main:has(> h1 + form > table) > h1,
  main:has(> h1 + .card) > h1 {
    font-size: 29px;
  }

  main > h1 + form > table tr {
    padding: 16px;
    gap: 12px;
    border-radius: 15px;
  }

  main > h1 + form > table td:first-child {
    font-size: 15px;
  }

  main > h1 + form > .card {
    padding: 18px 16px;
  }

  main > h1 + form > .card .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  main > h1 + form > .card .actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
    font-size: 13px;
  }

  .newsletter {
    padding: 38px 0;
  }

  .newsletter h2 {
    line-height: 1.18;
  }

  .newsletter .btn {
    width: 100%;
  }
}

/* ---------- Extra-small phones ---------- */
@media (max-width: 390px) {
  .header-main {
    gap: 6px;
  }

  .logo {
    gap: 7px;
  }

  .logo-mark {
    width: 39px;
    height: 39px;
  }

  .logo strong {
    font-size: 17px;
  }

  .cart-pill {
    min-height: 39px;
    padding: 8px 9px;
    font-size: 12px;
  }

  main:has(> h1 + form > table) > h1,
  main:has(> h1 + .card) > h1 {
    font-size: 27px;
  }

  main > h1 + form > table tr {
    grid-template-columns: 1fr auto;
    padding: 14px;
  }

  main > h1 + form > table td:nth-child(4) {
    font-size: 16px;
  }

  main > h1 + form > .card .actions {
    grid-template-columns: 1fr;
  }
}

/* ---------- Landscape phone ---------- */
@media (max-width: 900px) and (orientation: landscape) {
  .mobile-drawer {
    overflow-y: auto;
  }

  .hero {
    min-height: 430px;
  }

  .hero-content {
    padding: 54px 0;
  }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .announcement,
  .site-header,
  .mobile-bottom,
  .site-footer,
  .newsletter,
  .hamburger,
  .drawer-overlay,
  .mobile-drawer {
    display: none !important;
  }

  body,
  main {
    background: #fff !important;
  }

  main:has(> h1 + form > table) {
    padding: 0;
  }

  main > h1 + form > table,
  main > h1 + form > .card {
    box-shadow: none;
  }
}

/* ==========================================================================
   SHOP PAGE PREMIUM RESPONSIVE FIX
   Paste this entire block at the END of your main CSS file.
   ========================================================================== */

.shop-shell {
    align-items: start;
}

.shop-main {
    width: 100%;
    min-width: 0;
}

/* ---------- Toolbar ---------- */

.shop-toolbar {
    gap: 18px;
}

.shop-results {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.result-count {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.result-count span {
    color: var(--muted);
    font-size: 13px;
}

.sort-tabs {
    justify-content: flex-end;
}

.sort-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 8px;
    line-height: 1.2;
    transition: background-color .2s ease, color .2s ease;
}

.sort-tabs a:hover {
    background: #eef3fb;
    color: var(--blue);
}

.sort-tabs a.active {
    background: var(--sky);
    color: var(--blue);
}

/* ---------- Filter panel ---------- */

.filter-head h3 {
    margin: 0;
}

.filter-close {
    display: none;
}

.filter-submit,
.filter-clear {
    width: 100%;
}

.filter-clear {
    margin-top: 8px;
}

.shop-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 105;
    visibility: hidden;
    background: rgba(8, 17, 38, .58);
    opacity: 0;
    transition: opacity .25s ease, visibility .25s ease;
}

.shop-filter-overlay.show {
    visibility: visible;
    opacity: 1;
}

/* ---------- Product cards ---------- */

.shop-main .products-grid {
    align-items: stretch;
}

.product-card {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.product-media {
    position: relative;
    width: 100%;
    height: 230px;
    min-height: 230px;
    overflow: hidden;
    padding: 14px;
}

.product-image-link {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
}

.product-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-info {
    display: flex;
    min-width: 0;
    height: 100%;
    flex: 1;
    flex-direction: column;
}

.product-brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-title-link {
    display: block;
    min-width: 0;
}

.product-title {
    display: -webkit-box;
    height: auto;
    min-height: 42px;
    margin: 7px 0;
    overflow: hidden;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-rating-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
}

.prices {
    min-width: 0;
    flex-wrap: wrap;
}

.current-price {
    font-size: clamp(18px, 1.7vw, 20px);
}

.product-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 9px;
}

.stock-unavailable {
    color: #b42318;
    font-weight: 800;
}

.card-actions {
    margin-top: auto;
    padding-top: 12px;
}

.card-actions .btn {
    width: 100%;
    min-width: 0;
}

.btn-disabled {
    background: #f2f4f7;
    color: #98a2b3;
    cursor: not-allowed;
}

.empty-products {
    text-align: center;
}

.empty-products h2 {
    margin-top: 0;
}

/* ---------- Tablet ---------- */

@media (max-width: 1050px) {
    .shop-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sort-tabs {
        width: 100%;
        justify-content: flex-start;
    }

    .product-media {
        height: 220px;
        min-height: 220px;
    }
}

/* ---------- Mobile ---------- */

@media (max-width: 780px) {
    .shop-shell {
        width: min(100% - 24px, 1280px);
        padding-top: 22px;
        padding-bottom: 42px;
    }

    .shop-toolbar {
        margin-bottom: 16px;
        padding: 14px;
        gap: 12px;
        border-radius: 16px;
    }

    .shop-results {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
    }

    .result-count {
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        white-space: normal;
        text-align: right;
    }

    .filter-toggle {
        flex: 0 0 auto;
    }

    .sort-tabs {
        display: flex;
        width: 100%;
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 3px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .sort-tabs a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 12px;
    }

    .filter-panel {
        width: min(340px, 88vw);
        left: calc(-1 * min(340px, 88vw) - 20px);
        z-index: 110;
        padding: 22px;
        border: 0;
        border-radius: 0 18px 18px 0;
        box-shadow: 20px 0 60px rgba(8, 17, 38, .18);
    }

    .filter-panel.open {
        left: 0;
    }

    .filter-close {
        display: inline-grid;
        width: 40px;
        height: 40px;
        place-items: center;
        border-radius: 10px;
        background: #eef3fb;
        color: var(--navy);
        font-size: 28px;
        line-height: 1;
    }

    .shop-main .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-media {
        height: 190px;
        min-height: 190px;
        padding: 10px;
    }

    .product-info {
        padding: 13px;
    }

    .product-title {
        min-height: 39px;
        font-size: 13px;
    }

    .product-benefits {
        min-height: 38px;
    }

    .card-actions {
        grid-template-columns: 1fr;
    }

    .card-actions .btn {
        min-height: 39px;
        padding: 10px 8px;
        font-size: 11px;
    }
}

/* ---------- Small mobile ---------- */

@media (max-width: 520px) {
    .shop-shell {
        width: calc(100% - 20px);
    }

    .shop-toolbar {
        padding: 12px;
    }

    .shop-results {
        align-items: flex-start;
    }

    .result-count {
        display: block;
        padding-top: 7px;
        font-size: 14px;
    }

    .result-count span {
        display: block;
        margin-top: 2px;
    }

    .shop-main .products-grid {
        gap: 10px;
    }

    .product-card {
        border-radius: 15px;
    }

    .product-media {
        height: 180px;
        min-height: 180px;
        padding: 8px;
    }

    .sale-tag {
        top: 9px;
        left: 9px;
        padding: 5px 7px;
        font-size: 10px;
    }

    .wishlist {
        top: 9px;
        right: 9px;
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .product-info {
        padding: 11px;
    }

    .product-brand {
        font-size: 10px;
    }

    .product-title {
        min-height: 37px;
        margin: 6px 0;
        font-size: 12.5px;
    }

    .rating {
        padding: 3px 5px;
        font-size: 10px;
    }

    .review-count {
        font-size: 10px;
    }

    .prices {
        gap: 5px;
        margin: 9px 0 5px;
    }

    .current-price {
        font-size: 17px;
    }

    .old-price {
        font-size: 11px;
    }

    .product-benefits {
        min-height: 36px;
        font-size: 10.5px;
        line-height: 1.55;
    }
}

/* ---------- Very narrow phones ---------- */

@media (max-width: 390px) {
    .shop-main .products-grid {
        grid-template-columns: 1fr;
    }

    .product-media {
        height: 245px;
        min-height: 245px;
    }

    .product-info {
        padding: 15px;
    }

    .product-title {
        min-height: auto;
        font-size: 14px;
    }

    .product-benefits {
        min-height: auto;
    }

    .card-actions {
        grid-template-columns: 1fr 1fr;
    }
}


/* ==========================================================================
   V7.2 — ANDROID-STYLE HORIZONTAL SORT SCROLL
   Smooth finger swipe, hidden scrollbar, snap alignment and premium pills.
   ========================================================================== */

@media (max-width: 780px) {

    /*
     * Keep the complete toolbar inside the viewport.
     */
    .shop-toolbar {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /*
     * Android-like horizontal scrolling:
     * - finger momentum
     * - no visible desktop scrollbar
     * - horizontal gesture only
     * - gentle snap between options
     */
    .sort-tabs {
        position: relative;
        display: flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 7px;
        margin: 0;
        padding: 2px 3px 5px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;

        scroll-behavior: smooth;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 3px;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: none;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;

        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    /*
     * Hide the large grey scrollbar visible in desktop mobile preview.
     */
    .sort-tabs::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        background: transparent;
    }

    .sort-tabs::-webkit-scrollbar-track,
    .sort-tabs::-webkit-scrollbar-thumb {
        display: none;
        background: transparent;
    }

    /*
     * Each sort option behaves like an Android filter chip.
     */
    .sort-tabs a {
        display: inline-flex;
        flex: 0 0 auto;
        min-height: 38px;
        align-items: center;
        justify-content: center;
        padding: 9px 12px;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
        color: #475467;
        font-size: 12px;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;

        scroll-snap-align: start;
        scroll-snap-stop: normal;
        user-select: none;
        -webkit-user-select: none;
    }

    .sort-tabs a:hover {
        background: #f2f5fa;
        color: var(--blue);
    }

    .sort-tabs a.active {
        border-color: #cfe0ff;
        background: var(--sky);
        color: var(--blue);
        box-shadow: 0 4px 12px rgba(23, 92, 211, .10);
    }

    .sort-tabs a:active {
        transform: scale(.97);
    }
}

/*
 * On real touch devices, remove hover sticking after a tap.
 */
@media (max-width: 780px) and (hover: none) {
    .sort-tabs a:hover {
        background: transparent;
        color: #475467;
    }

    .sort-tabs a.active:hover {
        border-color: #cfe0ff;
        background: var(--sky);
        color: var(--blue);
    }
}

/*
 * Extra-small phones: compact Android-style chips.
 */
@media (max-width: 390px) {
    .sort-tabs {
        gap: 6px;
        padding-bottom: 4px;
    }

    .sort-tabs a {
        min-height: 36px;
        padding: 8px 11px;
        font-size: 11.5px;
    }
}


/* ==========================================================================
   V8.0 — COMPLETE CUSTOMER/ADMIN DASHBOARD RESPONSIVE FIX
   Fixes clipped headings, oversized sidebar, visible horizontal scrollbars,
   statistics alignment and recent-orders tables on mobile screens.
   ========================================================================== */

/* ---------- Dashboard desktop foundation ---------- */

.dashboard {
    width: min(1280px, calc(100% - 32px));
    max-width: 1280px;
    margin-inline: auto;
    align-items: start;
}

.dashboard > section,
.dashboard > main,
.dashboard > .dashboard-content {
    width: 100%;
    min-width: 0;
}

.dashboard > section > h1,
.dashboard > main > h1,
.dashboard > .dashboard-content > h1 {
    margin: 0 0 22px;
    color: var(--navy);
    font-family: 'Playfair Display', serif;
    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.16;
    overflow-wrap: anywhere;
}

/* Sidebar links stay contained */
.dashboard .sidebar {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.dashboard .sidebar a {
    transition: background-color .2s ease, transform .2s ease;
}

.dashboard .sidebar a:active {
    transform: scale(.98);
}

/* Statistics cards */
.dashboard .stats {
    width: 100%;
    min-width: 0;
}

.dashboard .stat {
    min-width: 0;
    overflow: hidden;
}

.dashboard .stat b {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

/* Dashboard table desktop safety */
.dashboard .table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard .table-wrap table {
    width: 100%;
    min-width: 680px;
}

/* ---------- Tablet dashboard ---------- */

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 18px;
    }

    .dashboard .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Mobile dashboard ---------- */

@media (max-width: 780px) {

    /*
     * The entire dashboard is now kept inside the mobile viewport.
     */
    .dashboard {
        display: block;
        width: min(100% - 24px, 1280px);
        max-width: 100%;
        margin-inline: auto;
        padding: 22px 0 92px;
    }

    /*
     * Android-style horizontal account navigation.
     * Finger swipe works, but the grey scrollbar stays hidden.
     */
    .dashboard .sidebar {
        position: static;
        display: flex;
        width: 100%;
        max-width: 100%;
        height: auto;
        align-items: center;
        gap: 6px;
        margin: 0 0 24px;
        padding: 11px;
        overflow-x: auto;
        overflow-y: hidden;
        border-radius: 17px;
        white-space: nowrap;

        scroll-behavior: smooth;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;

        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dashboard .sidebar::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .dashboard .sidebar::-webkit-scrollbar-track,
    .dashboard .sidebar::-webkit-scrollbar-thumb {
        display: none;
        background: transparent;
    }

    /*
     * User-name blocks and links remain readable without widening the page.
     */
    .dashboard .sidebar > * {
        flex: 0 0 auto;
        min-width: 0;
        scroll-snap-align: start;
    }

    .dashboard .sidebar > h1,
    .dashboard .sidebar > h2,
    .dashboard .sidebar > h3,
    .dashboard .sidebar > h4,
    .dashboard .sidebar > strong,
    .dashboard .sidebar > b,
    .dashboard .sidebar > .user-name,
    .dashboard .sidebar > .profile-name {
        max-width: 125px;
        margin: 0 8px 0 0;
        color: #fff;
        font-size: 16px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .dashboard .sidebar a {
        display: inline-flex;
        min-height: 40px;
        align-items: center;
        justify-content: center;
        padding: 9px 12px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 750;
        white-space: nowrap;
    }

    .dashboard .sidebar a:hover,
    .dashboard .sidebar a.active {
        background: rgba(255, 255, 255, .14);
    }

    /*
     * Main content and heading no longer start outside the viewport.
     */
    .dashboard > section,
    .dashboard > main,
    .dashboard > .dashboard-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .dashboard > section > h1,
    .dashboard > main > h1,
    .dashboard > .dashboard-content > h1 {
        width: 100%;
        max-width: 100%;
        margin: 0 0 20px;
        padding: 0;
        font-size: clamp(29px, 8vw, 36px);
        line-height: 1.12;
        letter-spacing: -.025em;
    }

    /*
     * Two clean cards per row on normal mobile phones.
     */
    .dashboard .stats {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 22px;
    }

    .dashboard .stat {
        min-height: 92px;
        padding: 18px;
        border-radius: 16px;
    }

    .dashboard .stat b {
        font-size: clamp(22px, 6vw, 28px);
    }

    /*
     * Section headings such as Recent Orders.
     */
    .dashboard h2,
    .dashboard h3 {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .dashboard > section > h2,
    .dashboard > main > h2,
    .dashboard > .dashboard-content > h2 {
        margin: 24px 0 14px;
        color: var(--navy);
        font-size: 24px;
        line-height: 1.2;
    }

    /*
     * Recent orders become responsive cards rather than a clipped table.
     */
    .dashboard .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .dashboard .table-wrap table {
        display: block;
        width: 100%;
        min-width: 0;
        border-collapse: separate;
    }

    .dashboard .table-wrap thead {
        display: none;
    }

    .dashboard .table-wrap tbody {
        display: grid;
        width: 100%;
        gap: 12px;
    }

    .dashboard .table-wrap tr {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 16px;
        padding: 17px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(16, 24, 40, .05);
    }

    .dashboard .table-wrap td {
        display: flex;
        min-width: 0;
        padding: 0;
        flex-direction: column;
        gap: 5px;
        border: 0;
        background: transparent;
        white-space: normal;
        overflow-wrap: anywhere;
        font-size: 13px;
        line-height: 1.35;
    }

    .dashboard .table-wrap td::before {
        color: #667085;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .dashboard .table-wrap td:nth-child(1)::before {
        content: "Order";
    }

    .dashboard .table-wrap td:nth-child(2)::before {
        content: "Date";
    }

    .dashboard .table-wrap td:nth-child(3)::before {
        content: "Total";
    }

    .dashboard .table-wrap td:nth-child(4)::before {
        content: "Status";
    }

    .dashboard .table-wrap td:nth-child(5)::before {
        content: "Action";
    }

    .dashboard .table-wrap td:nth-child(3) {
        font-weight: 850;
        font-variant-numeric: tabular-nums;
    }

    .dashboard .table-wrap .badge {
        width: fit-content;
        max-width: 100%;
        margin: 0;
    }
}

/* ---------- Small mobile dashboard ---------- */

@media (max-width: 520px) {
    .dashboard {
        width: calc(100% - 20px);
    }

    .dashboard .sidebar {
        margin-bottom: 20px;
        padding: 9px;
        border-radius: 15px;
    }

    .dashboard .sidebar > h1,
    .dashboard .sidebar > h2,
    .dashboard .sidebar > h3,
    .dashboard .sidebar > h4,
    .dashboard .sidebar > strong,
    .dashboard .sidebar > b,
    .dashboard .sidebar > .user-name,
    .dashboard .sidebar > .profile-name {
        max-width: 105px;
        font-size: 15px;
    }

    .dashboard .sidebar a {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .dashboard .stats {
        gap: 10px;
    }

    .dashboard .stat {
        min-height: 88px;
        padding: 16px;
    }

    .dashboard .table-wrap tr {
        gap: 13px;
        padding: 15px;
    }
}

/* ---------- Very narrow mobile dashboard ---------- */

@media (max-width: 390px) {
    .dashboard .stats {
        grid-template-columns: 1fr;
    }

    .dashboard .stat {
        min-height: 82px;
    }

    .dashboard .table-wrap tr {
        grid-template-columns: 1fr;
    }
}

/* ---------- Real touch devices ---------- */

@media (max-width: 780px) and (hover: none) {
    .dashboard .sidebar a:hover {
        background: transparent;
    }

    .dashboard .sidebar a.active:hover {
        background: rgba(255, 255, 255, .14);
    }
}

