/* =========================================================
   JM PRIME SHOP — ecommerce-styles.css (CLEAN v1)
   NOTE: theme.css is loaded via <link> in HTML.
   DO NOT @import theme.css here.
   ========================================================= */

/* ---------- Base ---------- */
*{box-sizing:border-box}
html,body{margin:0;min-height:100vh}
body{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(37,99,235,.25), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(16,185,129,.15), transparent 55%),
    linear-gradient(180deg,var(--bg),var(--bg2));
}
a{color:inherit}
img{max-width:100%;display:block}

/* ---------- Animations ---------- */
@keyframes floatUp{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
@keyframes bounce{0%,100%{transform:none}50%{transform:translateY(-6px)}}
@keyframes shimmer{0%{background-position:-600px 0}100%{background-position:600px 0}}

/* ---------- Shared ---------- */
.section-title{
  font-size:28px;
  font-weight:1000;
  text-align:center;
  margin:0 0 28px;
}

/* ---------- Header Top ---------- */
.header-top{
  background:rgba(0,0,0,.35);
  border-bottom:1px solid var(--border);
}
.header-top-content{
  max-width:1200px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  color:rgba(229,231,235,.85);
  animation:floatUp .6s ease both;
}

/* ---------- Header Main ---------- */
.shop-header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(11,18,32,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
  animation:floatUp .6s ease both;
}
.header-main{
  max-width:1200px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand-logo{height:34px;width:auto;display:block}

/* Nav */
.shop-nav{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  gap:16px;
  position:relative; /* for underline */
}
.shop-nav a{
  text-decoration:none;
  font-weight:900;
  color:rgba(229,231,235,.9);
  opacity:.85;
}
.shop-nav a:hover{opacity:1}

/* Actions */
.header-actions{
  display:flex;
  align-items:center;
  gap:12px;
}
.theme-toggle{
  border:1px solid var(--border);
  background:var(--chip);
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  cursor:pointer;
  line-height:1;
}
.theme-toggle:hover{border-color:rgba(37,99,235,.45)}

/* Search */
.search-box{
  display:flex;
  align-items:center;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  border-radius:999px;
  overflow:hidden;
}
.search-box input{
  width:220px;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  padding:10px 12px;
  font-size:13px;
}
.search-box button{
  border:0;
  cursor:pointer;
  background:var(--brand);
  color:#fff;
  padding:10px 12px;
  font-weight:1000;
}
.search-box button:hover{background:var(--brand2)}

/* Cart */
.cart-icon{
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  font-weight:1000;
  user-select:none;
}
.cart-count{
  min-width:22px;
  height:22px;
  padding:0 8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-size:12px;
  font-weight:1000;
}
.cart-icon.bounce{animation:bounce .4s}

/* ---------- Hero ---------- */
.hero-banner{padding:72px 0}
.hero-content{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
  animation:floatUp .7s ease both;
}
.hero-content h1{
  margin:0 0 10px;
  font-size:44px;
  font-weight:1000;
  letter-spacing:-.5px;
}
.hero-content p{
  margin:0 0 22px;
  color:var(--muted);
  max-width:600px;
}
.hero-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 20px;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  font-weight:1000;
}
.hero-btn:hover{background:var(--brand2)}

/* ---------- Categories ---------- */
.categories-section{padding:54px 0}
.categories-grid{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
}
.category-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  text-align:left;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display:block; /* allow <a> */
}
.category-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow);
  border-color:rgba(37,99,235,.35);
}
.category-card.active{outline:2px solid rgba(37,99,235,.9)}
.category-icon{font-size:26px;margin-bottom:10px}
.category-icon img{width:28px;height:28px;object-fit:cover;border-radius:8px}
.category-card h3{margin:0 0 6px;font-size:16px;font-weight:1000}
.category-card p{margin:0;color:var(--muted);font-size:13px}

.category-skeleton{
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
}

/* ---------- Products ---------- */
.products-section{padding:54px 0 30px}
.products-header{
  max-width:1200px;
  margin:0 auto 16px;
  padding:0 16px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.filter-buttons{display:flex;gap:10px;flex-wrap:wrap}
.filter-btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:1000;
  cursor:pointer;
}
.filter-btn:hover{background:rgba(255,255,255,.10)}
.filter-btn.active{
  background:rgba(37,99,235,.20);
  border-color:rgba(37,99,235,.35);
}

