/* --- Core Design System & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-dark: #08080a;
    --bg-card: rgba(18, 18, 24, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.6);
    --accent: #ff6b35; /* Pizza crust amber-orange */
    --accent-glow: rgba(255, 107, 53, 0.4);
    --accent-light: #ff9f1c; /* Golden yellow */
    --font-headers: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    touch-action: none;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* --- Brand Header --- */
.brand-header {
    position: absolute;
    top: 30px;
    left: 40px;
    z-index: 10;
    pointer-events: none;
}

.brand-title {
    font-family: var(--font-headers);
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.brand-subtitle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.brand-subtitle {
    font-family: var(--font-headers);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--text-secondary);
}

.badge {
    background: var(--accent);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* --- Instructions Panel --- */
.instructions-panel {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 10;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.instructions-panel h3 {
    font-family: var(--font-headers);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.instructions-panel ul {
    list-style: none;
}

.instructions-panel li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.instructions-panel li:last-child {
    margin-bottom: 0;
}

.instructions-panel .icon {
    font-size: 16px;
}

.btn-dismiss {
    margin-top: 15px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    pointer-events: auto;
    animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 107, 0, 0.2);
        border-color: rgba(255, 107, 0, 0.2);
        background: rgba(255, 255, 255, 0.08);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 107, 0, 0.6);
        border-color: rgba(255, 107, 0, 0.6);
        background: rgba(255, 107, 0, 0.15);
        color: #ffffff;
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 107, 0, 0.2);
        border-color: rgba(255, 107, 0, 0.2);
        background: rgba(255, 255, 255, 0.08);
    }
}

.btn-dismiss:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 20px var(--accent-glow);
    animation: none; /* Stop pulsating on hover */
}

