/* ==========================================================
   CIAP Informática - Estilos
   La página no se desplaza: la cabecera queda fija y cada
   vista ocupa el resto de la pantalla.
   ========================================================== */

:root {
    /* Paleta del logo. El panel puede cambiar --blue y --cyan; los tonos derivados se calculan solos */
    --blue: #26308f;
    --cyan: #00adef;
    --blue-dark: color-mix(in srgb, var(--blue) 78%, #000);
    --blue-50: color-mix(in srgb, var(--blue) 8%, #fff);
    --ink: #171c3a;
    --text: #3a4656;
    --muted: #6b7786;
    --line: #e3e8ee;
    --bg: #f4f6f9;
    --white: #fff;
    --red: #e5383b;
    --green: #1a9d5a;
    --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --head: 'Poppins', var(--font);
    --shadow: 0 10px 28px rgba(16, 40, 80, .12);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0; color: var(--ink); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.ic { width: 1.25em; height: 1.25em; flex: none; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
.pad { padding-block: 20px; }
.muted { color: var(--muted); }
.w-100 { width: 100%; }

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 3px;
    background: var(--blue-50);
    color: var(--blue);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    font-family: var(--head);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}
.btn-solid { background: var(--blue); color: var(--white); }
.btn-solid:hover { background: var(--blue-dark); }
.btn-solid:disabled { background: #b3c0d1; }
.btn-line { background: var(--white); border-color: var(--blue); color: var(--blue); }
.btn-line:hover { background: var(--blue); color: var(--white); }
.btn-line:disabled { border-color: var(--line); color: #a3aebc; background: var(--bg); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    font-size: 18px;
    transition: border-color .2s, color .2s;
}
.icon-btn > span:first-child { display: grid; }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }

.count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--white);
    border-radius: 10px;
    background: var(--red);
    color: var(--white);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
}

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; }

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--blue); }

/* ==========================================================
   Cabecera
   ========================================================== */
.top { position: relative; z-index: 30; background: var(--white); }

/* Franja de contacto */
.util { background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.util-row { display: flex; align-items: center; gap: 22px; height: 34px; }
.util-item { display: inline-flex; align-items: center; gap: 6px; }
.util-item .ic { color: var(--cyan); }
/* Un dato vacío en el panel no deja su ícono suelto */
.util-item:has(> span:last-child:empty) { display: none; }
.util-item > span:first-child { display: grid; }
.util-right { margin-left: auto; }

/* Marca, buscador y carrito */
.head { display: flex; align-items: center; gap: 28px; height: 78px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: auto; height: 60px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--head); font-size: 26px; font-weight: 700; color: var(--ink); }
.brand-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }

.search {
    flex: 1;
    display: flex;
    max-width: 660px;
    height: 46px;
    margin-inline: auto;
    border: 2px solid var(--blue);
    border-radius: 6px;
    background: var(--white);
    overflow: hidden;
}
.search select { max-width: 180px; padding: 0 10px 0 14px; border: 0; border-right: 1px solid var(--line); background: var(--bg); font-size: 13.5px; outline-offset: -2px; }
.search input { flex: 1; min-width: 0; padding: 0 14px; border: 0; outline: 0; background: none; color: var(--ink); }
.search-btn { display: flex; align-items: center; gap: 8px; padding: 0 22px; background: var(--blue); color: var(--white); font-family: var(--head); font-weight: 600; font-size: 14px; transition: background .2s; }
.search-btn:hover { background: var(--blue-dark); }
.search-btn > span:first-child { display: grid; font-size: 16px; }

.actions { display: flex; align-items: center; gap: 12px; flex: none; }
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--blue);
    color: var(--white);
    text-align: left;
    transition: background .2s;
}
.cart-btn:hover { background: var(--blue-dark); }
.cart-btn > span:first-child { display: grid; font-size: 21px; }
.cart-txt { display: flex; flex-direction: column; line-height: 1.2; }
.cart-txt small { font-size: 11px; opacity: .85; }
.cart-txt b { font-family: var(--head); font-size: 14px; font-weight: 600; white-space: nowrap; }
.burger { display: none; }

/* Menú */
.navbar { border-block: 1px solid var(--line); }
.nav-row { display: flex; align-items: stretch; gap: 10px; height: 48px; }

.cats { position: relative; flex: none; }
.cats-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    height: 100%;
    padding: 0 18px;
    background: var(--blue);
    color: var(--white);
    font-family: var(--head);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.cats-btn > span:first-child { display: grid; font-size: 17px; }