.products-grid{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:18px;
}
.product-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.product-card:hover{
  transform:translateY(-6px);
  box-shadow:var(--shadow);
  border-color:rgba(37,99,235,.35);
}
.product-image{width:100%;height:180px;object-fit:cover}
.product-info{padding:14px}
.product-category{font-size:12px;color:var(--muted);font-weight:900;margin-bottom:6px}
.product-name{margin:0 0 8px;font-size:15px;font-weight:1000}
.product-price{display:flex;align-items:baseline;gap:10px;margin-bottom:12px}
.current-price{font-size:16px;font-weight:1000}
.original-price{font-size:12px;color:var(--muted);text-decoration:line-through}
.add-to-cart{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:0;
  cursor:pointer;
  background:var(--brand);
  color:#fff;
  font-weight:1000;
}
.add-to-cart:hover{background:var(--brand2)}

/* Skeleton */
.skeleton{
  background:linear-gradient(90deg,rgba(255,255,255,.08) 25%,rgba(255,255,255,.18) 37%,rgba(255,255,255,.08) 63%);
  background-size:900px 100%;
  animation:shimmer 1.4s infinite;
  border-radius:var(--radius);
}

/* ---------- Features ---------- */
.features-section{padding:54px 0}
.features-grid{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
}
.feature-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  text-align:left;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card:hover{
  transform:translateY(-6px);
  box-shadow:var(--shadow);
  border-color:rgba(16,185,129,.35);
}
.feature-icon{font-size:26px;margin-bottom:10px}
.feature-card h3{margin:0 0 6px;font-size:16px;font-weight:1000}
.feature-card p{margin:0;color:var(--muted);font-size:13px}

