/* =========================================================
   bricco.cl · store.css — layout público, header, footer, tarjetas
   ========================================================= */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--color-dark); color: #fff; padding: 10px 16px; border-radius: var(--radius); transition: top var(--transition); }
.skip-link:focus { top: 8px; }
.muted { color: var(--gray-500); }
.section { padding-block: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; }
.section-head h2 em { font-style: normal; color: var(--color-sale); }
.link-more { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--color-primary-bright); }
.link-more:hover { text-decoration: underline; }
.chip-sale { margin-left: 8px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--color-sale); background: #FFE4EA; border-radius: var(--radius-pill); vertical-align: middle; }

.btn-accent { background: var(--color-orange); color: var(--color-navy); font-weight: 600; }
.btn-accent:hover { background: var(--color-orange-strong); }
.btn-lg { padding: 14px 28px; }
.btn-outline { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--gray-300); border-radius: var(--radius-pill); background: #fff; font-weight: 500; font-size: 14px; }
.btn-outline:hover { border-color: var(--color-dark); }
.btn-ghost { background: none; border: 0; color: var(--gray-500); text-decoration: underline; font-size: 14px; padding: 8px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--color-dark); }
.icon-btn:hover { background: var(--gray-100); }

/* ---------- Top bar ---------- */
.topbar { background: var(--color-navy); color: #fff; font-size: 12px; border-bottom: 2px solid var(--color-orange); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 34px; }
.topbar-messages { position: relative; flex: 1; height: 34px; }
.topbar-msg { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transform: translateY(8px); transition: opacity 300ms, transform 300ms; }
.topbar-msg.is-active { opacity: 1; transform: none; }
.topbar-links { display: flex; gap: 20px; }
.topbar-links a { color: rgba(255,255,255,.85); text-decoration: none; }
.topbar-links a:hover { color: #fff; text-decoration: underline; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--gray-200); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.header-menu-btn { display: none; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-img { display: block; height: 28px; width: auto; }
.logo-img-footer { margin-bottom: 14px; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: #fff; }
.logo-text { margin: 0; font-size: 22px; font-weight: 600; color: var(--color-navy); }
.logo-text sup { font-size: 10px; margin-left: 1px; }
.logo-text-light { color: #fff; }
.cats-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: var(--radius-pill); background: var(--color-primary); color: #fff; font-weight: 500; font-size: 14px; flex: none; transition: background var(--transition); }
.cats-btn:hover, .cats-btn[aria-expanded="true"] { background: var(--color-primary-strong); }

.search { position: relative; flex: 1; min-width: 0; display: flex; }
.search-input { width: 100%; height: 44px; padding: 0 52px 0 18px; border: 1px solid var(--gray-200); border-radius: var(--radius-pill); background: var(--gray-50); font-size: 14px; transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.search-input:focus { outline: 0; background: #fff; border-color: var(--color-primary-bright); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-btn { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--color-primary); color: #fff; }
.search-btn:hover { background: var(--color-primary-strong); }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px; max-height: 70vh; overflow: auto; }
.sr-title { margin: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--gray-400); }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius); text-decoration: none; color: var(--color-dark); font-size: 14px; }
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--gray-100); }
.sr-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--gray-100); }
.sr-item small { display: block; color: var(--gray-500); }
.sr-item b { margin-left: auto; font-weight: 600; white-space: nowrap; }
.sr-empty { padding: 16px; color: var(--gray-500); font-size: 14px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); color: var(--color-dark); text-decoration: none; position: relative; list-style: none; cursor: pointer; }
.header-link:hover { background: var(--gray-100); }
.header-link-text { font-size: 13px; font-weight: 500; line-height: 1.2; }
.header-link-text small { display: block; font-weight: 400; color: var(--gray-500); font-size: 11px; }
.cart-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--color-orange); color: var(--color-navy); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.user-menu { position: relative; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; padding: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: grid; gap: 2px; z-index: 80; }
.user-menu-panel a, .user-menu-panel button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: none; text-align: left; text-decoration: none; color: var(--color-dark); font-size: 14px; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--gray-100); }

/* Mega menú */
.mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-lg); }
.mega[hidden] { display: none; }
.mega-inner { display: grid; }
.mega-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 260px 1fr; min-height: 320px; }
.mega-item { display: contents; }
.mega-root { grid-column: 1; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 500; font-size: 14px; color: var(--color-dark); text-decoration: none; border-radius: var(--radius); margin: 2px 8px 2px 0; }
.mega-item.is-active .mega-root, .mega-root:hover { background: var(--gray-100); color: var(--color-primary); }
.mega-sub { display: none; grid-column: 2; grid-row: 1 / span 12; padding: 16px 24px; }
.mega-item.is-active .mega-sub { display: block; }
.mega-sub-title { margin: 0 0 12px; font-weight: 600; color: var(--color-navy); font-size: 18px; }
.mega-sub ul { list-style: none; margin: 0; padding: 0; columns: 3; gap: 24px; }
.mega-sub li { break-inside: avoid; }
.mega-sub a { display: block; padding: 6px 0; font-size: 14px; color: var(--color-dark); text-decoration: none; }
.mega-sub a:hover { color: var(--color-primary-bright); text-decoration: underline; }
.mega-all { font-weight: 600; color: var(--color-primary) !important; }

