:root{
  --turq:#0097A7;
  --coral:#FF6F61;
  --arena:#F5E9D3;
  --negro:#111;
  --blanco:#fff;
}

*{ box-sizing:border-box; }

body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  margin:0;
  background:#fafafa;
  color:#222;
}

a{ color:inherit; text-decoration:none; }

header,footer{ background:var(--arena); padding:14px 18px; }

.container{ max-width:1100px; margin:auto; padding:18px; }

/* ===== Header ===== */
.header-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.btn-link{
  padding:8px 12px;
  border:1px solid #e5e5e5;
  border-radius:999px;
  background:#fff;
  font-weight:700;
}
.btn-link:hover{ filter:brightness(.97); }

.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:999px;
  background:#fff;
  border:1px solid #e5e5e5;
  color:#333;
}
.icon-btn:hover{ background:#f6f8f8; }

/* ===== Layout ===== */
.layout{
  display:grid;
  gap:18px;
  grid-template-columns:2.2fr .9fr;
}

@media (max-width:900px){
  .layout{ grid-template-columns:1fr; }
}

/* ===== Cards ===== */
.grid{
  display:grid;
  gap:16px;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
}

.card{
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  position:relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.card img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  background:#f3f3f3;
}

.card h3{ margin:12px 12px 4px; font-size:1.05rem; }

.subtitle{ margin:0 12px 8px; font-size:.92rem; opacity:.85; }

.pill{
  display:inline-block;
  margin:0 12px 10px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef7f7;
  color:#0b7785;
  font-weight:700;
  font-size:.72rem;
}

.small{ font-size:.9rem; opacity:.85; }

.price{ font-weight:700; margin:0 12px 12px; }

.controls{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0 12px 14px;
  flex-wrap:wrap;
}

select,input{
  padding:9px;
  border:1px solid #ddd;
  border-radius:10px;
}

.btn{
  display:inline-block;
  padding:10px 12px;
  border-radius:10px;
  background:var(--turq);
  color:#fff;
  text-align:center;
  cursor:pointer;
  border:0;
  font-weight:700;
}
.btn:hover{ filter:brightness(.95); }

.wapp{ background:#25D366; color:#fff; }

/* Hover solo desktop (en móvil no molesta, pero no se usa) */
.card:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 28px rgba(0,0,0,.10);
  border-color:#e6e6e6;
}

/* ===== Ribbon “Próximamente” ===== */
.ribbon{
  position:absolute;
  top:12px;
  left:12px;
  background:var(--coral);
  color:#fff;
  font-weight:800;
  font-size:.75rem;
  padding:6px 10px;
  border-radius:999px;
  box-shadow:0 10px 20px rgba(0,0,0,.12);
}

/* ===== Cart ===== */
.cart{
  position:sticky;
  top:0;
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  padding:14px;
}

.row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin:6px 0;
}

.row-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.rm{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:6px;
  border:0;
  background:#ffecec;
  color:#c11;
  cursor:pointer;
}
.rm:hover{ filter:brightness(.95); }

.cta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

/* ===== Filters ===== */
.filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 16px;
}

.filters button{
  padding:8px 12px;
  border:1px solid #e5e5e5;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
}

.filters button.active{
  background:var(--turq);
  color:#fff;
  border-color:var(--turq);
}

/* ===== Footer ===== */
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.footer-inner .social{ display:flex; gap:10px; }

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

/* ===== Remove number spinners (por si aún hay type=number) ===== */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
input[type=number]{ -moz-appearance:textfield; appearance:textfield; }

/* =========================
   MODAL (Vaciar carrito)
   ========================= */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:10001;
}

.modal{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) scale(.98);
  width:min(420px,92vw);
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.22);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:10002;
  padding:16px;
}

.modal h4{ margin:0 0 6px; font-size:1.05rem; }
.modal p{ margin:0 0 14px; opacity:.85; }

.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

.modal-open .modal-overlay{ opacity:1; pointer-events:auto; }
.modal-open .modal{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }

/* =========================
   MOBILE CART DRAWER
   ========================= */

/* Overlay del drawer */
.cart-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:9998;
}

/* Botón flotante */
.cart-fab{
  position:fixed;
  right:16px;
  bottom:16px;
  width:56px;
  height:56px;
  border-radius:999px;
  border:0;
  background:#25D366;
  color:#fff;
  display:none; /* desktop */
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  z-index:9999;
  cursor:pointer;
}

.cart-fab__icon{ font-size:22px; line-height:1; }

.cart-fab__badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:var(--coral);
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid #fff;
}

body.drawer-open{ overflow:hidden; }

/* Al abrir drawer: el FAB debe quedar arriba para poder cerrarlo tocándolo */
body.drawer-open .cart-fab{ z-index:10002; }

@media (max-width:900px){
  .cart-fab{ display:flex; }

  /* Drawer */
  .layout aside{
    position:fixed;
    top:0;
    right:0;
    height:100vh;
    width:min(420px,86vw); /* antes 92vw */
    transform:translateX(100%);
    transition:transform .22s ease;
    z-index:10000;
    padding:18px;
    background:transparent;
    overflow:auto;
  }

  body.drawer-open .layout aside{ transform:translateX(0); }

  body.drawer-open .cart-overlay{
    opacity:1;
    pointer-events:auto;
  }

  .cart{
    position:relative;
    top:auto;
  }

  .cart .cta{
    position:sticky;
    bottom:0;
    background:#fff;
    padding-top:10px;
    padding-bottom:10px;
  }
}

/* =========================
 GALERÍA DE PRODUCTO (por color)
 ========================= */
.gal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 11000; /* arriba del drawer y overlays */
}

.gal-modal{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%) scale(.98);
  width: min(920px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 11001;
  padding: 14px;
}

body.gallery-open .gal-overlay{
  opacity: 1;
  pointer-events: auto;
}

body.gallery-open .gal-modal{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%,-50%) scale(1);
}

.gal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.gal-title{
  font-weight: 800;
}

.gal-close{
  border: 0;
  background: #111;
  color:#fff;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.gal-main{
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  background: #f6f6f6;
  margin-top: 10px;
}

.gal-thumbs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}

.gal-thumbs img{
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  cursor:pointer;
  border: 2px solid transparent;
  background: #eee;
}

.gal-thumbs img.active{
  border-color: #111;
}

/* en móvil: mejor scroll horizontal */
@media (max-width: 600px){
  .gal-thumbs{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }
}
