/* ============================================================
   style.css — Plantilla Madre
   Los colores y tipografías vienen de :root inyectado por PHP
   (theme_vars() en config.php). NO hardcodear colores aquí:
   usar siempre var(--color-*) y var(--font-*).
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 192px; }
.brand {
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.15rem;
    color: var(--color-primary); text-decoration: none;
}
.main-nav { display: flex; gap: 2.2rem; align-items: center; }
.main-nav a:not(.nav-cta) {
    position: relative; text-decoration: none; font-weight: 600;
    font-size: 1.35rem; color: var(--color-text); padding-bottom: .25rem;
}
.main-nav a:not(.nav-cta)::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--color-accent);
    transition: width .25s ease;
}
.main-nav a:not(.nav-cta):hover { color: var(--color-primary); }
.main-nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
    background: var(--color-primary); color: #fff !important;
    padding: .8rem 1.8rem; border-radius: var(--radius);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.nav-cta:hover {
    background: var(--color-accent); color: var(--color-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--color-accent) 45%, transparent);
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--color-text); margin: 5px 0; transition: .25s; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 68vh; overflow: hidden; background: var(--color-primary); }
.hero-slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
    background-size: cover; background-position: center;
    display: grid; align-items: center;
}
.hero-slide.is-active { opacity: 1; position: relative; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(100deg,
        color-mix(in srgb, var(--color-primary) 82%, black) 0%,
        color-mix(in srgb, var(--color-primary) 35%, transparent) 70%);
}
.hero-content { position: relative; z-index: 1; padding: 5rem 1.25rem; color: #fff; max-width: 1120px; }
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.12; margin: 0 0 .6rem; max-width: 16ch;
}
.hero-subtitle { font-size: clamp(1rem, 2vw, 1.25rem); opacity: .92; max-width: 46ch; margin: 0 0 1.6rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-dots {
    position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
    display: flex; gap: .5rem; z-index: 2;
}
.hero-dot {
    width: 10px; height: 10px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.45); transition: .2s;
}
.hero-dot.is-active { background: var(--color-accent); transform: scale(1.25); }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; text-decoration: none; font-weight: 600;
    padding: .7rem 1.4rem; border-radius: var(--radius);
    border: 0; cursor: pointer; font-size: .95rem; font-family: var(--font-body);
    transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-accent  { background: var(--color-accent); color: color-mix(in srgb, var(--color-primary) 85%, black); }
.btn-ghost   { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.65); }
.btn-small   { padding: .5rem 1rem; font-size: .85rem; background: var(--color-primary); color: #fff; }

/* ---------- Franja de credenciales ---------- */
.cred-strip {
    background: var(--color-primary); color: #fff;
    border-top: 3px solid var(--color-accent);
}
.cred-inner {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem; padding: 1.4rem 1.25rem; text-align: center;
}
.cred-value {
    display: block; font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 700; color: var(--color-accent);
}
.cred-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }

/* ---------- Secciones ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-surface); }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin: 0 0 1rem; color: var(--color-primary);
}
.section-intro { color: var(--color-text-soft); max-width: 65ch; margin-bottom: 2rem; }

/* ---------- Servicios destacados ---------- */
.featured-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.2rem; margin-top: 1.5rem;
}
.featured-card {
    background: var(--color-surface);
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    border-top: 3px solid var(--color-accent);
    border-radius: var(--radius); padding: 1.4rem;
}
.featured-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.featured-card p { margin: 0 0 .8rem; font-size: .92rem; color: var(--color-text-soft); }
.link-more { font-size: .88rem; font-weight: 600; text-decoration: none; }

/* ---------- Grilla de servicios ---------- */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.4rem;
}
.service-card {
    background: var(--color-bg);
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
}
.service-card img { aspect-ratio: 600/376; object-fit: cover; width: 100%; }
.service-body { padding: 1.2rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.service-body h3 { margin: 0; font-size: 1.05rem; }
.service-body p { margin: 0; font-size: .92rem; color: var(--color-text-soft); }
.service-body .btn-small { margin-top: auto; align-self: flex-start; }
.service-detail summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--color-primary); }
.service-detail p { margin: .5rem 0 0; font-size: .88rem; }

/* ---------- Quién soy ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.about-text .btn { margin-top: 1rem; }
.about-media img { border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.12); }

/* ---------- Galería ---------- */
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.gallery-item { margin: 0; }
.gallery-item img {
    aspect-ratio: 4/3; object-fit: cover; width: 100%;
    border-radius: var(--radius); transition: transform .25s;
}
.gallery-item a:hover img { transform: scale(1.03); }
.gallery-item figcaption { font-size: .82rem; color: var(--color-text-soft); margin-top: .4rem; }

