@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Barlow:wght@400;500;600;700&display=swap');

:root {
    --bg: #0a0d12;
    --bg-elevated: #12161d;
    --bg-soft: #1a202c;
    --surface: #171c25;
    --surface-2: #1e2430;
    --line: rgba(255, 255, 255, 0.09);

    --orange: #ff6a1a;
    --orange-dark: #e85400;
    --blue: #2f7bf0;
    --blue-dark: #1857b8;
    --red: #e53e3e;
    --black: #000000;

    --ink: #f4f5f7;
    --muted: #9aa3b2;
    --muted-dim: #6b7383;
    --success: #2fb673;
    --white: #ffffff;

    --font-head: 'Oswald', sans-serif;
    --font-body: 'Barlow', sans-serif;

    --container: 1220px;
    --radius-s: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.cat-principales {
    max-width: 100%;
    margin: 0 auto;
    padding: 56px 24px;
    background-color: var(--ink);
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===================== Barra de anuncio ===================== */
.adbar {
    background-color: var(--orange);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 14px;
    overflow: hidden;
    position: relative;
    text-shadow: 0 0.5px 1px var(--black);
}

.adbar-wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 500px; 
    display: flex;
    justify-content: center;
}

.adbar-track {
    display: flex;
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1); 
    will-change: transform;
}

.adbar-msg {
    flex: 0 0 100%;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    text-align: center;
    user-select: none;
}

.adbar-nav {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    flex-shrink: 0;
    padding: 0 6px;
}

/* ===================== Encabezado ===================== */
.head-main {
    position: sticky;
    top: 0;
    z-index: 60;
}

.head-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    position: relative;
}
@media (max-width: 640px) {
    .head-container { 
        flex-wrap: wrap; 
    }
    .search-wrap { 
        order: 3; 
        width: 100%; 
        max-width: 100%; 
    }
    .head-actions {
        order: 2; /* Mantiene los iconos arriba a la derecha cuando el buscador pasa abajo */
    }
    .promo-list { grid-template-columns: 1fr; }
}
.head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.catag-btn:hover,
.admin-btn:hover,
.cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0px 6px rgba(255, 106, 26, 0.61);
}
.catag-btn,
.admin-btn,
.cart-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.catag-btn img,
.admin-btn img,
.cart-btn img { filter: invert(1); }

.search-wrap {
    flex: 1;
    display: flex;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}
.search-bar {
    width: 100%;
    padding: 11px 44px 11px 16px;
    background-color: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
}
.search-bar::placeholder { color: var(--muted-dim); }
.search-bar:focus {
    outline: none;
    border-color: var(--orange);
}
.search-bar:hover { transform: scale(1.02); transition: transform 0.4s ease; }
.search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 38px;
    border: none;
    background-color: var(--orange);
    color: var(--white);
    border-radius: var(--radius-s);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-btn svg { width: 16px; height: 16px; }

.insta-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.insta-btn img { filter: invert(1); }

/* Menú lateral */
.cat-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(320px, 85vw);
    background-color: var(--bg-elevated);
    border-right: 1px solid var(--line);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}
.cat-menu.open { transform: translateX(0); }
.cat-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.cat-menu-head h2 {
    font-family: var(--font-head);
    font-size: 18px;
    text-transform: uppercase;
}
.cat-menu-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 22px;
}
.cat-menu li a {
    display: block;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.cat-menu li a:hover {
    border-left-color: var(--orange);
    background-color: var(--surface);
}
.scrim {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

/* Hero */
.hero {
    position: relative;
    background-color: var(--black);
    overflow: hidden;
}
.hero-track {
    display: flex;
    transition: transform 0.5s ease;
}
.hero-slide {
    flex: 0 0 100%;
}
.hero-inner {
    padding: 60px 24px 68px;
    display: grid;
    gap: 16px;
    max-width: 620px;
}
.hero-eyebrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--orange);
    letter-spacing: 0.5px;
}
.hero-inner-wrap {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-inner-wrap img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-ctas {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.hero-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.35);
    border: none;
}
.hero-dot.active { background-color: var(--orange); width: 15px; border-radius: 5px; }

