:root {
  --radius: 8px;
  --background: #fdfcfa;
  --foreground: #2b2119;
  --card: #ffffff;
  --primary: #ef5b28;
  --primary-glow: #f37a3f;
  --primary-foreground: #fffdfb;
  --secondary: #f5f2ee;
  --muted: #f5f2ee;
  --muted-foreground: #756a63;
  --border: #e7e1d9;
  --input: #f7f4f0;
  --destructive: #d9342b;
  --gradient-primary: linear-gradient(135deg, #f3792f, #f79236);
  --shadow-glow: 0 10px 30px -10px rgba(239, 91, 40, 0.35);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Barra superior */
.topbar {
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; gap: 8px; }
.topbar .links { display: flex; gap: 16px; }
.topbar .links a:hover { color: var(--primary); }
.topbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .topbar .links { display: none; } }

/* Header */
header.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(253,252,250,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; flex-wrap: nowrap; }
.logo img { height: 44px; width: auto; }
.search-box { flex: 1; position: relative; max-width: 500px; margin-left: 16px; min-width: 0; }
.search-box input {
  width: 100%; height: 42px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--input); padding: 0 14px 0 38px; font-size: 14px;
}
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.account-link { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 14px; color: var(--muted-foreground); }
.account-link:hover { color: var(--foreground); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  background: var(--gradient-primary); color: var(--primary-foreground);
  padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-glow); white-space: nowrap;
}
.cart-btn .badge { background: rgba(255,255,255,0.25); padding: 1px 7px; border-radius: 6px; font-size: 12px; }

nav.categories { border-top: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
nav.categories .container { display: flex; gap: 24px; padding: 12px 16px; font-size: 14px; font-weight: 600; white-space: nowrap; }
nav.categories a { color: var(--muted-foreground); }
nav.categories a:hover, nav.categories a.active { color: var(--primary); }

.menu-toggle-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px 8px; }

.mobile-nav {
  display: none; flex-direction: column; gap: 2px; padding: 12px 16px 16px;
  border-top: 1px solid var(--border); background: var(--card);
}
.mobile-nav a { padding: 10px 4px; font-size: 14px; font-weight: 600; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.active { color: var(--primary); }
.mobile-nav.open { display: flex; }

/* Header responsivo */
@media (max-width: 768px) {
  .header-row .search-box { display: none; }
  .header-row { gap: 10px; padding: 12px 16px; }
  nav.categories { display: none; }
  .menu-toggle-btn { display: block; }
}
@media (max-width: 480px) {
  .logo img { height: 34px; }
  .account-link span, .cart-btn span:not(.badge) { display: none; }
  .account-link, .cart-btn { padding: 8px 10px; }
  .header-actions { gap: 6px; }
  nav.categories .container { gap: 16px; padding: 10px 16px; font-size: 13px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 16px; margin: 24px auto;
  width: calc(100% - 32px); max-width: 1200px;
  background: #1c1512; color: #fff; min-height: 340px; display: flex; align-items: center;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.hero-content { position: relative; z-index: 1; padding: 40px; max-width: 560px; }
.hero-content h1 { font-size: 40px; line-height: 1.1; margin: 0 0 16px; font-weight: 900; }
.hero-content p { font-size: 16px; margin-bottom: 24px; color: #f0e9e4; }

@media (max-width: 640px) {
  .hero { margin: 16px; min-height: 260px; }
  .hero-content { padding: 24px; max-width: 100%; }
  .hero-content h1 { font-size: 26px; }
  .hero-content p { font-size: 14px; margin-bottom: 16px; }
  .btn-primary, .btn-secondary { padding: 10px 18px; font-size: 13px; }
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; background: var(--gradient-primary);
  color: #fff; padding: 12px 24px; border-radius: 8px; font-weight: 700; border: none; cursor: pointer;
  box-shadow: var(--shadow-glow); font-size: 14px;
}
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; background: transparent;
  border: 1px solid var(--border); color: var(--foreground); padding: 12px 24px;
  border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}

/* Section titles */
.section { max-width: 1200px; margin: 0 auto; padding: 32px 16px; }
.section-title { font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 16px; }

/* Grid de productos */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

.product-card {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--card); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.product-card .thumb { position: relative; aspect-ratio: 1/1; background: #fff; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-tag {
  position: absolute; left: 10px; top: 10px; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 8px; border-radius: 4px;
}
.product-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-brand { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
.product-name { font-size: 14px; font-weight: 700; margin: 4px 0 2px; }
.product-size { font-size: 12px; color: var(--muted-foreground); }
.product-footer { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 17px; font-weight: 900; }
.price-old { color: var(--destructive); text-decoration: line-through; font-size: 13px; font-weight: 700; margin-right: 6px; }
.add-btn {
  border: 1px solid var(--border); background: transparent; padding: 6px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; cursor: pointer;
  color: var(--muted-foreground);
}
.add-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Franja de beneficios */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 16px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 700px) { .benefits { grid-template-columns: 1fr; } }
.benefit { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.benefit strong { display: block; font-size: 14px; }
.benefit span { font-size: 12px; color: var(--muted-foreground); }

/* Footer */
footer.site-footer { border-top: 1px solid var(--border); background: var(--secondary); margin-top: 40px; padding: 32px 16px; font-size: 13px; color: var(--muted-foreground); }
footer.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* Página de producto */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px 16px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .gallery { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.product-detail h1 { font-size: 26px; font-weight: 900; margin: 8px 0; }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.qty-row input { width: 60px; padding: 8px; border-radius: 6px; border: 1px solid var(--border); text-align: center; }

/* Breadcrumb / categoría */
.breadcrumb { font-size: 13px; color: var(--muted-foreground); padding: 16px; max-width: 1200px; margin: 0 auto; }
.category-header { padding: 8px 16px 24px; max-width: 1200px; margin: 0 auto; }
.category-header h1 { font-size: 26px; font-weight: 900; text-transform: uppercase; }

/* Carrito lateral (drawer) */
.cart-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 60; display: none; }
.cart-drawer-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 380px; max-width: 92vw; height: 100vh;
  background: var(--card); z-index: 61; box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; transition: right .25s ease; overflow-x: hidden;
}
.cart-drawer.open { right: 0; }
.cart-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.cart-drawer-items { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 16px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); max-width: 100%; }
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-size: 13px; font-weight: 700; overflow-wrap: break-word; }
.cart-item .qty-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cart-item .qty-controls button { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--border); background: none; cursor: pointer; flex-shrink: 0; }
.cart-drawer-footer { padding: 16px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 12px; }