/* ---------- Misión / Visión / Compromiso ---------- */
.mvc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.mvc-card {
    background: var(--color-surface);
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    border-top: 3px solid var(--color-accent);
    border-radius: var(--radius); padding: 1.8rem;
}
.mvc-card h3 {
    font-family: var(--font-display); margin: 0 0 .8rem;
    font-size: 1.2rem; color: var(--color-primary);
}
.mvc-card p { margin: 0; color: var(--color-text-soft); }
.values-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.values-list li {
    background: var(--color-bg);
    border-left: 3px solid var(--color-accent);
    padding: .6rem .9rem; border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600; font-size: .9rem;
}

/* ---------- Testimonios ---------- */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.testimonial {
    margin: 0; background: var(--color-bg); border-radius: var(--radius);
    padding: 1.4rem; border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.testimonial p { margin: 0 0 .8rem; font-style: italic; }
.testimonial footer { font-size: .85rem; color: var(--color-text-soft); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-data { list-style: none; padding: 0; display: grid; gap: .5rem; }
.contact-data a { text-decoration: none; font-weight: 600; }
.map-wrap { margin-top: 1.2rem; border-radius: var(--radius); overflow: hidden; }
.map-wrap iframe { width: 100%; height: 260px; border: 0; display: block; }
.contact-form {
    background: var(--color-surface); padding: 1.6rem; border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    display: grid; gap: .35rem; align-self: start;
}
.contact-form label { font-weight: 600; font-size: .88rem; margin-top: .5rem; }
.contact-form input, .contact-form textarea {
    padding: .65rem .8rem; border: 1px solid color-mix(in srgb, var(--color-text) 20%, transparent);
    border-radius: calc(var(--radius) - 3px); font-family: inherit; font-size: .95rem;
    background: var(--color-bg);
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: transparent;
}
.contact-form .btn { margin-top: 1rem; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.form-ok  { color: #0a7d38; font-weight: 600; }
.form-err { color: #b3261e; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-primary); color: rgba(255,255,255,.85);
    padding: 1.6rem 0; font-size: .88rem; text-align: center;
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
    position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25D366; color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    transition: transform .15s;
}
.wa-float:hover { transform: scale(1.08); }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(10, 14, 16, .92);
    display: none; place-items: center; padding: 2rem;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; border-radius: var(--radius); }
.lightbox-caption { color: #fff; text-align: center; margin-top: .8rem; font-size: .9rem; }
.lightbox-close {
    position: absolute; top: 1rem; right: 1.2rem;
    background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-slide { transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .mvc-grid { grid-template-columns: 1fr; gap: 1.2rem; }
    .main-nav {
        position: fixed; inset: 192px 0 auto 0;
        background: var(--color-surface);
        flex-direction: column; align-items: stretch; gap: 0;
        padding: .5rem 0; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
        transform: translateY(-130%);
        visibility: hidden; opacity: 0; pointer-events: none;
        transition: transform .25s ease, opacity .25s ease, visibility .25s ease;
    }
    .main-nav.is-open {
        transform: none;
        visibility: visible; opacity: 1; pointer-events: auto;
    }
    .main-nav a { padding: .9rem 1.5rem; }
    .nav-cta { margin: .5rem 1.5rem; text-align: center; }
    .nav-toggle { display: block; }
    .hero { min-height: 78vh; }
}

/* ---------- Clientes que confían ---------- */
.clients-section { padding: 3rem 0; }
.clients-title {
    font-family: var(--font-body);
    font-size: .85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--color-text-soft); text-align: center; margin: 0 0 1.6rem;
}
.clients-strip {
    display: flex; flex-wrap: wrap; justify-content: center;
    align-items: center; gap: 2.5rem 3rem;
}
.client-logo img {
    height: 44px; width: auto; max-width: 150px; object-fit: contain;
    filter: grayscale(1); opacity: .6;
    transition: filter .25s, opacity .25s;
}
.client-logo:hover img { filter: none; opacity: 1; }

/* ---------- Footer: redes y crédito ---------- */
.social-links { display: flex; justify-content: center; gap: 1.1rem; margin-bottom: .9rem; }
.social-links a { color: rgba(255,255,255,.75); transition: color .2s; }
.social-links a:hover { color: var(--color-accent); }
.footer-credit { font-size: .78rem; opacity: .75; margin-top: .4rem; }
.footer-credit a { color: var(--color-accent); text-decoration: none; font-weight: 600; }

/* ---------- Logo en header ---------- */
.brand { display: flex; align-items: center; }
.brand-logo { height: 160px; width: auto; max-width: 800px; object-fit: contain; }

/* ---------- FAQ ---------- */
.faq-container { max-width: 760px; }
.faq-list { display: grid; gap: .7rem; margin-top: 1.5rem; }
.faq-item {
    background: var(--color-surface);
    border: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
    border-radius: var(--radius); padding: 0;
}
.faq-item summary {
    cursor: pointer; font-weight: 600; padding: 1rem 1.2rem;
    list-style: none; position: relative; padding-right: 2.6rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+'; position: absolute; right: 1.2rem; top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem; color: var(--color-accent); font-weight: 700;
    transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-answer { padding: 0 1.2rem 1rem; color: var(--color-text-soft); }
.faq-answer p { margin: 0 0 .6rem; }

/* ---------- Vitrina de productos ---------- */
.products-iva-note { color: var(--color-text-soft); font-size: .85rem; margin: -.6rem 0 1.6rem; }
.products-featured-title { font-size: 1.1rem; color: var(--color-primary); margin: 0 0 1rem; }
.products-featured-grid { margin-bottom: 2.5rem; }
.products-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.8rem; }
.products-filter {
    border: 1px solid color-mix(in srgb, var(--color-text) 18%, transparent);
    background: var(--color-surface); color: var(--color-text);
    padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    display: inline-flex; align-items: center; gap: .45rem;
}
.products-filter img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.products-filter.is-active, .products-filter:hover {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.4rem;
}
.product-card {
    background: var(--color-bg);
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
}
.product-media { position: relative; aspect-ratio: 600 / 376; background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-badge {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--color-accent); color: color-mix(in srgb, var(--color-primary) 85%, black);
    font-size: .78rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px;
}
.product-overlay {
    position: absolute; inset: 0; background: rgba(20, 20, 20, .55); color: #fff;
    display: grid; place-items: center; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.product-card.is-sold-out .product-media img { filter: grayscale(.6); opacity: .7; }
.product-body { padding: 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.product-body h3 { margin: 0; font-size: 1rem; }
.product-body p { margin: 0; font-size: .85rem; color: var(--color-text-soft); }
.product-price { margin: .2rem 0; display: flex; gap: .5rem; align-items: baseline; }
.product-price-old { text-decoration: line-through; color: var(--color-text-soft); font-size: .85rem; }
.product-price-now { font-weight: 700; color: var(--color-primary); font-size: 1.05rem; }
.btn-add-cart { margin-top: auto; align-self: flex-start; }
.btn-add-cart:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Carrito flotante ---------- */
.cart-float { position: fixed; right: 1.2rem; bottom: 5.4rem; z-index: 61; }
.cart-btn {
    position: relative; width: 56px; height: 56px; border-radius: 50%;
    background: var(--color-primary); color: #fff; border: 0; font-size: 1.4rem;
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s;
}
.cart-btn:hover { transform: scale(1.08); }
.cart-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--color-accent); color: color-mix(in srgb, var(--color-primary) 85%, black);
    font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px;
    display: grid; place-items: center; padding: 0 4px;
}
.cart-panel {
    position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 100vw);
    background: var(--color-surface); box-shadow: -8px 0 32px rgba(0,0,0,.18);
    z-index: 70; padding: 1.2rem; display: flex; flex-direction: column; overflow-y: auto;
}
/* El atributo [hidden] tiene la misma especificidad que .cart-panel: sin esta
   regla, "display:flex" de arriba gana y el panel queda visible siempre
   aunque tenga el atributo hidden (bloqueando clics del contenido de abajo). */
.cart-panel[hidden] { display: none; }
.cart-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cart-panel-header h3 { margin: 0; }
.cart-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--color-text); }
.cart-items { display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.cart-item { border-bottom: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); padding-bottom: .6rem; }
.cart-item-name { font-weight: 600; font-size: .92rem; }
.cart-item-controls { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; font-size: .85rem; }
.cart-qty-btn {
    width: 26px; height: 26px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--color-text) 20%, transparent);
    background: var(--color-bg); cursor: pointer; font-size: 1rem; line-height: 1;
}
.cart-item-subtotal { margin-left: auto; font-weight: 600; }
.cart-item-remove { background: none; border: 0; color: #b3261e; font-size: 1.2rem; cursor: pointer; }
.cart-total { display: flex; justify-content: space-between; padding: 1rem 0; font-size: 1.05rem; border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); }
.cart-checkout-form label { display: block; font-weight: 600; font-size: .85rem; margin: .6rem 0 .2rem; }
.cart-checkout-form input {
    width: 100%; padding: .6rem .7rem; border: 1px solid color-mix(in srgb, var(--color-text) 20%, transparent);
    border-radius: calc(var(--radius) - 3px); font-family: inherit; font-size: .95rem; background: var(--color-bg);
}
.cart-checkout-form .btn { width: 100%; margin-top: 1rem; }
.cart-msg { font-size: .85rem; color: var(--color-text-soft); text-align: center; }
@media (max-width: 480px) {
    .cart-panel { width: 100vw; }
    .cart-float { bottom: 5rem; }
}