/* Secciones */
section { padding: 0px 0; }
.section-head {
    margin-bottom: 28px;
}
.section-head h2 {
    font-family: var(--font-head);
    font-size: clamp(24px, 3.4vw, 32px);
    text-transform: uppercase;
}
.section-head p {
    color: var(--muted);
    font-size: 14px;
}

/* Grillas */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.cat-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cat-icon { width: 34px; height: 34px; color: var(--orange); }
.destacados {
    padding: 56px 24px;
    background-color: var(--ink);
}
.promo { padding: 56px 24px; background-color: var(--bg-elevated); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.promo-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.promo-eyebrow { font-size: 13px; font-weight: 900; color: var(--blue); letter-spacing: 0.5px; }
.promo-inner h2 { font-family: var(--font-head); font-size: clamp(24px, 3.2vw, 32px); text-transform: uppercase; margin: 10px 0 12px; }
.promo-inner h2 span { color: var(--blue); }
.promo-inner > div:first-child > p { color: var(--muted); font-size: 14.5px; max-width: 46ch; }
.promo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.promo-list li { position: relative; padding-left: 18px; font-size: 14px; color: var(--ink); }
.promo-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; background-color: var(--blue); }
.promo-card { background-color: var(--surface); border: 1px solid var(--line); padding: 26px; display: grid; gap: 14px; }
.promo-card-row { display: flex; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.promo-card-row:last-child { padding-bottom: 0; border-bottom: none; }
.promo-card-num { font-family: var(--font-head); font-size: 20px; color: var(--orange); flex-shrink: 0; width: 32px; }
.promo-card-row div { display: grid; gap: 3px; }
.promo-card-row strong { font-size: 14.5px; }
.promo-card-row span { font-size: 13px; color: var(--muted); }

.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.prod-card {
    background-color: var(--surface);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}
.prod-media {
    background-color: var(--surface-2);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.prod-media svg { width: 46%; height: 46%; color: var(--muted-dim); }
.prod-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--orange);
    color: var(--white);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
}
.prod-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prod-cat { font-size: 11.5px; color: var(--muted-dim); text-transform: uppercase; }
.prod-name { font-size: 14.5px; font-weight: 600; }
.prod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.prod-price { font-family: var(--font-head); font-size: 19px; }
.prod-stock { font-size: 11.5px; color: var(--success); }
.prod-stock.low { color: var(--orange); }
.prod-add {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
}

/* Sobre TodoMoto */
.about {
    padding: 56px 24px;
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.about-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
}
.about h2 {
    font-family: var(--font-head);
    font-size: clamp(24px, 3.4vw, 32px);
    text-transform: uppercase;
    margin-bottom: 14px;
}
.about p {
    color: var(--muted);
    font-size: 14.5px;
    max-width: 52ch;
}
.about p + p { margin-top: 10px; }
.about-info {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}
.about-info > div {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.about-info svg {
    width: 22px;
    height: 22px;
    color: var(--orange);
    flex-shrink: 0;
    margin-top: 2px;
}
.about-info strong { display: block; font-size: 14px; }
.about-info span { font-size: 13.5px; color: var(--muted); }
.about-map {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted-dim);
    font-size: 13.5px;
    padding: 24px;
}
.map {
    border: 5px solid var(--orange);
    border-radius: 6px;
}
/* CTA Instagram */
.insta-cta { display: flex; justify-content: center; }
.insta-cta-box {
    background-color: var(--surface);
    border: 1px solid var(--line);
    padding: 44px 32px;
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
    max-width: 460px;
    width: 100%;
}
.insta-cta-icon {
    width: 40px;
    height: 40px;
    color: var(--orange);
    margin-bottom: 4px;
}
.insta-cta-box h2 {
    font-family: var(--font-head);
    font-size: 22px;
    text-transform: uppercase;
}
.insta-cta-box p {
    color: var(--muted);
    font-size: 14px;
    max-width: 34ch;
}
.insta-cta-box .btn { margin-top: 8px; }

/* Footer */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-social { margin-left: 0; }
    footer .footer-bottom { flex-direction: column; gap: 4px; text-align: center; }
}