/* ---------- Newsletter ---------- */
.newsletter-section{padding:54px 0}
.newsletter-content{
  max-width:1200px;
  margin:0 auto;
  padding:22px 16px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.newsletter-content h2{margin:0 0 8px;font-size:22px;font-weight:1000}
.newsletter-content p{margin:0 0 16px;color:var(--muted)}
.newsletter-form{display:flex;gap:10px;flex-wrap:wrap}
.newsletter-input{
  flex:1;
  min-width:220px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:0;
}
.newsletter-btn{
  padding:12px 16px;
  border-radius:14px;
  border:0;
  cursor:pointer;
  background:var(--brand);
  color:#fff;
  font-weight:1000;
}
.newsletter-btn:hover{background:var(--brand2)}

/* =========================================================
   FOOTER (FINAL) — Dark glass cards + TRUE EDGE-TO-EDGE
   This replaces ALL previous footer “fix” blocks.
   ========================================================= */
.shop-footer{
  margin-top:40px;
  border-top:1px solid rgba(255,255,255,.10);
  background:#0b1220;

  /* true edge-to-edge (even inside centered layouts) */
  width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
}

/* full-width grid area */
.shop-footer .footer-grid{
  width:100%;
  max-width:none;
  margin:0;
  padding:22px 0; /* vertical only */
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:14px;
}

/* footer cards */
.shop-footer .footer-column{
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 18px 40px rgba(0,0,0,.22);
  border-radius:18px;
  padding:18px;
}

/* footer text */
.shop-footer .footer-column *{color:rgba(255,255,255,.82)}
.shop-footer .footer-column h3,
.shop-footer .footer-column h4{color:#fff;margin:0 0 10px;font-weight:1000}

.shop-footer .footer-about p{margin:0;font-size:13px;line-height:1.5}
.shop-footer .footer-links ul{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.shop-footer .footer-links a{text-decoration:none;font-weight:800}
.shop-footer .footer-links a:hover{color:#fff;text-decoration:underline}

/* bottom bar */
.shop-footer .footer-bottom{
  width:100%;
  margin:0;
  padding:16px 0;
  border-top:1px solid rgba(255,255,255,.14);
  text-align:center;
  font-size:12px;
  color:rgba(255,255,255,.75);
}

/* ---------- Responsive ---------- */
@media(max-width:1100px){
  .products-grid{grid-template-columns:repeat(3, minmax(0,1fr))}
  .categories-grid{grid-template-columns:repeat(3, minmax(0,1fr))}
  .features-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
  .shop-footer .footer-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
}
@media(max-width:900px){
  .header-main{flex-direction:column;align-items:stretch}
  .shop-nav{justify-content:center;flex-wrap:wrap}
  .header-actions{justify-content:center}
  .search-box input{width:260px}
  .hero-content h1{font-size:34px}
}
@media(max-width:640px){
  .search-box{width:100%}
  .search-box input{width:100%}
  .products-grid{grid-template-columns:1fr}
  .categories-grid{grid-template-columns:1fr}
  .features-grid{grid-template-columns:1fr}
  .shop-footer .footer-grid{grid-template-columns:1fr}
  .products-header{align-items:flex-start}
  .hero-banner{padding:56px 0}
  .shop-footer .footer-column{border-radius:16px;padding:16px}
}
/* ==========================================
   EDGE-TO-EDGE FIX (Desktop mode on mobile)
   ========================================== */

/* When screen is narrow but desktop layout is used */
@media (max-width: 1024px){

  /* Break all centered max-width containers */
  .header-top-content,
  .header-main,
  .hero-content,
  .categories-grid,
  .products-header,
  .products-grid,
  .features-grid,
  .newsletter-content,
  .footer-grid{
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Sections must span full width */
  section,
  footer,
  header{
    width: 100%;
  }
}
/* =========================================================
   Shopify-style Header + Nav underline + Active section
   ========================================================= */

/* Header: default (expanded) */
.shop-header{
  transition: padding .22s ease, box-shadow .22s ease, background .22s ease, backdrop-filter .22s ease;
}

/* Compact state on scroll */
.shop-header.is-compact{
  background: rgba(11,18,32,.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

/* Tighten inner spacing when compact */
.shop-header.is-compact .header-main{
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* Slightly smaller nav pills + search when compact */
.shop-header.is-compact .shop-nav a{
  transform: translateY(-1px);
}
.shop-header.is-compact .search-box input{
  padding-top: 9px;
  padding-bottom: 9px;
}
.shop-header.is-compact .search-box button{
  padding-top: 9px;
  padding-bottom: 9px;
}

/* -------------------------
   NAV underline (elastic-ish)
   Requires <span class="nav-underline"> inside .shop-nav
   ------------------------- */
.shop-nav{ position: relative; }
.shop-nav .nav-underline{
  position:absolute;
  left:0;
  bottom:-10px;
  height:3px;
  width:32px;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(37,99,235,1), rgba(99,102,241,1));
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
  transform: translateX(0) scaleX(1);
  transform-origin: left;
  pointer-events:none;
  opacity: .95;

  /* elastic feel */
  transition:
    transform 520ms cubic-bezier(.18,.9,.2,1.15),
    width 520ms cubic-bezier(.18,.9,.2,1.15),
    opacity .2s ease;
}

/* Active nav pill (Shopify-ish) */
.shop-nav a{
  display:inline-flex;
  align-items:center;
  padding:10px 14px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.shop-nav a:hover{
  background: rgba(255,255,255,.09);
  border-color: rgba(37,99,235,.20);
}
.shop-nav a.is-active{
  background: rgba(37,99,235,.18);
  border-color: rgba(37,99,235,.35);
}

/* Keep underline closer on mobile where nav wraps */
@media (max-width: 900px){
  .shop-nav .nav-underline{
    bottom: -8px;
  }
}

/* =========================================================
   Grid density optimization for large phones (and tablets)
   ========================================================= */

/* Categories: 2 columns on large phones */
@media (max-width: 860px){
  .categories-grid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* Products: 2 columns on large phones */
@media (max-width: 860px){
  .products-grid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* Features: 2 columns on large phones */
@media (max-width: 860px){
  .features-grid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* Small phones: 1 column */
@media (max-width: 520px){
  .categories-grid,
  .products-grid,
  .features-grid{ grid-template-columns: 1fr !important; }
}

/* Slightly tighter card padding on phones */
@media (max-width: 860px){
  .category-card,
  .feature-card{ padding: 16px !important; }
}
/* =========================================================
   NAV ACTIVE PILL (smooth fill) — Shopify-like
   Requires: .shop-nav a.is-active applied by JS
   ========================================================= */

.shop-nav a{
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

/* The animated fill layer */
.shop-nav a::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(37,99,235,.22), rgba(37,99,235,.10));
  opacity:0;
  transform: scale(.92);
  transition:
    opacity 260ms ease,
    transform 520ms cubic-bezier(.18,.9,.2,1.15);
  z-index:-1; /* sits behind text */
}

/* Active state = filled pill */
.shop-nav a.is-active::before{
  opacity:1;
  transform: scale(1);
}

/* Slight micro-pop on active */
.shop-nav a.is-active{
  border-color: rgba(37,99,235,.45) !important;
  background: rgba(255,255,255,.07); /* keep subtle glass */
}

/* Optional: hover gets a gentle lift without fighting active */
.shop-nav a:hover{
  transform: translateY(-1px);
}
.shop-nav a.is-active:hover{
  transform: translateY(-1px);
}