/* --- UI Overlay (fixed full-screen, holds all controls) --- */
#ui-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* --- Control Panel (Glassmorphism) --- */
.ui-panel {
    position: absolute;
    bottom: 40px;
    right: 40px;
    left: auto;
    transform: none;
    z-index: 10;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.control-btn {
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: scale(1.05);
}

.text-btn {
    padding: 0 20px;
    height: 44px;
    border-radius: 22px;
    font-weight: 600;
    font-size: 13px;
    gap: 8px;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.indicator.active {
    background: #00ffcc;
    box-shadow: 0 0 10px #00ffcc;
}

.back-btn {
    background: var(--accent);
    color: #ffffff;
    padding: 0 20px;
    height: 44px;
    border-radius: 22px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px var(--accent-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn:hover {
    background: #ff7e4f;
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
}

.pizza-loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    border-right-color: var(--accent-light);
    animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    margin: 0 auto 24px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.loader-container h2 {
    font-family: var(--font-headers);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.loader-container p {
    font-size: 13px;
    color: var(--text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive Adaptability (Media Queries) --- */

/* Portrait orientation / Mobile devices */
@media (max-width: 768px), (orientation: portrait) {
    .brand-header {
        top: 20px;
        left: 20px;
    }
    
    .brand-title {
        font-size: 24px;
        letter-spacing: 3px;
    }
    
    .brand-subtitle {
        font-size: 10px;
        letter-spacing: 4px;
    }
    
    .instructions-panel {
        display: none; /* Hide floating instructions on mobile to save space */
    }
    
    .ui-panel {
        position: absolute;
        bottom: 25px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 40px) !important;
        max-width: 360px;
        justify-content: space-between;
        padding: 6px 8px;
    }
    
    .control-btn {
        flex: 1;
    }
    
    .text-btn {
        padding: 0 10px;
        font-size: 12px;
    }
    
    .back-btn {
        padding: 0 15px;
        font-size: 12px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .brand-title {
        font-size: 20px;
    }
    
    .badge {
        display: none;
    }
}

/* Mobile Landscape Custom Adjustments (exclusively for phones in horizontal orientation) */
@media (max-width: 950px) and (orientation: landscape) {
    /* Brand Header adjustments */
    .brand-header {
        top: 15px;
        left: 20px;
    }
    .brand-title {
        font-size: 20px;
        letter-spacing: 2px;
    }
    .brand-subtitle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-top: 2px;
    }
    .brand-subtitle {
        font-size: 9px;
        letter-spacing: 3px;
    }
    .badge {
        font-size: 8px;
        padding: 1px 4px;
        margin-top: 1px;
    }

    /* Instructions Panel adjustments (reduced by ~40% for screen space) */
    .instructions-panel {
        display: block !important; /* Ensure it remains visible but optimized */
        top: 15px;
        right: 20px;
        padding: 10px 12px;
        max-width: 190px; /* 40% reduction from 320px */
        border-radius: 10px;
    }
    .instructions-panel h3 {
        font-size: 11px;
        margin-bottom: 6px;
    }
    .instructions-panel li {
        font-size: 9px;
        margin-bottom: 5px;
        gap: 6px;
        line-height: 1.3;
    }
    .instructions-panel .icon {
        font-size: 11px;
    }
    .btn-dismiss {
        margin-top: 6px;
        padding: 4px 6px;
        font-size: 9.5px;
        border-radius: 6px;
    }

    /* Bottom UI Panel adjustments (moved to the right side below instructions) */
    .ui-panel {
        top: auto;
        bottom: 15px; /* align to bottom-right corner */
        right: 20px;
        left: auto;
        transform: none;
        padding: 4px 6px;
        gap: 4px;
        border-radius: 12px;
        max-width: 250px;
        width: auto;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
    }
    .icon-btn {
        width: 32px;
        height: 32px;
    }
    .icon-btn svg {
        width: 14px;
        height: 14px;
    }
    .text-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 10.5px;
        border-radius: 16px;
        gap: 5px;
    }
    .back-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 10.5px;
        border-radius: 16px;
    }
    .indicator {
        width: 6px;
        height: 6px;
    }
}

/* --- Brand Header Linkable (New Dropdown Menu Support) --- */
.brand-header-linkable {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(8, 8, 10, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 999;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.navbar-logo-title {
    font-family: var(--font-headers);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-logo-sub {
    font-family: var(--font-headers);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    color: #ffffff;
}

/* Dropdown Style */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: rgba(18, 18, 24, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    min-width: 140px;
    width: max-content;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    z-index: 1000;
    padding: 10px 0;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

/* Invisible hover bridge to prevent menu from disappearing */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 12px;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-content a:hover {
    background: rgba(255, 107, 53, 0.15);
    color: #ffffff;
    padding-left: 24px;
}

.dropdown.active .dropdown-content {
    display: block;
}

.btn-home {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px !important;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-home:hover {
    background: #ffffff;
    color: #000000 !important;
}

/* --- Hamburger Menu Toggle --- */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1010;
    padding: 0;
}

.hamburger-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Transform lines to X when open */
.hamburger-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-toggle.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hamburger-toggle {
        display: flex;
    }
    
    .brand-header-linkable {
        justify-content: space-between;
        padding: 12px 20px;
    }

    /* Target the nav element to slide in from right */
    .brand-header-linkable nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 290px;
        height: 100vh;
        background: rgba(14, 14, 20, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: flex-start;
        padding: 80px 24px 40px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .brand-header-linkable nav.active {
        right: 0;
    }

    .header-seo-badge {
        margin-bottom: 20px;
        margin-right: 0;
        width: 100%;
        text-align: center;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 16px;
    }

    .nav-menu li {
        width: 100%;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-content {
        display: none;
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.03);
        margin-top: 8px;
        border-radius: 8px;
        max-height: 450px;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }
}

/* --- Floating Product Details Card --- */
.details-card {
    position: absolute;
    top: 100px;
    left: 40px;
    background: rgba(18, 18, 24, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    max-width: 320px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 15;
    pointer-events: auto;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0);
}

/* Forzar que la tarjeta SIEMPRE esté en el DOM.
   Especificidad de ID (100) supera a .hidden clase (10)
   incluso con !important — así nunca hay display:none.
   GSAP maneja la animación de opacidad y transform. */
#product-details-card {
    display: block !important;
}

.details-card.hidden {
    visibility: hidden;
    pointer-events: none;
}

.details-tag {
    font-family: var(--font-headers);
    font-size: 9px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
}

#details-title {
    font-family: var(--font-headers);
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
}

#details-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
}

.btn-details {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--accent-glow);
    text-align: center;
    width: 100%;
}

.btn-details:hover {
    background: var(--accent-light);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

/* Botón Volver: pill discreto inline dentro del encabezado */
.btn-back-sheet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px; /* Formato más ovalado */
    color: rgba(255, 255, 255, 0.85); /* Blanco translúcido más legible */
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; /* Permite posicionar la estela de estrella fugaz */
    overflow: hidden; /* Mantiene la estela oculta fuera del botón */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-back-sheet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 150%;
    width: 120%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.02) 20%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.02) 80%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-30deg); /* Inclinación de la estela */
    pointer-events: none;
    animation: shooting-star 9s infinite linear;
}

@keyframes shooting-star {
    0% {
        left: 150%;
    }
    12% {
        left: -150%;
    }
    100% {
        left: -150%;
    }
}

.btn-back-sheet:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}


