:root{
  /* Palette */
  --accent:#69cec4;
  --accent-2:#57b8a9;
  --bg-grad:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  --glass: rgba(255,255,255,0.08);
  --text:#111;
  --muted:#5f6b7a;
  --soft:#1f2937;
  --max:1200px;
  --radius:16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*{box-sizing:border-box}
html,body{
    height:100%;
    margin:0;
    font-family:Inter, Roboto, system-ui, -apple-system, "Segoe UI", Arial;
    color:var(--text);
    background:#f7f9ff;
    /* Prevent horizontal page wobble */
    overflow-x: hidden; 
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* Layout */
.page-wrapper{display:flex;flex-direction:column;min-height:100vh}
main{
  max-width: 100%;      
  margin: 28px auto;   
  padding: 20px;       
  width: 100%;
  min-height: 60vh; 
  /* Ensure main content doesn't cause scroll issues */
  overflow-x: clip; 
}
.container {
  max-width: var(--max);  
  margin: 0 auto;
  padding: 0 20px; /* Consistent container padding */
  width: 100%;
}

/* Header */
header{position:sticky;top:0;left:0;right:0;background:var(--bg-grad);color:#fff;z-index:1000;box-shadow:0 6px 20px rgba(0,0,0,.12); transition: height 0.3s;}
.header-content{max-width:var(--max);margin:0 auto;padding:14px 24px;display:flex;align-items:center;gap:16px;justify-content:space-between}
.header-left{display:flex;align-items:center;gap:14px}
.logo{display:flex;align-items:center;gap:12px;cursor:pointer}
.brand-logo{height: clamp(32px, 5vw, 56px); width:auto; object-fit:contain}
.logo h1{margin:0;font-size:22px;font-weight:800;background:linear-gradient(45deg,#fff,#e0e0e0);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.tagline{font-size:12px;color:rgba(255,255,255,.85)}

.hamburger-btn{width:46px;height:40px;border-radius:8px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;cursor:pointer; flex-shrink: 0;}
.hamburger-btn span{display:block;height:3px;width:22px;background:#fff;border-radius:2px;transition:transform .25s,opacity .25s}
.hamburger-btn.active span:nth-child(1){transform:rotate(45deg) translate(4px,4px)}
.hamburger-btn.active span:nth-child(2){opacity:0;transform:translateX(-8px)}
.hamburger-btn.active span:nth-child(3){transform:rotate(-45deg) translate(4px,-4px)}

/* Search */
.search-container{flex:1;max-width:620px;position:relative}
.search-bar{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.12);border-radius:999px;padding:8px 12px;border:1px solid rgba(255,255,255,.08)}
#searchInput{flex:1; min-width: 0; background:transparent;border:none;color:#fff;font-size:15px;outline:none}
#searchInput::placeholder{color:rgba(255,255,255,.9)}
.clear-btn{background:none;border:none;color:rgba(255,255,255,.9);font-size:18px;cursor:pointer;display:none}
.clear-btn.show{display:inline}
.search-btn{background:#fff;border:none;border-radius:999px;padding:8px 14px;font-weight:800;color:#07353a;cursor:pointer; flex-shrink: 0;}
.search-suggestions{position:absolute;top:100%;left:0;right:0;background:#fff;color:#111;border:1px solid #e6e6e6;border-top:none;border-radius:0 0 12px 12px;box-shadow:0 12px 28px rgba(0,0,0,.12);display:none;max-height:240px;overflow:auto;z-index:1001}
.search-suggestions.show{display:block}
.search-suggestions .sug{padding:10px 12px;cursor:pointer;border-bottom:1px solid #f2f2f2;color:#111}
.search-suggestions .sug:last-child{border-bottom:none}
.search-suggestions .sug:hover{background:#eef3ff}

/* Header actions */
.header-right{display:flex;align-items:center;gap:10px}
.cart-badge{margin-left:6px;background:#083f3c;color:#bff5ec;border-radius:999px;padding:2px 8px;display:inline-block;min-width:24px;text-align:center}
.pill{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.12);padding:8px 14px;border-radius:22px;color:#fff;cursor:pointer; white-space: nowrap;}
.pill.primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#06343a;font-weight:800;border:none}

/* === LOGIN POPUP === */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); 
  display: none; 
  justify-content: center; 
  align-items: center;
  z-index: 2000; 
  backdrop-filter: blur(3px);
}
.popup-box {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px; 
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  position: relative;
  margin: 20px; 
  animation: popupUp 0.3s ease-out;
}
@keyframes popupUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.popup-box h2 { margin: 0 0 10px 0; color: var(--text); }
.popup-box h3 { margin-top: 15px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.popup-box input {
  width: 100%; padding: 12px;
  margin: 6px 0;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 16px; 
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.btn.danger { background: #dc3545; color: #fff; }
.close-btn {
  position: absolute; top: 15px; right: 15px;
  border: none; background: none;
  font-size: 24px; cursor: pointer; color: #999;
}


/* Side Nav */
.side-nav{position:fixed;left:-320px;top:0;width:300px;height:100%;background:#101423;color:#fff;z-index:1002;transition:left .35s ease-in-out;display:flex;flex-direction:column;border-right:1px solid rgba(255,255,255,.06)}
.side-nav.show{left:0}
.side-nav-header{padding:18px;border-bottom:1px solid rgba(255,255,255,.06);display:flex;align-items:center;justify-content:space-between}
.side-brand{display:flex;align-items:center;gap:10px}
.side-brand img{width:34px;height:34px;border-radius:8px}
.side-nav-content{padding:10px 0;overflow:auto;flex:1;-webkit-overflow-scrolling:touch}
.nav-item{display:block;padding:12px 18px;color:rgba(255,255,255,.9);text-decoration:none;border-radius:10px;margin:6px 10px;font-weight:600}
.nav-item:hover{background:rgba(105,206,196,.08);color:var(--accent)}
.nav-item.active{background:rgba(105,206,196,.12);color:var(--accent)}
.side-nav-footer{padding:12px;border-top:1px solid rgba(255,255,255,.06);display:flex;flex-direction:column;gap:8px}
.nav-item.contact{background:#0f172a;border:1px solid rgba(255,255,255,.06)}

.overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(6px);z-index:1001;display:none}
.overlay.show{display:block}

/* Buttons */
.actions{display:flex;align-items:center;gap:10px}
.btn{padding:10px 14px;border-radius:10px;border:none;cursor:pointer;font-weight:700}
.btn.primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#06343a}
.btn.ghost{background:#fff;border:1px solid #e5e7eb}

/* Progress & loader */
.progress{position:fixed;top:0;left:0;height:3px;background:linear-gradient(90deg,var(--accent),var(--accent-2));width:0;z-index:1100}

.loader-spot{
    position:fixed;
    right:20px;
    bottom:30px;
    background:rgba(0,0,0,0.85);
    color:#fff;
    padding:12px 16px;
    border-radius:999px;
    display:none;
    align-items:center;
    gap:10px;
    border:1px solid rgba(255,255,255,0.1);
    box-shadow:0 12px 30px rgba(0,0,0,0.3);
    z-index: 3000;
}
.loader-spot.show { display: flex; }
.spinner{width:24px;height:24px;border-radius:50%;border:3px solid rgba(255,255,255,0.3);border-top-color:#fff;animation:spin 1s linear infinite}
.loader-text{font-size:14px; font-weight: 500;}
@keyframes spin{to{transform:rotate(360deg)}}

/* Titles */
.section-title{font-size:28px;text-align:center;margin:8px 0;background:linear-gradient(135deg,#667eea,#764ba2);-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:800}
.section-subtitle{text-align:center;color:var(--muted);margin-bottom:18px}

/* === FILTERS / CHIPS (Shared) === */
.filters > * {
  flex-shrink: 1;
}
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;       
  gap: 12px;
  margin-bottom: 18px;
  position: sticky;
  top: 74px; 
  background: #f7f9ff; 
  padding: 10px 0;
  z-index: 900; 
  transition: all 0.3s ease;
}

.chip {
  min-width: 100px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f5f7ff;
  border: 1px solid #e3e9ff;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .2s, box-shadow .2s, transform .15s;
  user-select: none;
  text-transform: capitalize;
  box-shadow: 0 2px 8px rgba(102,126,234,0.08);
  outline: none;
  white-space: nowrap; 
}

.chip:hover {
  background: #eef2ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.16);
}

.chip.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

/* Toolbar (sort) */
.toolbar{  display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    flex: 1 1 auto;   
    min-width: 200px; 
    position: relative;
    z-index: 2;
    align-content: space-between;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    }
.sort-wrap select{padding:8px 10px;border-radius:10px;border:1px solid #e6e6e6;background:#fff}


/* Grid & Cards - Default Desktop */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  min-height: 200px; 
}
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  width: 100%;
  min-width: 0;
  position: relative; 
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.10);
}
.product-media{width:160px;min-width:160px;height:160px;border-radius:12px;background:#f7f9ff;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid #f0f0f0}
.product-media img{width:100%;height:100%;object-fit:contain}
.product-body{flex:1;min-width:0}
.product-title{margin:0 0 4px 0;font-size:18px;font-weight:800;color:#111;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.product-desc{margin:0;color:#5f6b7a;max-height:44px;overflow:hidden}
.specs{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.spec{background:#f4f6fb;border:1px solid #e7ebf6;border-radius:999px;padding:6px 10px;font-size:12px;color:#394150}
.product-actions{display:flex;flex-direction:column;gap:10px;align-items:flex-end}
.price{font-weight:900;color:#0b3b39;font-size:20px}
.result-meta{margin:6px 0 12px;color:var(--muted)}


/* Checkout */
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-bottom:12px}
.form-grid .full{grid-column:1/-1}
.form-grid label{display:block;font-weight:600}
.form-grid input,.form-grid textarea,.form-grid select{width:100%;padding:10px;border-radius:8px;border:1px solid #e6e6e6;background:#fff}
.summary-card{background:#fff;border:1px solid #eee;border-radius:12px;padding:12px}
.summary-head{display:flex;align-items:center;justify-content:space-between}
.summary-items{margin-top:8px;color:var(--muted)}
.summary-actions{margin-top:12px;display:flex;gap:8px}

/*account page*/
.account-page {
  width: 100%;
  max-width: 430px;
  margin: 2rem auto;
  padding: 1rem;
}
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.info-card h3 { margin-top: 0; }
.info-card label { display: block; margin: 0.5rem 0; }
.info-card input,
.info-card textarea {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.3rem;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.info-card button { margin-top: 1rem; }

/* cart page style */
.cart-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin: 0.5rem 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s forwards;
}
.cart-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-info h4 { margin: 0; font-size: 1.1rem; }
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

 .account-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 20px;
      padding: 2rem;
      max-width: 1200px;
      margin: auto;
    }
    .card {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.08);
      padding: 2rem 1.5rem;
      text-align: center;
      transition: transform 0.2s, box-shadow 0.2s;
      cursor: pointer;
    }
    .card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 18px rgba(0,0,0,0.12);
    }
    .card-icon { font-size: 2.2rem; margin-bottom: 1rem; color: #111; }
    .card h3 { margin-bottom: 0.6rem; font-size: 1.2rem; color: #222; }
    .card p { font-size: 0.95rem; color: #666; min-height: 40px; }
    .card a {
      display: inline-block;
      margin-top: 1rem;
      padding: 8px 16px;
      background: #111;
      color: #fff;
      border-radius: 6px;
      text-decoration: none;
      font-size: 0.9rem;
    }
    .card a:hover { background: #333; }

/* Modal */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:60;background:rgba(12,18,30,0.28);backdrop-filter:blur(4px)}
.modal.show{display:flex}
.modal .sheet{width:460px;max-width:92%;background:#ffffff;border-radius:16px;padding:20px;border:1px solid #f1f1f3;box-shadow:0 24px 50px rgba(2,6,23,0.24);transform:translateY(10px);opacity:0;transition:all .28s;position:relative}
.modal.show .sheet{transform:none;opacity:1}
.close-x{position:absolute;right:10px;top:10px;width:34px;height:34px;border-radius:8px;border:1px solid #eaeaea;background:#f8f9fb;display:flex;align-items:center;justify-content:center;font-size:20px;cursor:pointer}
.close-x:focus{outline:2px solid var(--accent)}
.modal-title{margin:6px 0 4px 0}
.modal-sub{margin:0 0 8px 0;color:var(--muted)}
.tabs{display:flex;gap:6px;margin-bottom:12px}
.tab{flex:1;padding:10px;border-radius:8px;text-align:center;background:#f6f7fb;cursor:pointer;border:1px solid #eef0f6}
.tab.active{background:linear-gradient(90deg,var(--accent),var(--accent-2));color:#fff;font-weight:800;border:none}
.form-row{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
input,select{padding:10px;border-radius:8px;border:1px solid #e2e6ee;background:#fff;color:#111;outline:none}
.modal input,.modal textarea,.modal select{background:#f9f9fb;color:#111;border:1px solid #d1d5db}
.modal input::placeholder,.modal textarea::placeholder{color:#888}
.modal input:focus,.modal textarea:focus,.modal select:focus{border-color:var(--accent);background:#fff;outline:none}

/* Product modal */
.pm-sheet{width:min(980px,96%);padding:18px;position:relative}
.pm-close{position:absolute;right:10px;top:10px;width:34px;height:34px;border-radius:8px;border:1px solid #eaeaea;background:#f8f9fb;font-size:20px;cursor:pointer}
.pm-max{position:absolute;left:10px;top:10px;width:34px;height:34px;border-radius:8px;border:1px solid #eaeaea;background:#f8f9fb;font-size:16px;cursor:pointer}
.pm-content{display:grid;grid-template-columns:1.1fr 1fr;gap:16px}
.pm-image{background:#f5f7ff;border:1px solid #ebefff;border-radius:14px;height:380px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.pm-image img{max-width:100%;max-height:100%;object-fit:contain}
.pm-thumbs{display:flex;gap:8px;margin-top:8px;overflow:auto}
.pm-thumb{width:70px;height:70px;border:1px solid #e6e6e6;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto}
.pm-thumb img{max-width:100%;max-height:100%;object-fit:contain}
.pm-thumb.active{outline:2px solid var(--accent)}
.pm-title{margin:0 0 6px 0}
.pm-price{font-size:22px;font-weight:900;color:#0b3b39;margin-bottom:6px}
.pm-desc{color:#5f6b7a}
.pm-specs{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.pm-specs .spec{background:#f4f6fb;border:1px solid #e7ebf6;border-radius:999px;padding:6px 10px;font-size:12px;color:#394150}
.pm-actions{display:flex;gap:10px;margin-top:8px}

#productModal.full{z-index:1100}
#productModal.full .pm-sheet{width:96%;height:92vh;display:flex;flex-direction:column}
#productModal.full .pm-content{grid-template-columns:1fr 1fr;gap:18px;flex:1}
#productModal.full .pm-image{height:100%}

@media (max-width:840px){
  .pm-content{grid-template-columns:1fr}
  .pm-image{height:320px}
}

@media (max-width: 500px) {
    .modal .sheet { width: 98%; max-width: 98%; height: 96vh; border-radius: 0; margin: 0; }
    .pm-sheet { padding: 10px; height: 100%; display: flex; flex-direction: column; }
    .pm-content { grid-template-columns: 1fr; flex: 1; overflow-y: auto; }
    .pm-image { height: 250px; }
    .pm-actions { flex-direction: column; gap: 8px; }
    .pm-actions .btn { width: 100%; min-width: unset; }
    .pm-close, .pm-max { top: 5px; right: 5px; z-index: 1; }
}


.form-actions{display:flex;gap:8px;align-items:center;justify-content:space-between}
.form-actions.between{justify-content:space-between}
.small{font-size:13px;color:var(--muted)}
.small.err{color:#b40000}

/* Footer */
.site-footer{margin-top:auto;background:#0b1320;color:#c9d1e7}
.footer-inner{max-width:var(--max);margin:0 auto;padding:16px 22px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.footer-left{display:flex;align-items:center;gap:10px}
.footer-logo{width:34px;height:34px;border-radius:8px}
.footer-right{display:flex;gap:10px}
.soc{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;background:#101935;border:1px solid #1c2750}
.soc:hover{transform:translateY(-2px)}
.footer-bottom{text-align:center;padding:10px;border-top:1px solid #1c2750}

/* =========================================== */
/* === MOBILE & RESPONSIVE FIXES === */
/* =========================================== */

@media (max-width:720px){
  .header-content{ padding:12px; gap: 0; align-items: flex-start; flex-wrap: wrap; }
  .header-left { align-items: center; gap: 14px; margin-bottom: 8px; }
  .header-right { margin-left: auto; align-items: center; gap: 10px; margin-bottom: 8px; }
  .logo h1{font-size:18px}
  .search-container{ order:3; width:100%; margin-top:4px; }
  .pill:not(.hamburger-btn) { display: none; }

  /* === ALIGNMENT & CHIPS FIX === */
  .filters {
      /* Positioning below sticky header */
      top: 135px; 
      
      /* Horizontal Scroll Logic */
      justify-content: flex-start; 
      flex-wrap: nowrap; 
      overflow-x: auto; 
      
      /* Visuals & Alignment */
      padding: 12px 20px; /* 20px left padding matches .container padding */
      margin: 0 -20px 20px -20px; /* Bleed to edge */
      width: calc(100% + 40px);
      
      /* Add shadow so products scroll underneath cleanly */
      box-shadow: 0 4px 12px -2px rgba(0,0,0,0.08);
      border-bottom: 1px solid #eff1f5;
      
      /* Hide Scrollbars */
      -ms-overflow-style: none; 
      scrollbar-width: none; 
  }
  .filters::-webkit-scrollbar { display: none; }

  .chip { flex-shrink: 0; margin-right: 8px; }

  /* === PRODUCT LIST ALIGNMENT FIX === */
  .grid {
    grid-template-columns: 1fr; 
    gap: 16px;
    margin-top: 8px; /* Breathing room from filters */
  }

  .product-card{
    flex-direction:column;
    align-items:center; 
    text-align: center; 
    padding: 20px; 
  }
  
  .product-media {
    width: 100%; 
    min-width: unset; 
    height: 220px; 
    max-height: 250px; 
    margin-bottom: 12px; 
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .product-media img { margin: 0 auto; }
  .product-body { width: 100%; }
  
  .product-actions{
    width:100%;
    align-items:stretch;
    flex-direction: row; 
    justify-content: space-between;
    margin-top: 10px;
  }
  .product-actions .btn { flex: 1; }
}