footer { background-color: var(--bg-elevated); border-top: 1px solid var(--line); padding-top: 48px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-bottom: 36px; }
.footer-brand { display: grid; gap: 12px; }
.footer-brand p { font-size: 13.5px; color: var(--muted); max-width: 30ch; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-social { border: none; margin-left: 50px; filter: invert(0); }
.footer-social a { border: 1px solid var(--ink); border-radius: var(--radius-s); }
.footer-col h3 {
    font-family: var(--font-head);
    font-size: 15px;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: var(--ink);
}
.footer-col ul { grid-auto-flow: column; grid-template-rows: repeat(5, 1fr); grid-auto-columns: minmax(150px, 1fr); display: grid; gap: 9px; }
.footer-col li { grid-auto-columns: minmax(200px); font-size: 13.5px; color: var(--muted); }
.footer-col li a:hover { color: var(--orange); }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    padding: 20px 0;
    color: var(--muted-dim);
    font-size: 12.5px;
    border-top: 1px solid var(--line);
}

/* Flotantes */
.btn-whatsapp { position: fixed; bottom: 20px; right: 20px; z-index: 100; }
.btn-whatsapp:hover { transform: scale(1.05); filter: drop-shadow(0 2px 6px rgba(0, 255, 34, 0.61)); transition: transform 0.2s ease, filter 0.2s ease; }
.wa-bubble {
    position: fixed;
    bottom: 92px;
    right: 20px;
    z-index: 99;
    background-color: var(--surface);
    border: 1px solid var(--line);
    padding: 14px 16px;
    width: 220px;
    display: none;
}
.wa-bubble.show { display: block; }
/* =========================================================================
   AGREGADOS: contenedor, botones, selector mayorista/minorista,
   carrito lateral, avisos y mejoras de las tarjetas de producto.
   ========================================================================= */

/* --- Contenedor genérico (se usaba en el HTML pero no estaba definido) --- */
.wrap {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* --- Botones --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: .4px;
    text-transform: uppercase;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background-color: var(--orange); color: var(--white); }
.btn-primary:hover { background-color: var(--orange-dark); }
.btn-primary:disabled { background-color: var(--surface-2); color: var(--muted-dim); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-blue { background-color: var(--blue); color: var(--white); }
.btn-blue:hover { background-color: var(--blue-dark); }
.btn-block { width: 100%; }

/* --- Selector MINORISTA / MAYORISTA --- */
.price-mode {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background-color: var(--bg-elevated);
}
.price-mode button {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-family: var(--font-head);
    font-size: 12.5px;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 8px 16px;
    transition: background-color .18s ease, color .18s ease;
    white-space: nowrap;
}
.price-mode button:hover { color: var(--ink); }
.price-mode button.active { background-color: var(--orange); color: var(--white); }
.price-mode button.active[data-price-mode="wholesale"] { background-color: var(--blue); }

.price-mode-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 24px;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
}
.price-mode-bar p { font-size: 13px; color: var(--muted); margin: 0; }
.price-mode-bar strong { color: var(--ink); }

/* --- Tarjetas de producto (agregados) --- */
.prod-media img { width: 100%; height: 100%; object-fit: cover; }
.prod-tag.out { background-color: var(--red); left: auto; right: 10px; }
.prod-code { font-size: 11.5px; color: var(--muted-dim); }
.prod-prices { display: grid; gap: 2px; margin-top: 6px; }
.prod-price { font-family: var(--font-head); font-size: 21px; color: var(--ink); }
body.is-wholesale .prod-price { color: var(--blue); }
.prod-price-alt { font-size: 11.5px; color: var(--muted-dim); }
.prod-stock.out { color: var(--red); }
.prod-foot { gap: 8px; margin-top: 12px; }
.prod-foot .prod-add { flex: 1; font-size: 12.5px; padding: 9px 12px; }
.prod-wa {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    color: var(--success);
}
.prod-wa:hover { border-color: var(--success); }
.prod-wa svg { width: 18px; height: 18px; }
.prod-loading, .prod-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 40px 12px;
    font-size: 14.5px;
}

/* --- Contador del carrito en el header --- */
.head-actions .cart-btn { position: relative; }
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: var(--orange);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.cart-count.hidden { display: none; }