/* Formularios (checkout / cuenta) */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
@media (max-width: 640px) { .form-card { padding: 16px; } }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--input); font-size: 14px;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fdecea; color: #a4271b; border: 1px solid #f4c7c1; }
.alert-success { background: #eaf7ee; color: #1a7a37; border: 1px solid #bfe6cb; }

.checkout-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; padding: 24px 16px; max-width: 1100px; margin: 0 auto; }
@media (max-width: 850px) { .checkout-grid { grid-template-columns: 1fr; } }

.cuenta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 850px) { .cuenta-grid { grid-template-columns: 1fr; } }

.badge { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.badge-yellow { background: #fdf3d8; color: #8a6800; }
.badge-green { background: #e5f6ea; color: #1a7a37; }
.badge-red { background: #fdecea; color: #a4271b; }
.badge-gray { background: #efe9e4; color: #6b6058; }
.order-summary-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.order-summary-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.tag-empty { text-align: center; padding: 60px 16px; color: var(--muted-foreground); }

/* Compartir producto */
.share-row { display: flex; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.share-label { font-size: 13px; font-weight: 700; color: var(--muted-foreground); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: none; border-radius: 50%; cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: transform .15s ease;
}
.share-btn:hover { transform: translateY(-2px); }

/* Carrusel de marcas (loop infinito con CSS puro) */
.brands-carousel { overflow: hidden; padding: 8px 0 32px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.brands-track { display: flex; gap: 16px; width: max-content; animation: brands-scroll 30s linear infinite; }
.brands-carousel:hover .brands-track { animation-play-state: paused; }
@keyframes brands-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.brand-card {
  flex-shrink: 0; width: 160px; height: 80px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px 20px;
}
.brand-card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-card span { font-weight: 800; font-size: 14px; color: var(--foreground); text-align: center; }

/* Banner promocional */
.promo-banner {
  position: relative; overflow: hidden; border-radius: 16px; padding: 40px;
  background: linear-gradient(135deg, #f5f2ee, #ece6df); background-size: cover; background-position: center;
  min-height: 200px; display: flex; align-items: center;
}
.promo-blob { position: absolute; top: -40px; right: -40px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(239,91,40,0.35), transparent 70%); pointer-events: none; }
.promo-content { position: relative; z-index: 1; max-width: 520px; }
.promo-eyebrow { margin: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.promo-title { margin: 8px 0 10px; font-size: 30px; font-weight: 900; line-height: 1.15; }
.promo-desc { margin: 0 0 20px; color: var(--muted-foreground); font-size: 14px; }
@media (max-width: 640px) {
  .promo-banner { padding: 28px; }
  .promo-title { font-size: 22px; }
}
