:root{
  --bg: #EEEDEB;
  --header-bg: #E7E5E2;
  --ink: #242A3F;
  --brand: #46596A;
  --brand-soft: #6C7C89;
  --line: #D9D6D2;
  --placeholder: #D3D1D2;
  --placeholder-line: #B9B6B4;
  --sale: #B4573F;
  --sold-out: #8C8A87;
}

*{ box-sizing:border-box; margin:0; padding:0; }

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

body{
  background: var(--bg);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  min-height:100vh;
}

/* ---------- HEADER ---------- */
header{
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top:0;
  z-index: 20;
  width: 100%;
}
.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  gap: 8px;
}
.icon-btn{
  background:none; border:none; cursor:pointer; color: var(--brand);
  display:flex; align-items:center; padding:4px; flex-shrink:0;
}
.icon-btn svg{ width:20px; height:20px; }

.logo-wrap{ display:flex; align-items:center; justify-content:center; flex:1; min-width:0; }
.logo-wrap img{ height: 34px; max-width: 55vw; width: auto; object-fit: contain; display:block; }
@media (min-width: 480px){
  .logo-wrap img{ height: 42px; max-width: 220px; }
  .icon-btn svg{ width:22px; height:22px; }
}

.header-actions{ display:flex; gap: 10px; align-items:center; flex-shrink:0; }
.cart-btn{ position:relative; }
.cart-badge{
  position:absolute; top:-4px; right:-6px; background: var(--brand); color: var(--bg);
  font-size: 10px; font-weight:600; width: 16px; height:16px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}

/* ---------- TOOLBAR ---------- */
.page-heading{
  max-width: 1200px; margin: 0 auto; padding: 16px 20px 0;
  font-size: 18px; color: var(--ink);
}
.toolbar{
  max-width: 1200px; margin: 0 auto; display:flex; align-items:center;
  justify-content:space-between; gap: 8px; padding: 14px 14px 6px;
  flex-wrap: wrap; width: 100%;
}
.toolbar-left{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; min-width:0; }
.sort-control{ display:flex; align-items:center; gap:6px; font-size: 12.5px; color: var(--ink); min-width:0; }
.sort-control svg{ width:16px; height:16px; color:var(--brand); flex-shrink:0; }
.sort-select{
  border:none; background:transparent; font-family:'Work Sans',sans-serif;
  font-size:12.5px; color:var(--ink); cursor:pointer; max-width: 38vw; text-overflow: ellipsis;
}
@media (min-width: 480px){
  .sort-control{ font-size: 14px; }
  .sort-select{ font-size:14px; max-width: 220px; }
  .sort-control svg{ width:18px; height:18px; }
}
.product-count{ font-size: 11.5px; color: var(--brand-soft); white-space: nowrap; }
@media (min-width: 480px){ .product-count{ font-size: 13px; } }

/* ---------- GRID ---------- */
.grid{
  max-width: 1200px; margin: 0 auto; padding: 8px 10px 60px;
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; width: 100%;
}
@media (min-width: 640px){ .grid{ grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 16px 24px 80px; } }
@media (min-width: 980px){ .grid{ grid-template-columns: repeat(4, 1fr); } }

.card{ display:flex; flex-direction:column; min-width: 0; cursor: pointer; }

.image-slot{
  position:relative; aspect-ratio: 3 / 4; background: var(--placeholder);
  border: 1px solid var(--placeholder-line); overflow:hidden; width: 100%;
}
.image-slot img{ width:100%; height:100%; object-fit:cover; display:block; }
.image-slot .placeholder-msg{
  height:100%; display:flex; align-items:center; justify-content:center;
  color: var(--brand-soft); font-size: 10.5px; text-align:center; padding: 8px;
}

.badge{
  position:absolute; top:6px; left:6px; font-size: 9px; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 6px; border-radius: 2px; color: #fff; z-index: 2;
}
@media (min-width: 480px){ .badge{ font-size: 10px; top:8px; left:8px; padding:3px 8px; } }
.badge.oferta{ background: var(--sale); }
.badge.agotado{ background: var(--sold-out); }
.badge.nuevo{ left: auto; right: 6px; background: var(--ink); }
@media (min-width: 480px){ .badge.nuevo{ right: 8px; } }

.card-info{ padding: 8px 2px 0; }
.card-category{
  font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--brand-soft); margin-bottom: 2px;
}
.card-name{ font-size: 12px; color: var(--ink); line-height:1.35; }
@media (min-width:640px){ .card-name{ font-size:15px; } }