/* --- Cajón del carrito --- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100%;
    background-color: var(--bg-elevated);
    border-left: 1px solid var(--line);
    z-index: 120;
    transform: translateX(105%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-family: var(--font-head); font-size: 18px; text-transform: uppercase; }
.cart-head span { display: block; font-size: 11.5px; color: var(--orange); font-family: var(--font-body); text-transform: none; }
body.is-wholesale .cart-head span { color: var(--blue); }
.cart-close { background: transparent; border: 0; color: var(--ink); font-size: 28px; line-height: 1; }
.cart-body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 10px; font-size: 14.5px; }
.cart-empty span { font-size: 13px; color: var(--muted-dim); }

.cart-item {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.cart-item-thumb {
    width: 62px;
    height: 62px;
    background-color: var(--surface-2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { display: grid; gap: 4px; align-content: start; min-width: 0; }
.cart-item-info strong { font-size: 13.5px; font-weight: 600; }
.cart-item-price { font-size: 12.5px; color: var(--muted); }
.badge-may {
    font-style: normal;
    font-size: 10px;
    text-transform: uppercase;
    background-color: var(--blue);
    color: var(--white);
    padding: 1px 6px;
    border-radius: 3px;
}
.cart-hint { font-size: 11.5px; color: var(--orange); }
.cart-item-total { font-family: var(--font-head); font-size: 15px; white-space: nowrap; }

.cart-qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: 4px;
    font-size: 15px;
    line-height: 1;
}
.qty-btn:hover { border-color: var(--orange); color: var(--orange); }
.qty-input {
    width: 48px;
    height: 26px;
    text-align: center;
    background-color: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
}
.cart-remove {
    background: transparent;
    border: 0;
    color: var(--muted-dim);
    font-size: 11.5px;
    text-decoration: underline;
    margin-left: auto;
}
.cart-remove:hover { color: var(--red); }

.cart-foot { border-top: 1px solid var(--line); padding: 16px 20px; display: grid; gap: 10px; }
.cart-foot.hidden { display: none; }
.cart-total-row { display: flex; align-items: center; justify-content: space-between; }
.cart-total-row span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cart-total-row strong { font-family: var(--font-head); font-size: 24px; color: var(--orange); }
body.is-wholesale .cart-total-row strong { color: var(--blue); }
.cart-foot .cart-actions { display: grid; gap: 8px; }

/* --- Aviso flotante (toast) --- */
.tm-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 140%);
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--success);
    color: var(--ink);
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 13.5px;
    z-index: 200;
    max-width: min(420px, 90vw);
    transition: transform .25s ease, opacity .25s ease;
    opacity: 0;
    pointer-events: none;
}
.tm-toast.show { transform: translate(-50%, 0); opacity: 1; }
.tm-toast.error { border-left-color: var(--red); }

/* --- Encabezado de páginas internas --- */
.page-head { padding: 40px 24px 10px; max-width: var(--container); margin: 0 auto; }
.page-head h1 {
    font-family: var(--font-head);
    font-size: clamp(26px, 4vw, 38px);
    text-transform: uppercase;
    color: var(--orange);
}
.page-head p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.breadcrumb { font-size: 12.5px; color: var(--muted-dim); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--orange); }
.page-section { max-width: var(--container); margin: 0 auto; padding: 24px 24px 60px; }

/* --- Formulario de checkout --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field textarea, .field select {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--orange); outline-offset: 0; }
.field.full { grid-column: 1 / -1; }
.form-note { font-size: 12.5px; color: var(--muted-dim); }

.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.checkout-box {
    background-color: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
}
.checkout-box h2 { font-family: var(--font-head); font-size: 18px; text-transform: uppercase; margin-bottom: 14px; }
.resumen-linea { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.resumen-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.resumen-total strong { font-family: var(--font-head); font-size: 26px; color: var(--orange); }
body.is-wholesale .resumen-total strong { color: var(--blue); }

@media (max-width: 860px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .cart-drawer { width: 100%; }
    .price-mode button { padding: 7px 12px; font-size: 11.5px; }
}

/* --- Mensaje de pedido confirmado --- */
.checkout-ok {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--success);
    border-radius: 8px;
    background-color: rgba(47, 182, 115, .08);
    display: grid;
    gap: 10px;
    justify-items: start;
}
.checkout-ok h3 { font-family: var(--font-head); font-size: 17px; color: var(--success); }
.checkout-ok p { font-size: 13.5px; color: var(--muted); }

