/**
 * CSS compartido por las 5 plantillas de tienda (store-*.html) Y las 5
 * mini-landings de producto (product*.html) — el chrome del sitio (header/
 * nav/footer/carrito/checkout) es ahora el MISMO componente en las 10, así
 * que vive en un solo archivo. La diferenciación visual real entre
 * plantillas vive en [data-template="..."] y en la paleta/tipografía que
 * ya inyecta el SSR (store.js/share.js) como variables CSS — el contenido
 * propio de cada plantilla (galería, tarjeta de precio, catálogo) sigue
 * viviendo en el <style> inline de cada archivo.
 *
 * Rediseño 2026-09: terminación "tienda seria de viajes", no plantilla
 * genérica — header sticky con jerarquía real, nav con estado activo,
 * footer a columnas, tarjetas con elevación al hover.
 */
:root {
    --primary: #1a3a5c;
    --accent: #1a73e8;
    --surface: #f5f7fa;
    --bg: #f5f7fa;
    --text: #0f172a;
    --shadow-sm: 0 1px 3px rgba(15,23,42,.08);
    --shadow-md: 0 8px 24px rgba(15,23,42,.12);
    --radius: 12px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---- Header: sticky, dos niveles (marca+acciones / nav) ---- */
.store-header {
    position: sticky; top: 0; z-index: 500;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.store-header a { color: #fff; text-decoration: none; }
.store-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px; max-width: 1280px; margin: 0 auto;
}
.store-header-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size:calc(19px * var(--font-scale, 1)); letter-spacing: -.2px; }
.store-header-brand img { height: 38px; width: auto; border-radius: 6px; }
.store-header-actions { display: flex; align-items: center; gap: 18px; }
body[data-header-style="centered"] .store-header-inner { flex-direction: column; gap: 10px; text-align: center; }

.store-nav-bar {
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    padding: 10px 28px; max-width: 1280px; margin: 0 auto;
    background: rgba(255,255,255,.06);
    border-top: 1px solid rgba(255,255,255,.12);
}
.store-nav-link {
    font-size:calc(13px * var(--font-scale, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
    text-decoration: none; opacity: .85; position: relative; padding: 2px 0;
    transition: opacity .15s;
}
/* Especificidad: ".store-header a" (clase+elemento) le gana a una sola
   clase, así que estos colores necesitan ir calificados con ".store-header"
   para no quedar pisados por ese fallback genérico. */
.store-header .store-nav-link,
.store-header .store-nav-home { color: var(--menu-link-color, #fff); }
.store-nav-link::after {
    content: ''; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px;
    background: var(--menu-link-color, #fff); transition: right .2s ease;
}
.store-nav-link:hover { opacity: 1; }
.store-nav-link:hover::after, .store-nav-home::after { right: 0; }
.store-nav-home { opacity: 1; }

/* Dropdown fijo "Categorías" — se abre por :hover/:focus-within, sin JS
   (mismo criterio CSP del resto del storefront: nada de onclick inline). */
.store-categories-dropdown { position: relative; }
.store-categories-toggle {
    background: none; border: none; cursor: pointer; font-family: inherit;
}
.store-categories-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 600;
    min-width: 200px; margin-top: 8px; padding: 8px 0;
    background: #fff; color: var(--submenu-link-color, #0f172a); border-radius: 8px;
    box-shadow: var(--shadow-md); text-transform: none;
}
.store-categories-dropdown:hover .store-categories-menu,
.store-categories-dropdown:focus-within .store-categories-menu { display: block; }
.store-categories-item {
    display: block; padding: 8px 16px; font-size:calc(13.5px * var(--font-scale, 1)); font-weight: 500;
    text-decoration: none; white-space: nowrap;
}
/* Mismo motivo que .store-nav-link: el dropdown cuelga de .store-header,
   así que ".store-header a" le gana en especificidad a una sola clase. */
.store-header .store-categories-item { color: var(--submenu-link-color, #0f172a); }
.store-categories-item:hover { background: var(--surface); }

/* Header/nav/footer personalizables (frontend/js/landing-header.js) */
.landing-nav-row { display: flex; gap: 22px; flex-wrap: wrap; }
.landing-social-row { display: flex; gap: 12px; }
.landing-social-link { font-size:calc(18px * var(--font-scale, 1)); text-decoration: none; opacity: .9; transition: opacity .15s, transform .15s; }
.landing-social-link:hover { opacity: 1; transform: translateY(-2px); }
.landing-phones-row { display: flex; gap: 14px; flex-wrap: wrap; font-size:calc(13px * var(--font-scale, 1)); opacity: .85; }

.store-cart-toggle { position: relative; background: none; border: none; color: #fff; font-size:calc(21px * var(--font-scale, 1)); cursor: pointer; padding: 4px; }
.store-cart-badge {
    position: absolute; top: -4px; right: -8px; background: var(--accent); color: #fff;
    border-radius: 999px; font-size:calc(11px * var(--font-scale, 1)); padding: 1px 6px; font-weight: 700; min-width: 16px; text-align: center;
}

/* ---- Sections genéricas ---- */
.store-section { max-width: var(--content-max-width, 1180px); margin: 0 auto; padding: 44px 20px; }
.store-section h2, .store-section h3 { margin: 0 0 20px; color: var(--heading-color, var(--primary)); font-weight: 800; letter-spacing: -.3px; }

.store-banner {
    background-size: cover; background-position: center; color: #fff; max-width: none;
    padding: 110px 20px; text-align: center; position: relative;
}
.store-banner::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.35), rgba(15,23,42,.6));
}
.store-banner-content { max-width: 700px; margin: 0 auto; position: relative; }
.store-banner h2 { color: #fff; font-size:calc(42px * var(--font-scale, 1)); font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.store-banner-content p { font-size:calc(17px * var(--font-scale, 1)); opacity: .95; }
.store-banner-cta {
    display: inline-block; margin-top: 20px; padding: 13px 32px; background: var(--accent);
    color: #fff; text-decoration: none; border-radius: 999px; font-weight: 700; letter-spacing: .3px;
    box-shadow: var(--shadow-md); transition: transform .15s, filter .15s;
}
.store-banner-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }

.store-category-grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.store-category-tile {
    border: none; border-radius: var(--radius); aspect-ratio: 4/3; background-color: var(--surface);
    background-size: cover; background-position: center; cursor: pointer; position: relative; overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.store-category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.store-category-tile span {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.7));
    color: #fff; font-size:calc(14px * var(--font-scale, 1)); font-weight: 700; text-align: left;
}

.store-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.store-product-card {
    border: 1px solid #e5e7eb; border-radius: var(--radius); overflow: hidden; background: #fff;
    display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
}
.store-product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.store-product-thumb { aspect-ratio: 4/3; background-color: var(--surface); background-size: cover; background-position: center; display: block; }
.store-product-body { padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.store-product-category { font-size:calc(11px * var(--font-scale, 1)); text-transform: uppercase; letter-spacing: .5px; color: var(--accent); font-weight: 700; }
.store-product-name { text-decoration: none; color: var(--text); font-weight: 700; font-size:calc(15.5px * var(--font-scale, 1)); line-height: 1.35; }
.store-product-price { font-weight: 800; color: var(--primary); font-size:calc(16px * var(--font-scale, 1)); }
.store-add-cart-btn {
    margin-top: 6px; padding: 10px; background: var(--accent); color: #fff; border: none;
    border-radius: 8px; cursor: pointer; font-weight: 700; transition: filter .15s;
}
.store-add-cart-btn:hover { filter: brightness(1.08); }

.store-catalog-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.store-catalog-toolbar input, .store-catalog-toolbar select {
    padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size:calc(14px * var(--font-scale, 1));
}
.store-catalog-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.store-page-btn { padding: 7px 13px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; cursor: pointer; }
.store-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.store-text p { line-height: 1.7; font-size:calc(15.5px * var(--font-scale, 1)); }

.store-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 36px; }
.store-related-heading { font-size:calc(20px * var(--font-scale, 1)); font-weight: 800; color: var(--heading-color, var(--primary)); margin: 0 0 18px; }

/* Filas de columnas */
.store-row { display: grid; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 32px 20px; }
.store-row-row-1 { grid-template-columns: 1fr; }
.store-row-row-2-50-50 { grid-template-columns: 1fr 1fr; }
.store-row-row-2-66-34 { grid-template-columns: 2fr 1fr; }
.store-row-row-2-34-66 { grid-template-columns: 1fr 2fr; }
.store-row-row-3-equal { grid-template-columns: 1fr 1fr 1fr; }
.store-row-col .store-section { padding: 0; max-width: none; }
@media (max-width: 720px) { .store-row { grid-template-columns: 1fr !important; } }

/* Sidebar en catálogo (solo plantilla eshop, ver data-template) */
body[data-template="eshop"] .store-catalog { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
body[data-template="eshop"] .store-catalog-toolbar { flex-direction: column; grid-column: 1; }
body[data-template="eshop"] #storeCatalogGrid { grid-column: 2; }
body[data-template="eshop"][data-sidebar-style="right"] .store-catalog-toolbar { grid-column: 2; }
body[data-template="eshop"][data-sidebar-style="right"] #storeCatalogGrid { grid-column: 1; }

/* ---- Footer: 3 columnas ---- */
.store-footer { background: var(--primary); color: rgba(255,255,255,.92); margin-top: 48px; }
.store-footer-inner {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px;
    max-width: 1180px; margin: 0 auto; padding: 44px 24px 24px;
}
.store-footer-brand { font-size:calc(18px * var(--font-scale, 1)); font-weight: 800; color: #fff; display: block; margin-bottom: 8px; }
.store-footer-address { font-size:calc(13.5px * var(--font-scale, 1)); opacity: .85; line-height: 1.6; margin: 0; }
.store-footer-col { display: flex; flex-direction: column; gap: 10px; }
.store-footer .landing-social-row { margin-bottom: 4px; }
.store-footer-copy {
    text-align: center; font-size:calc(12.5px * var(--font-scale, 1)); opacity: .7; margin: 0;
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.15);
}
body[data-footer-style="minimal"] .store-footer-inner { grid-template-columns: 1fr; text-align: center; gap: 14px; padding: 24px 20px 12px; }
body[data-footer-style="minimal"] .store-footer-col { align-items: center; }
@media (max-width: 720px) { .store-footer-inner { grid-template-columns: 1fr; text-align: center; } .store-footer-col { align-items: center; } }

/* ---- Carrito (drawer) ---- */
.store-cart-drawer {
    position: fixed; top: 0; right: -380px; width: 380px; max-width: 90vw; height: 100vh;
    background: #fff; box-shadow: -4px 0 24px rgba(15,23,42,.18); z-index: 1000;
    display: flex; flex-direction: column; transition: right .28s ease;
}
.store-cart-drawer.open { right: 0; }
.store-cart-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid #e5e7eb; }
.store-cart-drawer-header strong { font-size:calc(16px * var(--font-scale, 1)); }
.store-cart-body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.store-cart-empty { color: #94a3b8; text-align: center; margin-top: 40px; font-size:calc(14px * var(--font-scale, 1)); }
.store-cart-item { display: grid; grid-template-columns: 1fr 60px 90px 24px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size:calc(13px * var(--font-scale, 1)); }
.store-cart-item-name { font-weight: 600; }
.store-cart-item-qty { width: 55px; padding: 5px; border: 1px solid #cbd5e1; border-radius: 6px; }
.store-cart-item-remove { border: none; background: none; color: #dc2626; font-size:calc(18px * var(--font-scale, 1)); cursor: pointer; }
.store-cart-footer { padding: 18px 20px; border-top: 1px solid #e5e7eb; }
.store-cart-total { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 14px; font-size:calc(15px * var(--font-scale, 1)); }
.store-checkout-btn { width: 100%; padding: 13px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: filter .15s; }
.store-checkout-btn:hover { filter: brightness(1.08); }
.store-close-btn { border: none; background: none; font-size:calc(22px * var(--font-scale, 1)); cursor: pointer; color: #64748b; line-height: 1; }

/* ---- Checkout (modal) ---- */
.store-checkout-modal {
    position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 1100;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.store-checkout-modal.open { display: flex; }
.store-checkout-box { background: #fff; border-radius: var(--radius); padding: 28px; width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.store-checkout-box h3 { margin: 0; font-size:calc(18px * var(--font-scale, 1)); }
.store-checkout-box .form-group { margin-bottom: 14px; }
.store-checkout-box label { display: block; font-size:calc(13px * var(--font-scale, 1)); font-weight: 700; margin-bottom: 5px; }
.store-checkout-box input, .store-checkout-box textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size:calc(14px * var(--font-scale, 1)); }

/* ---- Toast ---- */
.store-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 999px; font-size:calc(14px * var(--font-scale, 1));
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1200; box-shadow: var(--shadow-md);
}
.store-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
