/* =========================
   SUPER WEB — BASE / PC
   ========================= */

:root{
  --bg: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;

  --text: #111827;
  --muted: #4b5563;
  --muted2: #6b7280;

  --brand: #111827;
  --brand2: #000000;

  --shadow: 0 4px 14px rgba(0,0,0,.06);
  --shadow2: 0 10px 25px rgba(0,0,0,.08);

  --radius: 14px;
  --wa: #25D366;

  color-scheme: light;
}

*{
  box-sizing: border-box;
}

html, body{
  width: 100%;
  overflow-x: hidden;
}

/* Fondo */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(244,246,248,.92), rgba(244,246,248,.92)),
    url("/static/bg.jpg");
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.05);
  transform: scale(1.08);
}

body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 10% 0%, rgba(17,24,39,.06), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(37,211,102,.06), transparent 60%);
}

.container{
  max-width: 1200px;
  margin: 22px auto;
  padding: 0 20px;
}

/* =========================
   HEADER PRINCIPAL PC
   ========================= */

.main-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.10);
  transition: transform .22s ease, background .22s ease;
}

.main-header.is-hidden{
  transform: translateY(-100%);
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  position: relative;
  padding-top: 64px;
}

.main-header__inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav--left{
  justify-content: flex-start;
}

.main-nav--right{
  justify-content: flex-end;
}

.main-link{
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background .18s ease, transform .18s ease;
}

.main-link:hover{
  background: rgba(0,0,0,.06);
}