/* En la página del carrito el listado no es un cajón flotante */
.checkout-box .cart-body { padding: 0; max-height: none; overflow: visible; }
.checkout-box .cart-foot { padding: 16px 0 0; }

/* =========================================================================
   AVISO DE MÍNIMO MAYORISTA
   ========================================================================= */
.cart-minimo {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 8px;
    background-color: var(--surface);
    border: 1px solid var(--line);
    font-size: 12.5px;
}
.cart-minimo.hidden { display: none; }
.cart-minimo strong { font-size: 13.5px; }
.cart-minimo span { color: var(--muted); }
.cart-minimo.falta { border-left: 3px solid var(--orange); }
.cart-minimo.falta strong { color: var(--orange); }
.cart-minimo.ok { border-left: 3px solid var(--success); }
.cart-minimo.ok strong { color: var(--success); }
.cart-minimo .barra {
    height: 6px;
    border-radius: 999px;
    background-color: var(--surface-2);
    overflow: hidden;
    margin-top: 4px;
}
.cart-minimo .barra i {
    display: block;
    height: 100%;
    background-color: var(--blue);
    transition: width .3s ease;
}
.btn.disabled, .btn[aria-disabled="true"] {
    background-color: var(--surface-2);
    color: var(--muted-dim);
    border-color: var(--line);
    cursor: not-allowed;
}
.nota-mayorista { color: var(--blue); font-weight: 600; }

/* =========================================================================
   ADAPTACIÓN A CELULARES Y TABLETS
   ========================================================================= */

