/*
Theme Name: Distribuidora Valarezo
Theme URI: https://distribuidoravalarezo.example
Author: Codex
Author URI: https://openai.com
Description: Tienda en línea ligera para Distribuidora Valarezo con catálogo filtrable, flujo de checkout y página de éxito.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: valarezo-store
*/
:root {
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-ghost: #f0f4fa;
  --border: #d7e2f0;
  --text: #1f2f3f;
  --muted: #5b7085;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(49, 112, 178, 0.16);
  --primary: #3170B2;
  /* Fallbacks si llega cualquier var(--sky-*) desde builds externos */
  --sky-50: #f2f6fb;
  --sky-100: #e5edf7;
  --sky-200: #c8d8ee;
  --sky-300: #a3bfe2;
  --sky-400: #7ba3d4;
  --sky-500: #3170B2;
  --sky-600: #285d96;
  --sky-700: #214d7e;
  --sky-800: #1a3e65;
  --sky-900: #12314f;
}

/* Hard override: todos los botones al azul corporativo, sí o sí */
button,
input[type=submit],
input[type=button],
input[type=reset],
a.button,
a.btn,
.btn,
.btn-primary,
.btn.secondary,
.btn.soft,
.btn.ghost,
.wp-element-button {
  background: #3170B2 !important;
  color: #fff !important;
  border-color: #3170B2 !important;
}

/* Fondo liso en toda la página */
html, body, #page, .site, .vzr-body, .app-shell, main, .main {
  background: #ffffff !important;
}

* { box-sizing: border-box; }
body.vzr-body {
  margin: 0;
  font-family: 'Nunito', 'Inter', system-ui, -apple-system, sans-serif;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }

.app-shell { max-width: 1320px; margin: 0 auto; padding: 12px 14px 80px; }

.vzr-topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 20;
}
.vzr-logo { display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 52px; height: 38px; display: grid; place-items: center; }
.brand { font-weight: 700; letter-spacing: 0.1px; }
.icon-btn { border: none; background: transparent; padding: 8px; border-radius: 12px; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: var(--text); }