.price-row{ margin-top: 4px; display:flex; align-items:baseline; gap: 6px; flex-wrap: wrap; }
.card-price{ font-size: 12px; color: var(--ink); }
.card-price.on-sale{ color: var(--sale); font-weight:600; }
.card-price.struck{ text-decoration: line-through; color: var(--brand-soft); font-size: 11px; }
@media (min-width:640px){ .card-price{ font-size:15px; } .card-price.struck{ font-size:13px; } }

.sizes-row{ margin-top: 6px; display:flex; gap: 4px; flex-wrap: wrap; }
.size-chip{
  font-size: 10px; color: var(--brand); border: 1px solid var(--placeholder-line);
  padding: 2px 6px; border-radius: 2px; line-height:1.4;
}
@media (min-width:640px){ .size-chip{ font-size: 11px; padding: 3px 8px; } }

footer{ text-align:center; padding: 24px 20px 40px; font-size: 11px; color: var(--brand-soft); letter-spacing: 1px; }

/* ---------- PÁGINA DE DETALLE ---------- */
.detail{ max-width: 640px; margin: 0 auto; padding: 0 0 60px; }

.detail-image{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--placeholder);
  border-bottom: 1px solid var(--placeholder-line);
  overflow: hidden;
}
.detail-image img{ width:100%; height:100%; object-fit:cover; display:block; }
.detail-image .placeholder-msg{
  height:100%; display:flex; align-items:center; justify-content:center;
  color: var(--brand-soft); font-size: 12px; text-align:center; padding: 20px;
}

.carousel-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 6px;
  display:flex;
}
.carousel-arrow svg{ width: 22px; height: 22px; }
.carousel-arrow.prev{ left: 6px; }
.carousel-arrow.next{ right: 6px; }
.carousel-arrow[disabled]{ opacity: 0.25; cursor: default; }