.quicknav { border-top: 1px solid var(--gray-100); }
.quicknav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.quicknav a { flex: none; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--color-dark); text-decoration: none; border-bottom: 2px solid transparent; transition: border-color var(--transition), color var(--transition); }
.quicknav a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.quicknav .quicknav-sale { color: var(--color-sale); }

/* Drawer (menú móvil y filtros) */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15,30,70,.45); }
.drawer-backdrop[hidden] { display: none; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; width: min(86vw, 340px); background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform 280ms ease; }
.drawer[hidden] { display: none; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--gray-200); }
.drawer-body { overflow-y: auto; padding: 8px 16px 24px; }
.drawer-group summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-weight: 500; cursor: pointer; list-style: none; border-bottom: 1px solid var(--gray-100); }
.drawer-group summary::-webkit-details-marker { display: none; }
.drawer-group ul { list-style: none; margin: 0; padding: 4px 0 8px 12px; }
.drawer-group a, .drawer-link { display: block; padding: 10px 0; color: var(--color-dark); text-decoration: none; font-size: 14px; }
.drawer-link { font-weight: 500; border-bottom: 1px solid var(--gray-100); padding: 14px 0; }

/* ---------- Hero ---------- */
.hero { position: relative; max-width: 1600px; margin: 0 auto; overflow: hidden; background: var(--gray-100); }
.hero-track { position: relative; aspect-ratio: 1600 / 560; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 600ms ease, visibility 600ms; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-caption { position: absolute; left: clamp(16px, 5vw, 80px); bottom: clamp(16px, 6vw, 72px); display: grid; gap: 4px; max-width: 480px; padding: 16px 20px; border-radius: var(--radius-lg); background: rgba(15,30,70,.65); color: #fff; backdrop-filter: blur(6px); }
.hero-caption strong { font-size: clamp(18px, 3vw, 32px); font-weight: 600; line-height: 1.15; }
.hero-caption span { font-size: clamp(12px, 1.5vw, 16px); opacity: .9; }
.hero-arrow { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--color-dark); display: grid; place-items: center; box-shadow: var(--shadow); transition: background var(--transition); }
.hero-arrow:hover { background: #fff; }
.hero-prev { left: 16px; } .hero-next { right: 16px; }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 8px; }
.hero-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.6); transition: width var(--transition), background var(--transition); }
.hero-dot.is-active { width: 28px; border-radius: 5px; background: #fff; }

/* ---------- Tarjeta de producto ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-products { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); }
.card:hover { box-shadow: var(--shadow); border-color: var(--gray-200); transform: translateY(-2px); }
.card-media { position: relative; display: block; aspect-ratio: 1; background: #fff; overflow: hidden; }
.card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 300ms ease, transform 400ms ease; }
.card-img-alt { opacity: 0; }
.card:hover .card-img-alt { opacity: 1; }
.card:hover .card-img:not(.card-img-alt) { transform: scale(1.03); }
.badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: #fff; }
.badge-sale { background: var(--color-sale); }
.badge-out { background: var(--gray-500); }
.badge-inline { position: static; display: inline-block; font-size: 13px; }
.card-fav { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--gray-500); box-shadow: var(--shadow-sm); transition: color var(--transition), transform var(--transition); }
.card-fav:hover { color: var(--color-sale); transform: scale(1.08); }
.card-fav.is-active { color: var(--color-sale); }
.card-fav.is-active .icon { fill: currentColor; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 16px; flex: 1; }
.card-brand { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--gray-500); }
.card-title { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card-title a { color: var(--color-dark); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-fav, .badge { z-index: 3; }
.card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.price-final { font-size: 18px; font-weight: 700; color: var(--color-navy); }
.price-final.is-sale { color: var(--color-sale); }
.price-normal { font-size: 13px; color: var(--gray-400); }
.swatches { display: flex; gap: 6px; list-style: none; margin: 6px 0 0; padding: 0; align-items: center; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); border: 1px solid rgba(0,0,0,.15); }
.swatch-more { font-size: 11px; color: var(--gray-500); }
.card-big .card-title { font-size: 15px; }

/* ---------- Carrusel horizontal (scroller) ---------- */
.scroller { position: relative; }
.scroller-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px; }
.scroller-track::-webkit-scrollbar { display: none; }
.scroller-item { flex: 0 0 calc((100% - 60px) / 4); scroll-snap-align: start; }
.scroller-btn { position: absolute; top: 40%; z-index: 4; width: 44px; height: 44px; border: 1px solid var(--gray-200); border-radius: 50%; background: #fff; color: var(--color-dark); display: grid; place-items: center; box-shadow: var(--shadow); }
.scroller-btn:hover { background: var(--gray-50); }
.scroller-prev { left: -14px; } .scroller-next { right: -14px; }

/* ---------- Beneficios y chips ---------- */
.benefits { background: var(--gray-50); border-block: 1px solid var(--gray-100); margin-top: 24px; }
.benefits-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 28px; }
.benefit { display: flex; align-items: center; gap: 14px; color: var(--color-primary); }
.benefit strong { display: block; font-size: 14px; color: var(--color-navy); }
.benefit span { font-size: 13px; color: var(--gray-500); }
.term-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.term-chips a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-pill); background: var(--gray-100); color: var(--color-dark); text-decoration: none; font-size: 14px; font-weight: 500; transition: background var(--transition); }
.term-chips a:hover { background: var(--color-accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: var(--color-navy); color: rgba(255,255,255,.8); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-block: 48px; }
.site-footer h3 { margin: 0 0 14px; color: #fff; font-size: 14px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-pay-title { margin-top: 24px !important; }
.pay-chips { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
.pay-chips li { padding: 4px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-pill); font-size: 12px; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1); }
.social a:hover { background: rgba(255,255,255,.2); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-block: 18px; font-size: 13px; text-align: center; }

/* ---------- Toast ---------- */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 12px 20px; border-radius: var(--radius-pill); background: var(--color-dark); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in 250ms ease-out both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .grid-4, .grid-products { grid-template-columns: repeat(3, 1fr); }
  .scroller-item { flex-basis: calc((100% - 40px) / 3); }
}
@media (max-width: 1023px) {
  .cats-btn { display: none; }
  .header-menu-btn { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-links { display: none; }
  .header-link-text { display: none; }
}
@media (max-width: 767px) {
  .header-inner { flex-wrap: wrap; min-height: 0; padding-block: 10px; gap: 8px 8px; }
  .logo { order: 2; margin-right: auto; }
  .header-menu-btn { order: 1; }
  .header-actions { order: 3; }
  .search { order: 4; flex-basis: 100%; }
  .hero-track { aspect-ratio: 4 / 3; }
  .hero-arrow { display: none; }
  .grid-4, .grid-products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .scroller-item { flex-basis: 62%; }
  .scroller-btn { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding-block: 24px; }
}
@media (max-width: 480px) {
  .benefits-grid { grid-template-columns: 1fr; }
}

/* ---------- Carro lateral ---------- */
.cart-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15,30,70,.45); }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(94vw, 420px); display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 280ms ease; }
.cart-drawer.is-open { transform: none; }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--gray-200); display: grid; gap: 10px; text-align: center; }
.cart-drawer-foot .btn { width: 100%; }
.cart-drawer-total { display: flex; justify-content: space-between; margin: 0; font-size: 15px; }
.cart-drawer-total strong { font-size: 20px; }
.dr-empty { display: grid; justify-items: center; gap: 10px; padding: 56px 8px; text-align: center; color: var(--gray-500); }
.dr-ship { margin: 8px 0 4px; font-size: 13px; }
.dr-ship .ship-track { margin-top: 6px; }
.dr-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.dr-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); background: var(--gray-100); }
.dr-name { margin: 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.dr-name a { color: var(--color-dark); text-decoration: none; }
.dr-attrs { margin: 2px 0 6px; font-size: 12px; color: var(--gray-500); }
.dr-warn { margin: 0 0 6px; font-size: 12px; color: #B45309; }
.dr-qty { display: inline-flex; align-items: center; border: 1px solid var(--gray-300); border-radius: var(--radius-pill); }
.dr-qty button { width: 28px; height: 28px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; }
.dr-qty button:disabled { opacity: .35; }
.dr-qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 600; }
.dr-price { text-align: right; font-size: 14px; font-weight: 700; }
.dr-price s { display: block; font-size: 12px; font-weight: 400; color: var(--gray-400); }
.dr-remove { margin-top: 8px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--gray-500); text-decoration: underline; }

/* Aviso para el administrador cuando el sitio está en construcción */
.maint-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; background: #F59E0B; color: #1F2937; font-size: 13px; }
.maint-bar a { color: #1F2937; font-weight: 600; }

/* Banners con el texto dentro de la imagen: el título queda solo para lectores de pantalla */
.hero-slide.is-art .hero-caption, .promo-tile.is-art .promo-tile-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; background: none; }