.main-center{
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-brand{
  text-decoration: none;
  color: var(--text);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.main-link--promo{
  background: #f59e0b;
  color: #111 !important;
  padding: 10px 14px;
}

.main-link--promo:hover{
  background: #d97706;
  color: #fff !important;
}

.main-link--cart{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 10px 14px;
}

.main-badge{
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(0,0,0,.18);
}

/* =========================
   TIENDA LAYOUT PC
   ========================= */

.shop-layout{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.panel{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header{
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title{
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

.panel-body{
  padding: 14px;
}

.btn-small{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.btn-small:hover{
  background: #f9fafb;
}

.cat-search{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}

.cats-list{
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
}

.cat-item{
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
}

.cat-item span{
  color: var(--muted);
}

/* =========================
   PRODUCTOS PC
   ========================= */

#productList{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.product-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-card:hover{
  border-color: rgba(0,0,0,.18);
  box-shadow: var(--shadow2);
  transform: translateY(-3px);
}

.img-box{
  flex: 0 0 180px;
  height: 180px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  background: #fff;
}

.img-ph{
  font-size: 13px;
  color: var(--muted2);
}

.card-body{
  flex: 1;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.product-title{
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  color: #1f2937;
  min-height: 34px;
}

.product-family{
  font-size: 12px;
  color: var(--muted);
}

.price-row{
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.product-price{
  font-size: 18px;
  font-weight: 900;
  color: #880000;
}

.btn-add{
  margin-top: auto;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.btn-add:hover{
  background: var(--brand2);
}

.stock-warning{
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #dff7e3;
  color: #166534;
}

/* =========================
   META / BUSQUEDA / PAGINACION
   ========================= */

.meta-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.meta-left{
  color: var(--muted);
  font-weight: 700;
}

.meta-sep{
  margin: 0 8px;
  opacity: .5;
}

.meta-actions{
  display: flex;
  gap: 10px;
}

.meta-chip{
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.meta-chip:hover{
  background: #f9fafb;
}

.meta-search{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  min-width: 280px;
}

.meta-search input[type="search"]{
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

.meta-search button{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.meta-search .btn-clear{
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  color: rgba(0,0,0,.7);
}

.no-results{
  display: none;
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
}

.pagination{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info{
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.pagination-actions{
  display: flex;
  gap: 10px;
}

.page-btn{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.page-btn:hover{
  background: #f9fafb;
}

/* =========================
   FAB + TOAST
   ========================= */

.cart-fab{
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  font-weight: 900;
  display: none;
  text-decoration: none;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  padding: 12px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  background: rgba(0,0,0,.72);
  transition: .18s ease;
}

.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   FORMULARIOS
   ========================= */

label{
  color: #374151;
  font-weight: 700;
}

input,
textarea,
select{
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 12px;
  outline: none;
}

input::placeholder,
textarea::placeholder{
  color: #9ca3af;
}

/* =========================
   BOTONES
   ========================= */

.btn-primary{
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost{
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
}

.btn-ghost:hover{
  background: rgba(0,0,0,.04);
}

.btn-secondary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,.12);
  color: #111;
  background: #fff;
}

.btn-link{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  color: #111;
}

.wa-btn{
  background: var(--wa);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
}

.wa-btn:hover{
  filter: brightness(.95);
}

/* =========================
   HOME PROMOS PC
   ========================= */

.promo-slide{
  display: flex;
  justify-content: center;
}

.promo-card{
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.promo-media{
  background: #f3f4f6;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.promo-media img{
  width: 100%;
  max-width: 100%;
  max-height: 500px;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}

.btn-add-promo{
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: #111;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.btn-add-promo:hover{
  opacity: .9;
}

/* =========================
   AUTH / LOGIN / REGISTRO
   ========================= */

.page-wrap{
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.page-wrap--top{
  align-items: flex-start;
}

.auth-card{
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 35px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.08);
}

.auth-card h1{
  margin: 0 0 8px;
  font-size: 28px;
}

.auth-subtitle{
  margin: 0 0 18px;
  color: #666;
  line-height: 1.5;
}

.auth-form{
  display: grid;
  gap: 12px;
}

.auth-form label{
  font-weight: 600;
  font-size: 14px;
}

.auth-form input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d7d7d7;
  outline: none;
  font-size: 15px;
}

.auth-form input:focus{
  border-color: #222;
}

.auth-error{
  background: #ffe7e7;
  color: #b42318;
  border: 1px solid #f3b3b3;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.auth-links{
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.auth-links a{
  font-weight: 700;
  text-decoration: none;
}

.auth-guest-note{
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

/* =========================
   PERFIL / PEDIDOS
   ========================= */

.profile-shell{
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.profile-card,
.orders-card{
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 35px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.08);
}

.profile-card__header h1,
.orders-card__header h2{
  margin: 0 0 6px;
}

.profile-card__header p{
  margin: 0;
  color: #666;
}

.profile-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-box{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}

.profile-label{
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.profile-value{
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.orders-card__header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.orders-link{
  text-decoration: none;
  font-weight: 700;
}

.orders-list{
  display: grid;
  gap: 14px;
}

.order-item{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 16px;
  background: #fcfcfc;
}

.order-item__top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.order-title{
  font-size: 18px;
  font-weight: 800;
}

.order-date{
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.order-meta{
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.order-address{
  color: #333;
  font-size: 14px;
}

.order-status{
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.order-status--pendiente{
  background: #fff4cc;
  color: #8a6500;
}

.order-status--entregado{
  background: #dff7e3;
  color: #166534;
}

.orders-empty{
  padding: 22px;
  border: 1px dashed rgba(0,0,0,.15);
  border-radius: 14px;
  text-align: center;
}

.orders-empty p{
  margin: 0 0 14px;
  color: #666;
}

/* =========================
   CHECKOUT ACCESS
   ========================= */

.checkout-access{
  margin: 0 0 20px;
}

.checkout-access__box{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}

.checkout-access__box--ok{
  background: #f7fff8;
  border-color: rgba(22, 101, 52, .15);
}

.checkout-access__box h3{
  margin: 0 0 8px;
  font-size: 20px;
}

.checkout-access__box p{
  margin: 0;
  color: #555;
  line-height: 1.5;
}

.checkout-access__actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.checkout-access__note{
  margin-top: 12px !important;
  font-size: 14px;
  color: #666;
}

/* =========================
   CARRITO PC
   ========================= */

.cart-page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px 50px;
}

.cart-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 14px;
}

.cart-title-page{
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.cart-subtitle{
  margin: 6px 0 0;
  opacity: .7;
  font-size: 14px;
}

.cart-layout{
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  align-items: start;
}

.cart-side{
  display: grid;
  gap: 14px;
}

.cart-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.06);
}

.cart-empty{
  padding: 18px;
  border: 1px dashed rgba(0,0,0,.22);
  border-radius: 14px;
  background: rgba(0,0,0,.02);
}

.cart-empty-title{
  font-weight: 900;
  font-size: 16px;
}

.cart-empty-sub{
  margin-top: 6px;
  opacity: .7;
  font-size: 13px;
}

.cart-items{
  display: grid;
  gap: 10px;
}

.cart-item{
  display: grid;
  grid-template-columns: 56px 1fr auto 140px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.015);
}

.cart-thumb{
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
}

.cart-thumb--ph{
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cart-item-name{
  font-weight: 900;
  line-height: 1.15;
}

.cart-item-meta{
  margin-top: 6px;
  font-size: 12.5px;
  opacity: .85;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.cart-item-meta .dot{
  opacity: .4;
}

.cart-item-qty{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
}

.qty-btn{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.qty-btn:hover{
  background: rgba(0,0,0,.04);
}

.qty-num{
  min-width: 26px;
  text-align: center;
  font-weight: 900;
}

.cart-item-sub{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cart-item-subval{
  font-weight: 900;
  text-align: right;
}

.btn-trash{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  cursor: pointer;
}

.btn-trash:hover{
  background: rgba(0,0,0,.04);
}

.cart-summary-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px;
}

.cart-summary-total{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.10);
  font-size: 18px;
  font-weight: 900;
}

.cart-summary-hint{
  margin-top: 10px;
  font-size: 12.5px;
}

.cart-card--form h2{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
}

.form-grid{
  display: grid;
  gap: 12px;
}

.cart-card--form label{
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.cart-card--form input[type="text"],
.cart-card--form textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  outline: none;
}

.cart-card--form input[type="text"]:focus,
.cart-card--form textarea:focus{
  border-color: rgba(0,0,0,.35);
}

.mode-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.radio-pill{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.02);
  cursor: pointer;
  user-select: none;
}

.radio-pill input{
  accent-color: #111;
}

.loc-row{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.loc-row .muted{
  font-size: 13px;
}

.btn-send{
  width: 100%;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
}

/* =========================
   MOBILE DRAWER MEJORADO
   ========================= */

.main-header__inner--drawer{
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.menu-toggle{
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.96);
  border-radius: 14px;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.menu-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

.main-center{
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-brand{
  text-decoration: none;
  color: #111827;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* fondo oscuro al abrir */
.drawer-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.drawer-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* panel lateral */
.side-drawer{
  position: fixed;
  top: 0;
  left: 0;
  width: 86vw;
  max-width: 340px;
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1001;
  padding: 16px 14px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.side-drawer.is-open{
  transform: translateX(0);
}

/* cabecera */
.side-drawer__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.side-drawer__eyebrow{
  font-size: 11px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.side-drawer__title{
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  margin-top: 2px;
}

.side-drawer__close{
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

/* bloque usuario opcional */
.side-drawer__user{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
  border: 1px solid rgba(0,0,0,.06);
}

.side-drawer__avatar{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 900;
  flex-shrink: 0;
}

.side-drawer__user-name{
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.side-drawer__user-mail{
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

/* navegación */
.side-drawer__nav{
  display: grid;
  gap: 10px;
}

.side-drawer__link{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 15px;
  border-radius: 16px;
  text-decoration: none;
  color: #111827;
  font-weight: 800;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 6px 16px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.side-drawer__link:hover{
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

.side-drawer__link-main{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.side-drawer__icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: 15px;
  flex-shrink: 0;
}

.side-drawer__text{
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.side-drawer__arrow{
  font-size: 16px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* links destacados */
.side-drawer__link--highlight{
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  color: #fff;
  border-color: rgba(17,24,39,.9);
  box-shadow: 0 12px 24px rgba(17,24,39,.22);
}

.side-drawer__link--highlight .side-drawer__text,
.side-drawer__link--highlight .side-drawer__arrow{
  color: #fff;
}

.side-drawer__link--highlight .side-drawer__icon{
  background: rgba(255,255,255,.14);
  color: #fff;
}

.side-drawer__link--danger{
  color: #9f1239;
}

.side-drawer__footer{
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

body.drawer-open{
  overflow: hidden;
}

/* =========================================
   MOBILE FIX REAL — tienda + carrito
   ========================================= */
@media (max-width: 768px){

  html, body{
    overflow-x: hidden;
  }

  .container{
    width: 100%;
    max-width: 100%;
    padding: 0 12px;
    margin: 14px auto;
  }

  /* =========================
     HEADER
     ========================= */
  .main-header__inner,
  .main-header__inner--drawer{
    padding: 10px 12px;
  }

  .main-brand{
    font-size: 17px;
    max-width: 100%;
  }

  /* =========================
     META / BUSCADOR
     ========================= */
  .meta-row{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .meta-left{
    width: 100%;
    font-size: 13px;
    line-height: 1.3;
  }

  .meta-actions{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .meta-search{
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: stretch;
  }

  .meta-search input[type="search"]{
    min-width: 0;
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
  }

  .meta-search button,
  .meta-search .btn-clear{
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* =========================
     LAYOUT TIENDA
     ========================= */
  .shop-layout{
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .shop-layout > *{
    min-width: 0;
  }

  .panel{
    width: 100%;
    min-width: 0;
  }

  .panel-header,
  .panel-body{
    padding-left: 12px;
    padding-right: 12px;
  }

  .cats-list{
    max-height: 260px;
    overflow: auto;
    padding-right: 2px;
  }

  .cat-item{
    min-width: 0;
    word-break: break-word;
  }

  /* importante: el sidebar no debe quedar fijo o ancho */
  .shop-sidebar,
  .filters-sidebar,
  .categories-sidebar,
  aside.panel{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* =========================
     GRID PRODUCTOS
     ========================= */
  #productList{
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  #productList > *{
    min-width: 0;
  }

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

  .img-box{
    height: 170px;
    flex: 0 0 170px;
  }

  .card-body{
    padding: 14px;
  }

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

  /* =========================
     PAGINACION
     ========================= */
  .pagination{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pagination-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .page-btn{
    text-align: center;
  }

  /* =========================
     PROMOS
     ========================= */
  .promo-card{
    width: 100%;
    max-width: 100%;
  }

  .promo-media img{
    width: 100%;
    max-width: 100%;
    max-height: 240px;
  }

  /* =========================
     CARRITO
     ========================= */
  .cart-page{
    max-width: 100%;
    padding: 12px 12px 36px;
  }

  .cart-head{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .cart-title-page{
    font-size: 22px;
    line-height: 1.1;
  }

  .cart-subtitle{
    font-size: 14px;
    line-height: 1.35;
    max-width: 240px;
  }

  .cart-layout{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    width: 100%;
  }

  .cart-layout > *{
    min-width: 0;
    width: 100%;
  }

  .cart-side{
    order: 2;
    display: grid;
    gap: 12px;
  }

  .cart-card{
    width: 100%;
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .cart-empty{
    padding: 14px;
  }

  /* el item no debe seguir en modo pc */
  .cart-item{
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-areas:
      "img info"
      "qty qty"
      "sub sub";
    gap: 10px;
    align-items: start;
    width: 100%;
    min-width: 0;
  }

  .cart-item-media{ grid-area: img; }
  .cart-item-info{
    grid-area: info;
    min-width: 0;
  }

  .cart-item-name{
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
  }

  .cart-item-meta{
    font-size: 12px;
    gap: 6px;
  }

  .cart-item-qty{
    grid-area: qty;
    justify-self: start;
    margin-top: 4px;
  }

  .cart-item-sub{
    grid-area: sub;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
  }

  .cart-item-subval{
    text-align: left;
  }

  .cart-thumb{
    width: 52px;
    height: 52px;
  }

  /* formulario checkout */
  .form-grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mode-row,
  .loc-row,
  .checkout-access__actions{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .radio-pill,
  .btn-send,
  .btn-ghost,
  .btn-secondary{
    width: 100%;
  }

  .checkout-access__box{
    padding: 16px;
  }

  /* botones login / registro del checkout */
  .checkout-access__actions .btn-secondary,
  .checkout-access__actions .btn-link{
    width: 100%;
    justify-content: center;
  }

  /* =========================
     PERFIL / PEDIDOS
     ========================= */
  .profile-grid{
    grid-template-columns: 1fr;
  }

  .orders-card__header,
  .order-item__top{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* =========================
     DRAWER
     ========================= */
  .side-drawer{
    width: 86vw;
    max-width: 320px;
  }

  /* =========================
     CUALQUIER COSA QUE EMPUJE
     ========================= */
  .panel,
  .product-card,
  .cart-card,
  .order-item,
  .profile-card,
  .orders-card,
  .checkout-access__box,
  .auth-card{
    max-width: 100%;
    min-width: 0;
  }

  img{
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 768px){
  body{
    padding-top: 62px;
  }

  .main-header__inner--drawer{
    min-height: 62px;
    padding: 10px 12px;
  }

  .main-brand{
    font-size: 17px;
  }
}

/* =========================================
   TIENDA MOBILE — FILTROS EN DRAWER
   ========================================= */
.filters-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 10020;
  backdrop-filter: blur(4px);
}

.filters-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

.filters-drawer{
  position: fixed;
  top: 0;
  right: 0;
  width: 86vw;
  max-width: 340px;
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: -18px 0 40px rgba(0,0,0,.16);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 10021;
  padding: 16px 14px 20px;
  overflow-y: auto;
}

.filters-drawer.is-open{
  transform: translateX(0);
}

.filters-drawer__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.filters-drawer__title{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}

.filters-drawer__close{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

body.filters-open{
  overflow: hidden;
}

@media (min-width: 769px){
  .filters-backdrop,
  .filters-drawer,
  .filters-open-btn{
    display: none !important;
  }
}

@media (max-width: 768px){
  .filters-section{
    display: none !important;
  }

  .meta-actions{
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .filters-open-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .shop-layout{
    grid-template-columns: 1fr !important;
  }

  .products-section{
    min-width: 0;
  }

  #productList{
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
}

/* =========================================
   BARRA INFERIOR MOVIL
   ========================================= */
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 -10px 24px rgba(0,0,0,.08);
  transition: transform .22s ease;
}

.bottom-nav.is-hidden{
  transform: translateY(100%);
}

.bottom-nav__item{
  position: relative;
  min-height: 56px;
  border-radius: 16px;
  text-decoration: none;
  color: #111827;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0,0,0,.05);
}

.bottom-nav__item:active{
  transform: translateY(1px);
}

.bottom-nav__icon{
  font-size: 18px;
  line-height: 1;
}

.bottom-nav__label{
  font-size: 12px;
  line-height: 1;
}

.bottom-nav__item--cart{
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  color: #fff;
  border-color: rgba(17,24,39,.9);
}

.bottom-nav__badge{
  position: absolute;
  top: 6px;
  right: 12px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(0,0,0,.18);
}

@media (max-width: 768px){
  body{
    padding-bottom: 84px;
  }

  .bottom-nav{
    display: grid;
  }
}

@media (min-width: 769px){
  .bottom-nav{
    display: none !important;
  }
}

.bottom-nav{
  transition: transform .22s ease;
}

.bottom-nav.is-hidden{
  transform: translateY(100%);
}

.bottom-nav{
  transition: transform .22s ease;
}

.bottom-nav.is-hidden{
  transform: translateY(100%);
}

/* =========================
   BOTON FILTRO HEADER
   ========================= */

.header-right{
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.filter-toggle{
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .18s ease;
}

.filter-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}