.cats-menu {
    position: absolute;
    z-index: 40;
    top: 100%;
    left: 0;
    display: none;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.cats.open .cats-menu { display: block; }
.cats-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; border-top: 1px solid var(--line); text-align: left; color: var(--ink); }
.cats-menu button:first-child { border-top: 0; }
.cats-menu button:hover { background: var(--blue-50); color: var(--blue); }
.cats-menu .ic { font-size: 17px; color: var(--blue); }
.cats-menu small { margin-left: auto; font-size: 12px; color: var(--muted); }

.nav { display: flex; }
.nav a {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-family: var(--head);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink);
    transition: color .2s;
}
.nav a:hover { color: var(--blue); }
.nav a[aria-current] { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }

.nav-help { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.nav-help > span:first-child { display: grid; font-size: 18px; color: var(--cyan); }
.nav-help b { color: var(--ink); }

/* ==========================================================
   Vistas
   ========================================================== */
.stage { min-height: 0; overflow: hidden; }
.view { display: none; height: 100%; overflow-y: auto; }
.view.active { display: block; animation: viewIn .25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.view-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.view-title h2 { font-size: 24px; font-weight: 700; padding-bottom: 6px; border-bottom: 3px solid var(--blue); }
.view-title .muted { font-size: 13.5px; }

/* ---------- Inicio ---------- */
.view-home.active { overflow: hidden; }
.home { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 14px; height: 100%; padding-block: 16px; }

/* Banner con láminas */
.hero { position: relative; min-height: 0; border-radius: 8px; background: linear-gradient(115deg, color-mix(in srgb, var(--blue) 5%, #fff) 0%, color-mix(in srgb, var(--blue) 17%, #fff) 100%); overflow: hidden; }
.slide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 24px; height: 100%; padding: 0 76px; animation: slideIn .4s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } }
.slide-copy { min-width: 0; }
.slide-tag { display: inline-block; margin-bottom: clamp(6px, 1.6vh, 14px); padding: 4px 10px; border-radius: 3px; background: var(--cyan); color: var(--white); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
/* El tamaño depende también del alto de la pantalla: el banner cabe sin desplazarse */
.slide h1 { font-size: clamp(24px, min(3.5vw, 6.2vh), 48px); font-weight: 700; line-height: 1.12; }
.slide h1 em { display: block; font-style: normal; color: var(--blue); }
.slide h1 button { font: inherit; color: inherit; text-align: left; }
.slide h1 button:hover { color: var(--blue); }
.slide p { max-width: 500px; margin-top: clamp(6px, 1.6vh, 14px); font-size: clamp(13.5px, 2.2vh, 16px); color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.slide .price { margin-top: clamp(6px, 1.6vh, 14px); }
.slide .price strong { font-size: clamp(22px, 4.4vh, 32px); }
.slide .price s { font-size: 15px; }
.slide .btn-row { margin-top: clamp(10px, 2.6vh, 22px); }

.slide-visual { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
/* La imagen se ajusta al alto del banner sin recortarse */
.slide-visual img { position: absolute; inset: 7% 0; width: 100%; height: 86%; border-radius: 8px; object-fit: contain; }
.slide-visual .slide-logo { inset: 3% 0; height: 94%; border-radius: 0; filter: drop-shadow(0 18px 26px rgba(23, 28, 58, .22)); }
/* Sin foto, el producto se representa con su ícono dentro de un círculo */
.orb { display: grid; place-items: center; border-radius: 50%; background: var(--white); color: var(--blue); box-shadow: 0 20px 50px rgba(10, 60, 130, .16); }
.orb .ic { stroke-width: 1.1; }
.orb-1 { width: min(36vh, 270px); aspect-ratio: 1; font-size: min(17vh, 124px); }
.orb-2, .orb-3 { position: absolute; width: min(12vh, 92px); aspect-ratio: 1; font-size: min(5.4vh, 40px); }
.orb-2 { top: 12%; right: 10%; }
.orb-3 { bottom: 12%; left: 12%; color: var(--ink); }

.hero-arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(16, 40, 80, .14);
    transition: background .2s, color .2s;
}
.hero-arrow:hover { background: var(--blue); color: var(--white); }
.hero-prev { left: 18px; }
.hero-next { right: 18px; }
.hero-dots { position: absolute; bottom: 12px; left: 50%; display: flex; gap: 7px; transform: translateX(-50%); }
.hero-dots button { width: 9px; height: 9px; border-radius: 5px; background: #b3c2d6; transition: width .25s, background .25s; }
.hero-dots button.active { width: 26px; background: var(--cyan); }

/* Beneficios */
.benefits-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.benefit { display: flex; align-items: center; gap: 12px; padding: clamp(9px, 1.8vh, 15px) 20px; border-left: 1px solid var(--line); min-width: 0; }
.benefit:first-child { border-left: 0; }
.benefit .ic { font-size: 30px; color: var(--cyan); stroke-width: 1.4; }
.benefit strong { display: block; font-family: var(--head); font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.benefit span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--muted); }

/* Accesos por categoría */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.cat-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: clamp(9px, 1.8vh, 15px) 13px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: left;
    transition: border-color .2s, box-shadow .2s;
}
.cat-tile:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.cat-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 22px; transition: background .2s, color .2s; }
.cat-tile:hover .cat-ic { background: var(--blue); color: var(--white); }
.cat-txt { min-width: 0; }
.cat-txt strong { display: block; font-family: var(--head); font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.cat-txt small { font-size: 12px; color: var(--muted); }

/* ---------- Catálogo ---------- */
.view-catalog.active { overflow: hidden; }
.catalog { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; height: 100%; padding-block: 16px; }

.cat-side { align-self: start; max-height: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.cat-side h3 { padding: 13px 18px; background: var(--blue); color: var(--white); font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }
.chips { display: flex; flex-direction: column; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); text-align: left; transition: background .2s, color .2s; }
.chip:first-child { border-top: 0; }
.chip:hover { background: var(--blue-50); color: var(--blue); }
.chip.active { color: var(--blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.chip small { padding: 1px 8px; border-radius: 10px; background: var(--bg); font-size: 11.5px; font-weight: 400; color: var(--muted); }

.catalog-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.catalog-bar { display: flex; align-items: center; gap: 12px; flex: none; margin-bottom: 14px; padding: 9px 12px 9px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.catalog-bar h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-bar .muted { font-size: 13px; white-space: nowrap; }
.catalog-bar select { width: auto; margin-left: auto; padding: 7px 10px; font-size: 13.5px; }
/* El margen interior deja sitio a la sombra de las tarjetas */
.catalog-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 6px 20px 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 16px; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

.card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 8px; transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 7px 7px 0 0; background: #f6f8fb; color: #8aa2c0; font-size: 62px; overflow: hidden; }
.thumb .ic { stroke-width: 1.1; transition: transform .3s, color .3s; }
.card:hover .thumb .ic { transform: scale(1.08); color: var(--blue); }
.thumb img, .modal-thumb img { width: 100%; height: 100%; padding: 10px; object-fit: contain; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.05); }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.is-out .thumb { opacity: .6; }

.tags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.tag { padding: 3px 8px; border-radius: 3px; background: var(--cyan); color: var(--white); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; line-height: 1.5; text-transform: uppercase; }
.tag-off { background: var(--red); }
.tag-out { background: #7b8794; }

.fav { position: absolute; z-index: 1; top: 8px; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--muted); font-size: 15px; transition: color .2s, border-color .2s; }
.fav:hover, .fav.active { color: var(--red); border-color: var(--red); }
.fav.active .ic { fill: currentColor; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; }
.card-cat { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 14.5px; line-height: 1.35; margin: 3px 0 5px; }
.card h3 button { font: inherit; color: inherit; text-align: left; }
.card h3 button:hover { color: var(--blue); }
.card-specs { margin-bottom: 10px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.card .price { margin-top: auto; }
.price strong { font-family: var(--head); font-size: 19px; font-weight: 700; color: var(--blue); }
.price s { font-size: 13px; color: var(--muted); }
.price-lg strong { font-size: 28px; }
.btn-cart { width: 100%; margin-top: 10px; padding: 8px 12px; font-size: 13px; }
.btn-cart .ic { font-size: 15px; }

/* ---------- Servicios ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service { display: flex; flex-direction: column; padding: 18px 20px 16px; transition: border-color .2s, box-shadow .2s; }
.service:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.service-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.service-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 22px; }
.service h3 { font-size: 16.5px; }
.service p { font-size: 13.5px; color: var(--muted); }
.service ul { margin: 8px 0 12px; font-size: 13.5px; }
.service li, .spec-list li { position: relative; padding-left: 20px; }
.service li::before, .spec-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.service-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.service-foot strong { font-family: var(--head); font-size: 17px; font-weight: 700; color: var(--blue); }

/* ---------- Nosotros y contacto ---------- */
.about, .contact { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; min-height: 100%; }
.about h2, .contact h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; }
.about p { margin-top: 12px; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 22px; }
.stats > div { padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.stats strong { display: block; font-family: var(--head); font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--blue); }
.stats span { font-size: 12.5px; color: var(--muted); }

.values { display: grid; gap: 12px; }
.value { display: flex; gap: 16px; padding: 18px 20px; }
.value > .ic { box-sizing: content-box; padding: 12px; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 20px; align-self: flex-start; }
.value h3 { font-size: 16px; margin-bottom: 3px; }
.value p { margin: 0; font-size: 13.5px; color: var(--muted); }

.contact h2 { margin-bottom: 8px; }
.contact-list { display: grid; gap: 14px; margin-top: 22px; }
.contact-list li { display: flex; gap: 14px; align-items: center; color: var(--ink); }
.contact-list .ic { box-sizing: content-box; padding: 11px; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: 17px; }
.contact-list strong { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 26px; box-shadow: var(--shadow); }
.form .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
.field textarea { resize: vertical; min-height: 96px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Carrito lateral ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(22, 32, 46, .5); }
.drawer {
    position: fixed;
    z-index: 50;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(400px, 100vw);
    background: var(--white);
    box-shadow: -14px 0 40px rgba(22, 32, 46, .2);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px; }
.drawer-body .icon-btn { width: 36px; height: 36px; border-color: transparent; font-size: 16px; color: var(--muted); }
.drawer-body .icon-btn:hover { color: var(--red); border-color: var(--line); }
.drawer-foot { padding: 16px 22px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-row strong { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--blue); }

.cart-empty { display: grid; justify-items: center; gap: 10px; padding: 70px 0; color: var(--muted); }
.cart-empty .ic { font-size: 42px; color: #b6c2d2; }
.cart-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 1px solid var(--line); border-radius: 6px; background: #f6f8fb; color: #8aa2c0; font-size: 26px; overflow: hidden; }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.cart-info strong { font-family: var(--head); font-weight: 600; line-height: 1.35; color: var(--ink); }
.cart-info .muted { color: var(--blue); font-weight: 600; }
.qty { display: inline-flex; align-items: center; align-self: flex-start; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
.qty button { display: grid; place-items: center; width: 30px; height: 28px; font-size: 12px; color: var(--blue); }
.qty button:disabled { color: #b6c2d2; }
.qty span { min-width: 26px; text-align: center; font-weight: 600; }

/* ---------- Detalle de producto ---------- */
.modal { width: min(780px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 0; border-radius: 10px; color: var(--text); box-shadow: 0 30px 80px rgba(22, 32, 46, .35); overflow: auto; }
.modal[open] { display: grid; grid-template-columns: .9fr 1fr; }
.modal::backdrop { background: rgba(22, 32, 46, .55); }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.modal-thumb { position: relative; display: grid; place-items: center; min-height: 280px; background: #f6f8fb; color: #8aa2c0; font-size: 120px; overflow: hidden; }
.modal-thumb .ic { stroke-width: .9; }
.modal-info { padding: 28px 26px 26px; }
.modal-info h2 { font-size: 21px; margin: 4px 44px 8px 0; }
.modal-info > p { font-size: 14px; color: var(--muted); }
.spec-list { display: grid; gap: 6px; margin: 14px 0 16px; font-size: 13.5px; }
.stock { display: flex; align-items: center; gap: 7px; margin: 6px 0 16px; font-size: 13px; font-weight: 600; color: var(--green); }
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.out { color: var(--red); }

/* ---------- Aviso y error de carga ---------- */
.toast {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 22px;
    padding: 11px 20px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--white);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
    transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.load-error { display: grid; place-items: center; height: 100%; margin: 0; padding: 24px; text-align: center; color: var(--muted); }

/* ==========================================================
   Pantallas bajas (portátiles): se oculta la franja de contacto
   ========================================================== */
@media (max-height: 720px) and (min-width: 861px) {
    .util { display: none; }
    .head { height: 68px; }
    .brand-logo { height: 54px; }
    .nav-row { height: 44px; }
    .home, .catalog { padding-block: 12px; gap: 12px; }
    .catalog { gap: 18px; }
    .pad { padding-block: 14px; }
    .slide p { -webkit-line-clamp: 2; }
    .service { padding: 14px 18px 12px; }
    .service ul { margin: 6px 0 10px; }
}

/* ==========================================================
   Tablet
   ========================================================== */
@media (max-width: 1100px) {
    .head { gap: 16px; }
    .cats-btn { min-width: 0; }
    .cats-menu { width: 240px; }
    .nav a { padding: 0 11px; }
    .nav-help { display: none; }
    .services { grid-template-columns: repeat(2, 1fr); }
    .about, .contact { gap: 28px; }
    .slide { padding: 0 62px; }
    .catalog { grid-template-columns: 210px minmax(0, 1fr); }
    .search select { display: none; }
}

/* ==========================================================
   Teléfono: menú hamburguesa
   ========================================================== */
@media (max-width: 860px) {
    .wrap { padding-inline: 14px; }
    .util { display: none; }

    .head { flex-wrap: wrap; gap: 10px; height: auto; padding-block: 10px; }
    .burger { display: inline-grid; }
    .icon-btn { width: 40px; height: 40px; }
    .brand-logo { height: 44px; }
    .brand-name { font-size: 22px; }
    .brand-sub { display: none; }
    .actions { gap: 8px; margin-left: auto; }
    .cart-btn { height: 40px; padding: 0 12px; }
    .cart-txt { display: none; }
    .search { order: 5; flex: 1 1 100%; max-width: none; height: 42px; }
    .search-txt { display: none; }
    .search-btn { padding: 0 16px; }

    /* El menú se despliega bajo la cabecera */
    .navbar { border: 0; }
    .nav-row { display: block; height: 0; }
    .cats { display: none; }
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--white);
        border-top: 1px solid var(--line);
        box-shadow: 0 20px 30px rgba(22, 32, 46, .16);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .nav.open { visibility: visible; opacity: 1; transform: none; }
    .nav a { padding: 15px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
    .nav a[aria-current] { background: var(--blue-50); box-shadow: inset 3px 0 0 var(--blue); }
    .top { border-bottom: 1px solid var(--line); }

    /* En teléfono cada vista se desplaza dentro de su espacio */
    .view-home.active, .view-catalog.active { overflow-y: auto; }
    .home, .catalog { display: block; height: auto; padding-block: 14px; }
    .home > * + * { margin-top: 12px; }

    .slide { grid-template-columns: minmax(0, 1fr); gap: 4px; height: auto; padding: 24px 20px 46px; }
    .slide h1 { font-size: clamp(24px, 7.4vw, 34px); }
    .slide p { font-size: 14.5px; margin-top: 10px; }
    .slide .price { margin-top: 10px; }
    .slide .price strong { font-size: 24px; }
    .slide .btn-row { margin-top: 16px; }
    .slide-visual { height: 210px; margin-top: 12px; }
    .orb-1 { width: 150px; font-size: 70px; }
    .orb-2, .orb-3 { width: 54px; font-size: 24px; }
    .hero-arrow { top: auto; bottom: 8px; width: 34px; height: 34px; margin: 0; }
    .hero-prev { left: 12px; }
    .hero-next { right: 12px; }
    .hero-dots { bottom: 20px; }

    .benefits-row { grid-template-columns: repeat(2, 1fr); }
    .benefit { padding: 12px 14px; border-left: 0; border-top: 1px solid var(--line); }
    .benefit:nth-child(even) { border-left: 1px solid var(--line); }
    .benefit:nth-child(-n+2) { border-top: 0; }
    .benefit .ic { font-size: 24px; }
    .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .cat-tile { padding: 11px 12px; }
    .cat-ic { width: 38px; height: 38px; font-size: 19px; }

    /* Las categorías pasan a una fila deslizable */
    .cat-side { margin-bottom: 12px; overflow: hidden; }
    .cat-side h3 { display: none; }
    .chips { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: none; gap: 8px; padding: 10px 14px; border-top: 0; border-left: 1px solid var(--line); }
    .chip:first-child { border-left: 0; }
    .chip.active { box-shadow: inset 0 -3px 0 var(--blue); }
    .catalog-bar { padding: 8px 10px 8px 14px; }
    .catalog-bar h2 { font-size: 15px; }
    .catalog-bar .muted { display: none; }
    .catalog-body { overflow: visible; padding: 0 0 10px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .thumb { font-size: 46px; }
    .card-body { padding: 10px; }
    .card h3 { font-size: 13.5px; }
    .card-specs { display: none; }
    .price strong { font-size: 16px; }
    .card h3 { margin-bottom: 8px; }

    .services { grid-template-columns: 1fr; }
    .about, .contact { grid-template-columns: 1fr; align-items: start; }
    .form { grid-template-columns: 1fr; padding: 20px; }
    .modal[open] { grid-template-columns: 1fr; }
    .modal-thumb { min-height: 180px; font-size: 90px; }
    .modal-info { padding: 22px 20px; }
}

@media (max-width: 420px) {
    .btn-row .btn { flex: 1 1 100%; }
    .btn-cart { padding: 8px 6px; font-size: 12.5px; }
    .btn-cart .ic { display: none; }
    .catalog-bar select { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