/* Nada se desborda a lo ancho ni se autoescala el texto al girar el teléfono */
html, body { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
img, svg, video { max-width: 100vw; }

/* Los inputs no deben bajar de 16px o iOS hace zoom solo al tocarlos */
input, select, textarea { font-size: 16px; }

/* ---------------- Tablet y pantallas medianas ---------------- */
@media (max-width: 1024px) {
    .wrap, .page-section, .page-head { padding-left: 18px; padding-right: 18px; }
    .destacados, .cat-principales, .promo, .about { padding-left: 18px; padding-right: 18px; }
    .prod-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
}

/* ---------------- Celular ---------------- */
@media (max-width: 700px) {

    /* Barra de promos: más chica y sin flechas gigantes */
    .adbar { padding: 7px 8px; gap: 6px; }
    .adbar-msg { font-size: 11.5px; }
    .adbar-nav { font-size: 17px; padding: 0 2px; }

    /* Encabezado: logo + iconos arriba, buscador abajo */
    .head-container { padding: 8px 12px; gap: 8px; row-gap: 8px; }
    .logo img { width: 52px; height: 52px; }
    .catag-btn, .admin-btn, .cart-btn, .insta-btn { width: 40px; height: 40px; }
    .head-actions { gap: 6px; }
    /* El selector de precio del header se oculta: queda el de la barra de abajo,
       que es más grande y se toca mejor con el dedo. */
    .head-actions .price-mode { display: none; }
    .search-wrap { order: 3; width: 100%; max-width: 100%; }
    .search-bar { padding: 10px 44px 10px 14px; }

    /* Barra minorista / mayorista */
    .price-mode-bar { padding: 12px 14px; gap: 10px; flex-direction: column; text-align: center; }
    .price-mode-bar p { font-size: 12.5px; }
    .price-mode { width: 100%; max-width: 360px; }
    .price-mode button { flex: 1; padding: 11px 8px; font-size: 12px; }

    /* Menú lateral de categorías: ocupa casi toda la pantalla */
    .cat-menu { width: min(330px, 88vw); }
    .cat-menu li a { padding: 15px 20px; font-size: 15.5px; }

    /* Carrusel */
    .hero-dots { bottom: 10px; }
    .hero-dot { width: 7px; height: 7px; }
    .hero-dot.active { width: 14px; }

    /* Secciones */
    .cat-principales, .destacados, .promo, .about { padding-top: 36px; padding-bottom: 36px; }
    .section-head { margin-bottom: 20px; }
    .section-head h2 { font-size: 22px; }
    .section-head p { font-size: 13px; }
    .page-head { padding: 26px 16px 6px; }
    .page-section { padding: 16px 16px 44px; }

    /* Categorías principales: 2 columnas */
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-card { padding: 16px 12px; gap: 10px; font-size: 13.5px; }
    .cat-icon { width: 28px; height: 28px; }

    /* Productos: 2 columnas bien compactas */
    .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .prod-body { padding: 11px; gap: 4px; }
    .prod-name { font-size: 13px; line-height: 1.3; }
    .prod-cat, .prod-code { font-size: 10.5px; }
    .prod-price { font-size: 17px; }
    .prod-price-alt { font-size: 10.5px; line-height: 1.3; }
    .prod-stock { font-size: 10.5px; }
    .prod-foot { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 10px; }
    .prod-foot .prod-add { width: 100%; padding: 11px 8px; }
    .prod-wa { width: 100%; height: 36px; }
    .prod-tag { font-size: 9.5px; padding: 3px 7px; top: 7px; left: 7px; }
    .prod-tag.out { right: 7px; }

    /* Promo de instalación */
    .promo-inner { gap: 24px; }
    .promo-list { grid-template-columns: 1fr; gap: 7px; }
    .promo-card { padding: 18px; }
    .promo-card-row { gap: 10px; }

    /* Sobre nosotros */
    .about-inner { gap: 24px; }
    .about-info { gap: 14px; }

    /* Instagram */
    .insta-cta-box { padding: 26px 18px; }

    /* Footer: una columna y sin los márgenes fijos del diseño de escritorio */
    .footer-grid { gap: 26px; padding-bottom: 26px; }
    .footer-brand img,
    .footer-brand p { margin-left: 0 !important; }
    .footer-social { margin-left: 0 !important; }
    .footer-col ul { grid-auto-flow: row; grid-template-rows: none; grid-auto-columns: auto; }
    .footer-col li { font-size: 13px; }
    .footer-bottom { font-size: 11.5px; }

    /* Carrito: pantalla completa */
    .cart-drawer { width: 100%; }
    .cart-head { padding: 14px 16px; }
    .cart-body { padding: 12px 16px; }
    .cart-item { grid-template-columns: 54px 1fr; grid-template-rows: auto auto; gap: 10px; }
    .cart-item-thumb { width: 54px; height: 54px; }
    .cart-item-total { grid-column: 2; text-align: right; font-size: 14px; }
    .cart-qty { flex-wrap: wrap; }
    .qty-btn { width: 32px; height: 32px; font-size: 17px; }
    .qty-input { width: 54px; height: 32px; }
    .cart-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
    .cart-total-row strong { font-size: 21px; }

    /* Checkout */
    .checkout-grid { grid-template-columns: 1fr; gap: 16px; }
    .checkout-box { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Botón flotante de WhatsApp: más chico para no tapar el contenido */
    .btn-whatsapp { bottom: 14px; right: 14px; }
    .btn-whatsapp img { width: 52px; height: 52px; }
    .wa-bubble { bottom: 80px; right: 14px; width: calc(100vw - 28px); max-width: 260px; }

    /* Avisos flotantes */
    .tm-toast { bottom: 80px; font-size: 13px; padding: 11px 15px; }
}

/* ---------------- Celulares chicos ---------------- */
@media (max-width: 380px) {
    .prod-grid { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: 1fr; }
    .logo img { width: 46px; height: 46px; }
    .catag-btn, .admin-btn, .cart-btn, .insta-btn { width: 38px; height: 38px; }
    .page-head h1 { font-size: 22px; }
}

/* ---------------- Toques y accesibilidad ---------------- */
@media (hover: none) {
    /* En pantallas táctiles no tienen sentido los efectos de hover */
    .search-bar:hover,
    .catag-btn:hover, .admin-btn:hover, .cart-btn:hover,
    .btn-whatsapp:hover { transform: none; box-shadow: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