/* -------------------------------------------------------
   Overlay de texto: Portrait / Mobile
   Sin bandeja ni panel. El texto flota directamente
   sobre la galería 3D con solo un velo degradado sutil
   en la parte inferior para legibilidad.
------------------------------------------------------- */
@media (max-width: 950px) and (orientation: portrait),
       (max-width: 600px) {

    /* --- Sin caja, solo posicionamiento al fondo --- */
    .details-card {
        position: fixed;
        bottom: 16px;
        left: 0;
        right: 0;
        top: auto;
        max-width: 100%;
        width: 100%;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        z-index: 30;
        pointer-events: none; /* el área de texto no bloquea la galería */
        /* Sin opacity/transform/transition: GSAP los maneja desde JS */
    }

    /* Quitar el ::before (drag handle) — ya no aplica */
    .details-card::before {
        display: none;
    }

    /* Velo degradado sutil al fondo de la pantalla para legibilidad */
    .details-card::after {
        content: '';
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 220px;
        background: linear-gradient(
            to top,
            rgba(8, 8, 10, 0.75) 0%,
            rgba(8, 8, 10, 0.0)  100%
        );
        pointer-events: none;
        z-index: -1;
    }

    /* Contenedor del texto: alineado a la izquierda con padding lateral */
    .details-card-inner {
        padding: 0 20px 0 20px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    /* Etiqueta "Artículo Suministro" — más pequeña, discreta */
    .details-tag {
        font-size: 8px;
        letter-spacing: 2px;
        margin-bottom: 5px;
        color: var(--accent-light);
        opacity: 1;
    }

    /* Título del producto */
    #details-title {
        font-size: 17px;
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 5px;
        text-shadow: 0 1px 8px rgba(0,0,0,0.8);
    }

    /* Descripción corta */
    #details-desc {
        font-size: 11.5px;
        line-height: 1.4;
        color: rgba(245, 245, 247, 0.75);
        margin-bottom: 0;
        text-shadow: 0 1px 6px rgba(0,0,0,0.9);
    }

    /* Botón "Ver Ficha" — pequeño pill a la derecha, no ocupa toda la fila */
    .btn-details {
        display: inline-block;
        width: auto;
        align-self: flex-end;
        margin-top: 10px;
        padding: 7px 16px;
        font-size: 10.5px;
        border-radius: 20px;
        background: var(--accent);
        box-shadow: 0 0 12px var(--accent-glow);
        pointer-events: auto; /* este botón sí es interactivo */
        letter-spacing: 0.3px;
    }



    /* Fila superior: etiqueta + botón volver en extremos opuestos */
    .details-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 5px;
    }

    /* Dentro del header, la etiqueta no necesita margin-bottom propio */
    .details-card-header .details-tag {
        margin-bottom: 0;
    }

    body.sheet-open .btn-back-sheet {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn-back-sheet:active {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }

    /* Panel de controles: se oculta cuando el texto está visible */
    body.sheet-open .ui-panel {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(16px);
    }
}

/* En landscape los detalles se mantienen como tarjeta flotante compacta */
@media (max-width: 950px) and (orientation: landscape) {
    .details-card {
        top: auto;
        bottom: 70px;
        left: 20px;
        right: auto;
        max-width: 260px;
        padding: 14px;
    }

    #details-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    #details-desc {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .btn-back-sheet {
        display: none;
    }
}

/* --- Header SEO Badge --- */
.header-seo-badge {
    font-family: var(--font-headers);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-light);
    border: 1px solid rgba(255, 107, 53, 0.4);
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 107, 53, 0.1);
    text-transform: uppercase;
    margin-right: 15px;
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.15);
    white-space: nowrap;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .header-seo-badge {
        font-size: 9px;
        padding: 4px 8px;
        margin-right: 8px;
        letter-spacing: 0.5px;
    }
}





/* --- Product Search Bar --- */
.search-bar-container {
    position: relative;
    margin: 0 20px;
    width: 280px;
    display: block;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    width: 100%;
    background: rgba(255, 223, 0, 0.05); /* Fondito casi amarillo sutil */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 159, 28, 0.25); /* Borde naranja/dorado */
    border-radius: 24px; /* Formato ovalado */
    padding: 8px 16px 8px 36px;
    font-family: var(--font-body);
    font-size: 13.5px;
    color: #ff5411; /* Texto rojo quemado al escribir */
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: #ff5411; /* Rojo quemado al enfocar */
    background: rgba(255, 223, 0, 0.1); /* Amarillo más visible */
    box-shadow: 0 0 15px rgba(255, 84, 17, 0.35);
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 13px;
    opacity: 0.65;
    pointer-events: none;
}

/* Search results dropdown styling */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(18, 18, 24, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    max-height: 280px;
    overflow-y: auto;
    z-index: 999;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 107, 53, 0.15);
    color: #ffffff;
    padding-left: 20px;
}

.search-no-results {
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Scrollbar for search results */
.search-results-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-results-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.search-results-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Mobile search container adjustment */
.mobile-search-item {
    display: none !important; /* Hides on desktop even if CSS caches/overrides */
    width: 100%;
    margin-bottom: 10px;
    padding: 0 20px;
    box-sizing: border-box;
}

.mobile-search-item .search-results-dropdown {
    position: absolute;
    width: calc(100% - 40px);
    left: 20px;
    top: calc(100% + 5px);
}

/* Responsiveness */
@media (max-width: 950px) {
    .search-bar-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mobile-search-item {
        display: block !important; /* Show only when mobile menu drawer is active */
    }
}