.vzr-search { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.vzr-search input { border: none; outline: none; background: transparent; width: 100%; font-size: 15px; }
.vzr-search svg { width: 18px; height: 18px; fill: var(--muted); }

.vzr-actions { display: flex; gap: 8px; align-items: center; }
.vzr-actions .action { position: relative; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; text-decoration: none; }
.vzr-actions svg { width: 20px; height: 20px; fill: var(--text); }
.pill { position: absolute; top: -6px; right: -6px; background: #ff5f6d; color: #fff; border-radius: 999px; padding: 2px 6px; font-size: 11px; font-weight: 700; }

.desktop-tabs { display: flex; gap: 12px; padding: 12px 4px 10px; }
.desktop-tabs .tab { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; box-shadow: none; }
.desktop-tabs .tab.active {
  background: #3170B2 !important;
  color: #fff !important;
  border-color: #3170B2 !important;
  box-shadow: 0 8px 20px rgba(49,112,178,0.22);
}

.hero-banner { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 12px; box-shadow: var(--shadow); }
.hero-text h1 { margin: 4px 0; font-size: 32px; }
.hero-text .lead { margin: 6px 0 14px; color: var(--muted); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-illus {
  position: relative;
  background: linear-gradient(135deg, #f7fbff 0%, #e8f1fb 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 240px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px;
  touch-action: pan-y;
  --hero-img-max: min(420px, 54vh);
}
.hero-illus.is-3d { perspective: 1100px; perspective-origin: 50% 48%; }
.hero-carousel { width: 100%; height: 100%; display: grid; grid-template-columns: 100%; grid-template-rows: 100%; }
.hero-carousel.is-3d { position: relative; transform-style: preserve-3d; transform: translateZ(calc(var(--hero-radius, 260px) * -1)); transition: transform 0.65s cubic-bezier(0.19, 1, 0.22, 1); will-change: transform; }
.hero-carousel.is-3d .hero-slide { position: absolute; inset: 0; transform-origin: center center; }
.hero-slide { grid-area: 1 / 1; display: grid; place-items: center; opacity: 0; transform: scale(0.985); transition: opacity 0.45s ease, transform 0.45s ease; }
.hero-slide.is-active { opacity: 1; transform: scale(1); }
.hero-illus.is-3d .hero-slide { opacity: 1; transition: none; }
.hero-illus.is-3d .hero-slide.is-active { opacity: 1; }
.hero-slide { backface-visibility: hidden; }
.hero-slide img { width: min(100%, 980px); height: auto; max-height: var(--hero-img-max, min(420px, 54vh)); object-fit: contain; image-rendering: -webkit-optimize-contrast; filter: drop-shadow(0 12px 30px rgba(17,63,115,0.16)); border-radius: 12px; }
.hero-nav { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; pointer-events: none; }
.hero-nav-btn { pointer-events: auto; width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.94); color: var(--text); box-shadow: 0 10px 26px rgba(0,0,0,0.14); display: grid; place-items: center; font-weight: 800; font-size: 18px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hero-nav-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0,0,0,0.16); }
.hero-nav-btn:focus-visible { outline: 2px solid #3170B2; outline-offset: 2px; }
.hero-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: inline-flex; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,0.86); border: 1px solid rgba(215,226,240,0.8); border-radius: 999px; box-shadow: 0 12px 24px rgba(0,0,0,0.08); pointer-events: auto; }
.hero-dot { width: 10px; height: 10px; border-radius: 999px; border: none; background: #b8cce3; padding: 0; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.hero-dot.is-active { background: #3170B2; transform: scale(1.15); }
@media (max-width: 720px) {
  .hero-illus { min-height: 200px; padding: 12px; --hero-img-max: 260px; }
  .hero-slide img { width: min(100%, 980px); height: auto; max-height: var(--hero-img-max); }
  .hero-nav { inset: auto 12px 52px 12px; height: 0; pointer-events: none; }
  .hero-nav-btn { width: 36px; height: 36px; font-size: 16px; box-shadow: 0 10px 18px rgba(0,0,0,0.12); position: relative; top: -26px; opacity: 0.78; }
}
@media (max-width: 520px) {
  .hero-illus { min-height: 180px; padding: 10px; --hero-img-max: 220px; }
  .hero-slide img { width: min(100%, 980px); height: auto; max-height: var(--hero-img-max); }
  .hero-nav { display: none; }
  .hero-dots { bottom: 8px; gap: 6px; padding: 6px 9px; box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
  .hero-dot { width: 9px; height: 9px; }
}

.pill-nav { margin: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--muted); cursor: pointer; }
.pill.active { background: #3170B2; color: #fff; border-color: #3170B2; }

.section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-top: 14px; box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-head h2 { margin: 2px 0; }
.link { color: #3170B2; text-decoration: none; font-weight: 700; }
.micro { text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-size: 12px; margin: 0; }
.lead { color: var(--muted); }
.muted { color: var(--muted); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; grid-auto-rows: 1fr; }
.card-prod { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: transform 0.16s ease, box-shadow 0.16s ease; cursor: pointer; position: relative; height: 100%; }
.card-prod:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(27,154,214,0.16); }
.card-top { display: grid; grid-template-columns: 1fr; align-items: start; gap: 6px; position: relative; }
.card-prod .thumb { background: var(--surface); border-radius: 12px; display: grid; place-items: center; aspect-ratio: 4 / 5; min-height: 240px; max-height: 240px; overflow: hidden; padding: 0; }
.card-prod img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; cursor: zoom-in; border-radius: 10px; }
.card-prod h3 { margin: 0; font-size: 16px; color: var(--text); }
.card-prod h3 a { color: inherit; text-decoration: none; }
.card-prod h3 a:hover { color: #3170B2; text-decoration: underline; }
.card-prod .price { font-weight: 700; color: var(--text); }
.card-prod .rating { color: #f5a524; font-weight: 700; }
.card-prod .buy-link { background: #3170B2 !important; color: #fff; border: 1px solid rgba(49,112,178,0.55); border-radius: 10px; padding: 9px; cursor: pointer; font-weight: 800; width: 100%; text-align: center; text-decoration: none; box-shadow: 0 10px 22px rgba(49,112,178,0.18); margin-top: auto; }
.card-prod .buy-link:hover { transform: translateY(-1px); }
.badge { display: inline-block; padding: 4px 8px; border-radius: 10px; font-weight: 800; font-size: 11px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); box-shadow: none; }
.badge.offer { background: #fff4f0; color: #c0392b; border-color: #ffd6c7; }
.card-top .badge.offer { position: absolute; top: 10px; right: 10px; z-index: 2; box-shadow: 0 6px 12px rgba(0,0,0,0.05); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface-soft); border-radius: 10px; padding: 8px 12px; border: 1px solid var(--border); font-weight: 700; color: var(--muted); text-decoration: none; box-shadow: none; }
.chip.active { background: #3170B2; color: #fff; border-color: #3170B2; }

.sub-hero { margin-top: 10px; background: var(--surface); border: 1px solid var(--border); padding: 16px; border-radius: 14px; }
.sub-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.filters-bar { margin-top: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow); }
.field.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.switch input { accent-color: #3170B2; }
.sorter { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px; font-weight: 600; }

.product-hero { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.ph-media { background: var(--surface-soft); border-radius: 16px; min-height: 280px; display: grid; place-items: center; }
.ph-media img { max-width: 90%; max-height: 240px; object-fit: contain; }
.ph-info h1 { margin: 6px 0; }
.price-line { display: flex; gap: 12px; align-items: center; font-size: 22px; font-weight: 800; }
.rating { color: #f5a524; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.checkout { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.step { text-align: center; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.step.active { background: #ffffff; border-color: #3170B2; color: var(--text); }
.checkout-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 12px; }
.card-form { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.card-form label { display: grid; gap: 6px; font-weight: 700; color: var(--text); }
.card-form input, .card-form select, .card-form textarea { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.wizard-actions { display: flex; gap: 8px; justify-content: flex-end; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 10px; height: fit-content; }
.summary-list { display: grid; gap: 10px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.summary-row.total { border: none; font-size: 18px; font-weight: 800; }

.success { margin-top: 20px; display: grid; place-items: center; }
.success-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; max-width: 560px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.order-summary { margin-top: 12px; text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.order-summary ul { padding-left: 16px; }

.cart-panel { position: fixed; top: 0; right: 0; width: 360px; height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0,0,0,0.08); display: grid; grid-template-rows: auto 1fr auto; z-index: 30; transform: translateX(0); transition: transform 0.2s ease, opacity 0.18s ease; }
.cart-panel.hidden { transform: translateX(40px); opacity: 0; pointer-events: none; }
.cart-head, .cart-foot { padding: 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.cart-list { padding: 12px; overflow-y: auto; display: grid; gap: 10px; }
.cart-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.qty-col { display: grid; grid-template-columns: repeat(3, auto); gap: 6px; align-items: center; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.toast { position: fixed; top: 18px; right: 18px; background: #14c38e; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(-10px); }

.btn { border: none; cursor: pointer; border-radius: 12px; padding: 12px 16px; font-weight: 800; font-size: 15px; }
.btn { display: inline-block; text-decoration: none; text-align: center; }
.btn.primary { background: #3170B2; color: #fff; box-shadow: 0 12px 24px rgba(49,112,178,0.26); }
.btn.secondary { background: #e8f9ef; color: #1fa46d; border: 1px solid #c9f1dc; }
.btn.soft { background: var(--surface); color: #3170B2; border: 1px solid var(--border); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); display: none; grid-template-columns: repeat(4, 1fr); box-shadow: 0 -10px 24px rgba(0,0,0,0.05); z-index: 40; }
.bn-item { padding: 10px 4px; text-align: center; color: var(--muted); text-decoration: none; font-weight: 700; display: grid; gap: 4px; place-items: center; }
.bn-item svg { width: 22px; height: 22px; fill: currentColor; }
.bn-item.active { color: #3170B2; }

.form-block { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.account-form { display: grid; gap: 10px; }
.account-form label { display: grid; gap: 6px; font-weight: 700; color: var(--text); }
.account-form input, .account-form textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }

.footer { margin-top: 20px; padding: 16px 6px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.added-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: grid; place-items: center; z-index: 60; transition: opacity 0.2s ease; }
.added-modal.hidden { opacity: 0; pointer-events: none; }
.added-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; width: min(420px, 92vw); box-shadow: var(--shadow); display: grid; gap: 10px; }
.added-title { font-size: 20px; font-weight: 800; color: #3170B2; }
.added-body { display: grid; gap: 4px; }
.added-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 8px; }

.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-soft); }

@media (max-width: 980px) {
  .vzr-topbar { grid-template-columns: auto 1fr auto; position: static; border-radius: 12px; }
  .desktop-tabs { display: none; }
  .hero-banner { grid-template-columns: 1fr; }
  .product-hero { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .cart-panel { width: 100%; }
  .bottom-nav { display: grid; }
  .app-shell { padding-bottom: 100px; }
}

@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .card-prod .thumb { min-height: 260px; max-height: 420px; }
}

@media (min-width: 900px) {
  .card-prod .thumb { aspect-ratio: 4 / 3; min-height: 230px; max-height: 300px; padding: 10px; }
}
