/* ============================================================
 * Tropinside — tema normal (refinamiento visual)
 *
 * Reemplaza al tema temporal de Halloween. Carga al final de cada
 * página pública y solo pule lo que ya existe, con la misma paleta:
 *   naranja  --brand-primary  #FF6B35
 *   ámbar    --brand-secondary #F7931E
 *   tinta    --text-primary    #111827
 *   fondo    --bg-light        #f9fafb
 * ============================================================ */

:root {
    --ti-orange: var(--brand-primary, #FF6B35);
    --ti-amber: var(--brand-secondary, #F7931E);
    --ti-ink: var(--text-primary, #111827);
    --ti-muted: var(--text-secondary, #6b7280);
    --ti-line: var(--border-color, #e5e7eb);
    --ti-surface: #ffffff;
    --ti-soft: #fff4ef;
    --ti-ring: 0 0 0 3px rgba(255, 107, 53, 0.35);
    --ti-card-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 16px rgba(17, 24, 39, 0.05);
    --ti-card-shadow-hover: 0 2px 4px rgba(17, 24, 39, 0.05), 0 14px 32px rgba(17, 24, 39, 0.09);
    --ti-navbar-h: 84px;
}

/* ---------- Base ---------- */
html {
    background: var(--bg-light, #f9fafb);
}

/* Las anclas (#about, #contact…) no quedan escondidas bajo la barra fija */
[id] {
    scroll-margin-top: calc(var(--ti-navbar-h) + 16px);
}

::selection {
    background: rgba(255, 107, 53, 0.22);
    color: var(--ti-ink);
}

/* Foco visible y consistente para teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--ti-ring);
    border-radius: 10px;
}

/* ---------- Barra de navegación ---------- */
.navbar {
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 1px 12px rgba(17, 24, 39, 0.04);
}

.navbar .nav-link {
    border-radius: 10px;
    transition: background-color 150ms ease, color 150ms ease;
}

.navbar .nav-link:hover {
    color: var(--ti-orange);
}

/* "Ingresar" duplicaba al botón "Iniciar Sesión" y seguía visible con la sesión abierta */
.nav-menu .desktop-only {
    display: none !important;
}

/* ---------- Hero ---------- */
/* Velo oscuro centrado: el texto blanco se lee sobre cualquier imagen
   (la ilustración clara por defecto o una foto subida desde el panel) */
.hero::before {
    background:
        radial-gradient(ellipse 60% 70% at 50% 50%, rgba(10, 16, 28, 0.55) 0%, rgba(10, 16, 28, 0.25) 60%, rgba(10, 16, 28, 0.05) 100%),
        linear-gradient(180deg, rgba(10, 16, 28, 0.30) 0%, rgba(10, 16, 28, 0.08) 45%, rgba(10, 16, 28, 0.30) 100%) !important;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}

.hero-title {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

/* El degradado del nombre necesita su propia sombra para no perderse */
.hero-title .text-brand {
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
    text-shadow: none;
}

.hero-subtitle,
.page-subtitle {
    margin-top: 1rem;
    margin-bottom: 1.75rem;
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.hero-search-box {
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(10, 16, 28, 0.22);
}

.hero-search-input {
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    background: transparent;
    font-size: 16px; /* 16px evita el zoom automático de iOS */
}

.hero-search-input:focus,
.hero-search-input:focus-visible {
    box-shadow: none;
}

.hero-search-box:focus-within {
    box-shadow: 0 10px 30px rgba(10, 16, 28, 0.22), var(--ti-ring);
}

.hero-search-btn {
    min-width: 56px;
    transition: filter 150ms ease, transform 150ms ease;
}

.hero-search-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ---------- Encabezados de sección (inicio) ----------
   Solo en las secciones .section; el catálogo de productos ya tiene su
   propio estilo de encabezado con subrayado. */
.section .section-header {
    margin-bottom: 2.5rem;
}

.section .section-header .section-title,
.about-text h2 {
    margin-bottom: 0;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ti-ink);
}

/* Acento naranja bajo cada título */
.section .section-header .section-title::after,
.about-text h2::after {
    content: '';
    display: block !important;
    position: static;
    transform: none;
    width: 56px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ti-orange), var(--ti-amber));
}

.section .section-header .section-description {
    margin-top: 1rem;
    max-width: 640px;
    line-height: 1.65;
}

/* ---------- Tarjetas de categoría (inicio) ---------- */
.cat.card,
a.cat.card {
    background: var(--ti-surface);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 18px;
    box-shadow: var(--ti-card-shadow);
    padding: 24px 18px 20px;
    justify-content: flex-start;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.cat.card:hover,
a.cat.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 107, 53, 0.35);
    box-shadow: var(--ti-card-shadow-hover);
}

.cat.card .circle {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    margin-bottom: 16px;
    background: var(--ti-soft) !important;
    box-shadow: none;
}

.cat.card .circle.has-image {
    background: var(--ti-soft) !important;
    box-shadow: none;
}

.cat.card .circle .category-image {
    border-radius: 50%;
    object-fit: contain;
    padding: 14px;
}

/* Movimiento más sobrio al pasar el cursor */
.cat.card:hover .circle {
    transform: scale(1.04);
}

.cat.card:hover .circle .category-image {
    transform: none;
    filter: none;
}

.cat.card .circle.has-image::after {
    display: none;
}

.cat.card .cat-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin: 0 0 6px;
}

.cat.card:hover .cat-name {
    color: var(--ti-orange);
}

.cat.card .category-desc {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.45;
}

/* ---------- ¿Quiénes somos? ---------- */
.about-text {
    max-width: 820px;
    margin: 0 auto;
}

.about-text h2.text-center {
    margin-bottom: 2rem;
}

.about-text .lead {
    color: var(--ti-ink);
    font-size: 1.15rem;
    font-weight: 500;
}

.about-text p {
    line-height: 1.75;
}

.about-gallery {
    margin-top: 1rem;
}

.gallery-image {
    border-radius: 20px;
    box-shadow: var(--ti-card-shadow-hover);
}

/* ---------- Servicios ---------- */
.service-tab {
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.service-tab:not(.active):hover {
    border-color: rgba(255, 107, 53, 0.45);
    color: var(--ti-orange);
}

.service-content {
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 20px;
    box-shadow: var(--ti-card-shadow);
}

/* ---------- Tarjetas de producto ---------- */
.product-card {
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: var(--ti-card-shadow);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.product-card:hover {
    border-color: rgba(255, 107, 53, 0.30);
    box-shadow: var(--ti-card-shadow-hover);
}

/* ---------- Pie de página ---------- */
.footer {
    border-top: 4px solid var(--ti-orange);
}

.footer-contact-centered h3 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.footer-contact-centered p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.footer-contact-centered strong {
    color: #ffffff;
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    :root { --ti-navbar-h: 72px; }
}

/* ---------- Móvil ---------- */
@media (max-width: 768px) {
    :root { --ti-navbar-h: 64px; }

    /* Carrito siempre a mano: icono junto al menú hamburguesa */
    .navbar .nav-actions .cart-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 44px;
        height: 44px;
        padding: 0 !important;
        border-radius: 12px !important;
        background: var(--ti-soft) !important;
        color: var(--ti-orange) !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .navbar .nav-actions .cart-icon i {
        color: var(--ti-orange) !important;
        font-size: 18px;
    }

    .navbar .nav-actions .cart-icon span:not(.cart-count) {
        display: none !important;
    }

    .navbar .nav-actions .cart-icon .cart-count {
        position: absolute;
        top: -4px;
        right: -4px;
    }

    /* Menú hamburguesa siempre en el extremo derecho */
    .navbar .nav-actions .mobile-menu-toggle {
        order: 2;
    }

    /* En pantallas estrechas la imagen queda detrás del texto: velo algo más denso */
    .hero::before {
        background:
            radial-gradient(ellipse 90% 60% at 50% 50%, rgba(10, 16, 28, 0.62) 0%, rgba(10, 16, 28, 0.35) 70%, rgba(10, 16, 28, 0.15) 100%) !important;
    }

    .hero-content {
        padding: 2.5rem 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section .section-header {
        margin-bottom: 1.75rem;
    }

    /* Categorías en 2 columnas, más compactas */
    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .categories-grid-container {
        margin: 1rem 0;
    }

    .cat.card,
    a.cat.card {
        flex: initial;
        min-width: 0;
        min-height: 0;
        padding: 16px 10px 14px;
        border-radius: 16px;
    }

    .cat.card .circle {
        width: 76px;
        height: 76px;
        margin-bottom: 10px;
    }

    .cat.card .circle i {
        font-size: 30px;
    }

    .cat.card .circle .category-image {
        padding: 10px;
    }

    .cat.card .cat-name {
        font-size: 12.5px;
        letter-spacing: 0.01em;
        overflow-wrap: anywhere;
    }

    .cat.card .category-desc {
        display: none;
    }

    .about-text .lead {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    /* Margen lateral cómodo: antes el contenido tocaba el borde (4px) */
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* El catálogo ya enmarca sus productos en tarjetas propias: margen menor */
    .products-grid-section .container,
    .products-grouped-section .container,
    .category-tabs-section .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-search-btn {
        padding: 0 18px;
    }
}

/* ---------- Accesibilidad: sin animaciones ---------- */
@media (prefers-reduced-motion: reduce) {
    .cat.card,
    .cat.card .circle,
    .product-card,
    .gallery-image,
    .hero-search-btn {
        transition: none !important;
    }

    .cat.card:hover,
    .product-card:hover,
    .gallery-image:hover {
        transform: none !important;
    }
}