.carousel-counter{
  text-align: center;
  padding: 14px 0;
  font-size: 13px;
  color: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.carousel-counter button{
  background:none; border:none; cursor:pointer; color: var(--brand); display:flex; padding:2px;
}
.carousel-counter button svg{ width: 16px; height: 16px; }
.carousel-counter button[disabled]{ opacity: 0.25; cursor: default; }

.detail-body{ padding: 8px 20px 0; }
.detail-name{ font-size: 20px; color: var(--ink); line-height: 1.3; margin-bottom: 10px; }
.detail-price-row{ display:flex; align-items:baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-price{ font-size: 19px; color: var(--ink); }
.detail-price.on-sale{ color: var(--sale); font-weight: 600; }
.detail-price.struck{ text-decoration: line-through; color: var(--brand-soft); font-size: 16px; }

.detail-features{ list-style: none; margin-bottom: 22px; }
.detail-features li{
  display:flex; align-items:flex-start; gap: 8px; font-size: 13.5px;
  color: var(--ink); font-weight: 500; margin-bottom: 10px; line-height: 1.4;
}
.detail-features li::before{
  content: "•"; color: var(--brand); font-size: 16px; line-height: 1; margin-top: -1px;
}

.detail-note{
  font-size: 11px; color: var(--brand-soft); border-top: 1px solid var(--line);
  padding-top: 14px; line-height: 1.5;
}

.detail-back{
  display: inline-flex; align-items:center; gap: 6px; margin: 16px 20px 4px;
  font-size: 13px; color: var(--brand); background:none; border:none; cursor:pointer;
}
.detail-back svg{ width: 16px; height: 16px; }

/* ---------- SELECTOR DE TALLAS ---------- */
.section-label{
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--brand-soft); margin: 20px 0 10px;
}
.size-grid{ display:flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.size-btn{
  min-width: 46px; height: 40px; padding: 0 10px;
  border: 1px solid var(--placeholder-line); background: var(--bg);
  color: var(--ink); font-size: 13.5px; font-family:'Work Sans',sans-serif;
  cursor: pointer;
}
.size-btn.selected{ background: var(--ink); color: #fff; border-color: var(--ink); }
.size-btn:disabled{ color: var(--placeholder-line); border-color: var(--line); cursor: not-allowed; background: transparent; }

.variant-grid{ display:flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.variant-btn{
  padding: 8px 14px; border: 1px solid var(--brand); background: var(--bg);
  color: var(--brand); font-size: 13px; font-family:'Work Sans',sans-serif; cursor: pointer;
}
.variant-btn.selected{ background: var(--brand); color: #fff; }
.variant-hint{ font-size: 11.5px; color: var(--brand-soft); margin-top: 4px; }

/* ---------- CANTIDAD ---------- */
.qty-stepper{ display:flex; align-items:center; gap: 0; margin-top: 4px; width: fit-content; }
.qty-btn{
  width: 36px; height: 36px; border: 1px solid var(--placeholder-line); background: var(--bg);
  color: var(--ink); font-size: 16px; cursor: pointer; display:flex; align-items:center; justify-content:center;
}
.qty-value{
  width: 44px; height: 36px; display:flex; align-items:center; justify-content:center;
  border-top: 1px solid var(--placeholder-line); border-bottom: 1px solid var(--placeholder-line);
  font-size: 14px; color: var(--ink);
}

/* ---------- TABLA DE TALLAS (acordeón) ---------- */
.accordion{ border-top: 1px solid var(--line); margin-top: 22px; }
.accordion-header{
  display:flex; align-items:center; justify-content:space-between; gap: 8px;
  padding: 14px 0; background:none; border:none; width:100%; cursor:pointer;
  font-size: 13.5px; color: var(--ink); font-family:'Work Sans',sans-serif;
}
.accordion-header .label-left{ display:flex; align-items:center; gap: 8px; }
.accordion-header svg.icon{ width: 18px; height: 18px; color: var(--brand); }
.accordion-header .chevron{ width: 16px; height: 16px; color: var(--brand-soft); transition: transform .2s; }
.accordion-header.open .chevron{ transform: rotate(180deg); }
.accordion-panel{
  display:none; padding: 0 0 16px; font-size: 12.5px; color: var(--brand-soft); line-height: 1.5;
}
.accordion-panel.open{ display:block; }

/* ---------- BOTONES DE ACCIÓN ---------- */
.action-btns{ display:flex; flex-direction:column; gap: 10px; margin-top: 18px; }
.btn{
  width:100%; padding: 14px; font-size: 13.5px; letter-spacing: .3px; text-align:center;
  cursor:pointer; font-family:'Work Sans',sans-serif; display:flex; align-items:center;
  justify-content:center; gap: 8px;
}
.btn-outline{ background: var(--bg); border: 1px solid var(--ink); color: var(--ink); }
.btn-solid{ background: var(--ink); border: 1px solid var(--ink); color: #fff; }
.btn svg{ width: 18px; height: 18px; }

/* ---------- MÁS OPCIONES ---------- */
.more-options{ margin-top: 36px; padding: 0 20px; }
.more-options .section-label{ margin: 0 0 12px; }
.more-scroll{
  display:flex; gap: 14px; overflow-x: auto; padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.more-item{ flex: 0 0 auto; width: 130px; cursor:pointer; }
.more-item .image-slot{ width: 130px; aspect-ratio: 3/4; }
.more-item .card-name{ font-size: 12px; margin-top: 6px; }
.more-item .card-price{ font-size: 12px; }

/* ---------- CARRITO (drawer deslizante) ---------- */
.cart-overlay{
  position: fixed; inset: 0; background: rgba(36,42,63,0.45);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  z-index: 40;
}
.cart-overlay.open{ opacity: 1; pointer-events: auto; }

.cart-drawer{
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(380px, 92vw);
  background: var(--bg);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 41;
  display: flex; flex-direction: column;
}
.cart-drawer.open{ transform: translateX(0); }

.cart-drawer-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--ink); font-weight: 500; flex-shrink:0;
}
.cart-drawer-header .icon-btn svg{ width: 18px; height: 18px; }

.cart-drawer-body{ flex:1; overflow-y: auto; padding: 16px 18px; }
.cart-drawer-footer{ padding: 14px 18px 20px; border-top: 1px solid var(--line); flex-shrink:0; }

.cart-empty{ text-align:center; padding: 60px 10px; color: var(--brand-soft); font-size: 13.5px; }

.cart-row{ display:flex; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.cart-row .image-slot{ width: 68px; aspect-ratio: 3/4; flex-shrink:0; }
.cart-row-info{ flex:1; min-width:0; display:flex; flex-direction:column; }
.cart-row-name{ font-size: 12.5px; color: var(--ink); line-height:1.35; }
.cart-row-size{ font-size: 11px; color: var(--brand-soft); margin-top: 3px; }
.cart-row-bottom{ display:flex; align-items:center; justify-content:space-between; margin-top: 8px; gap: 6px; flex-wrap: wrap; }
.cart-row-price{ font-size: 12px; color: var(--ink); font-weight: 500; }
.cart-row-remove{
  background:none; border:none; color: var(--brand-soft); cursor:pointer;
  display:flex; align-items:center; gap: 4px; font-size: 11px; padding: 4px 0 0; align-self:flex-start;
}
.cart-row-remove svg{ width: 13px; height: 13px; }

.cart-qty{ display:flex; align-items:center; gap: 0; }
.cart-qty .qty-btn{ width: 26px; height: 26px; font-size: 13px; }
.cart-qty .qty-value{ width: 30px; height: 26px; font-size: 12px; }

.cart-summary-row{ display:flex; align-items:center; justify-content:space-between; font-size: 14px; color: var(--ink); }
.cart-summary-row.total{ font-size: 16px; font-weight:600; margin-bottom: 12px; }

.cart-clear{
  display:block; width:100%; text-align:center; margin-top: 10px;
  background:none; border:none; color: var(--brand-soft); font-size: 12px;
  text-decoration: underline; cursor:pointer;
}

/* ---------- MENÚ (drawer izquierdo) ---------- */
.menu-overlay{
  position: fixed; inset: 0; background: rgba(36,42,63,0.45);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  z-index: 40;
}
.menu-overlay.open{ opacity: 1; pointer-events: auto; }

.menu-drawer{
  position: fixed; top: 0; left: 0; height: 100vh;
  width: min(320px, 86vw);
  background: var(--bg);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(-100%);
  transition: transform .3s ease;
  z-index: 41;
  display: flex; flex-direction: column;
}
.menu-drawer.open{ transform: translateX(0); }

.menu-drawer-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--ink); font-weight: 500; flex-shrink:0;
}
.menu-drawer-header .icon-btn svg{ width: 18px; height: 18px; }

.menu-drawer-body{ flex:1; overflow-y: auto; }

.menu-link{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-size: 14px; color: var(--ink); text-decoration:none;
  background:none; border-left:none; border-right:none; border-top:none;
  width:100%; text-align:left; cursor:pointer; font-family:'Work Sans',sans-serif;
}
.menu-link svg{ width: 16px; height: 16px; color: var(--brand-soft); }

.menu-back{
  display:flex; align-items:center; gap: 8px; width:100%;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background:none; border-top:none; border-left:none; border-right:none;
  color: var(--brand); font-size: 13px; cursor:pointer; font-family:'Work Sans',sans-serif;
}
.menu-back svg{ width: 16px; height: 16px; }

.menu-empty{ padding: 20px; font-size: 12.5px; color: var(--brand-soft); }

/* ---------- PÁGINAS INFORMATIVAS (Contact / About) ---------- */
.info-page{ max-width: 560px; margin: 0 auto; padding: 32px 20px 60px; }
.info-title{ font-size: 22px; color: var(--ink); margin-bottom: 14px; }
.info-text{ font-size: 13.5px; color: var(--brand-soft); line-height: 1.7; margin-bottom: 16px; }

.contact-list{ margin-top: 24px; display:flex; flex-direction:column; gap: 4px; }
.contact-row{
  display:flex; align-items:center; gap: 14px; padding: 16px 4px;
  border-bottom: 1px solid var(--line); text-decoration:none; color: var(--ink);
}
.contact-icon{
  width: 40px; height: 40px; border-radius: 50%; background: var(--header-bg);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; color: var(--brand);
}
.contact-icon svg{ width: 19px; height: 19px; }
.contact-row-label{ font-size: 11px; text-transform: uppercase; letter-spacing:.4px; color: var(--brand-soft); }
.contact-row-value{ font-size: 14px; color: var(--ink); margin-top: 2px; }

/* ---------- BUSCADOR ---------- */
.search-overlay{
  position: fixed; inset: 0; background: rgba(36,42,63,0.45);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  z-index: 42;
}
.search-overlay.open{ opacity: 1; pointer-events: auto; }

.search-panel{
  position: fixed; top: 0; left: 0; right: 0;
  max-height: 88vh;
  background: var(--bg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  transform: translateY(-100%);
  transition: transform .3s ease;
  z-index: 43;
  display: flex; flex-direction: column;
}
.search-panel.open{ transform: translateY(0); }

.search-input-row{
  display:flex; align-items:center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); flex-shrink:0;
}
.search-input-row > svg{ width: 18px; height: 18px; color: var(--brand); flex-shrink:0; }
.search-input{
  flex:1; border:none; background:none; outline:none;
  font-family:'Work Sans',sans-serif; font-size: 15px; color: var(--ink);
}
.search-input-row .icon-btn svg{ width: 18px; height: 18px; }

.search-results{ overflow-y: auto; padding: 8px 18px 20px; }
.search-hint{ padding: 24px 4px; font-size: 13px; color: var(--brand-soft); }

.search-result-row{
  display:flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.search-result-row .image-slot{ width: 56px; aspect-ratio: 3/4; flex-shrink:0; }
.search-result-info{ display:flex; flex-direction:column; justify-content:center; gap: 2px; }