:root {
    --primary-color: #ff004f;
    --text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden; /* Prevent body scroll, feed-container will scroll */
}

/* Feed Container (Snap Scrolling) */
.feed-container {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    overflow-x: hidden; /* Evita cualquier desplazamiento o rebote lateral */
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.feed-container::-webkit-scrollbar {
    display: none;
}

/* Individual Product View */
.product-view {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    overflow-x: hidden; /* Recorta cualquier desborde horizontal de las imágenes escaladas */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background-color: rgba(0,0,0,0.4);
}

/* Wrapper for perfect hotspot alignment */
.product-image-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 100vw; /* Default, overridden by JS */
    height: 100vh; /* Default, overridden by JS */
    z-index: 2; /* Bring on top of background blur */
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill; /* Wrapper aspect ratio is controlled by JS, so fill is safe */
}

/* Overlay UI Elements */
.header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* Let clicks pass through empty space */
}

.logo {
    height: 75px; /* Agrandado para coincidir con la preferencia del usuario */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    pointer-events: auto;
}

.search-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.search-btn:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.6);
}

.sidebar-buttons {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.round-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.round-btn:hover { transform: scale(1.1); color: white;}
.round-btn-red { background-color: var(--primary-color); }

.bottom-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center everything horizontally */
    gap: 15px;
    z-index: 100;
    pointer-events: none;
}

/* Title and dots (centered above actions) */
.product-info-overlay {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center title and dots horizontally */
    text-align: center;
    pointer-events: auto;
}

.glowing-text {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    line-height: 1.2;
    text-align: center;
}

.dots-container {
    display: flex;
    gap: 8px;
    justify-content: center; /* Center dots horizontally */
    pointer-events: auto;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transition: background-color 0.3s;
}
.dot.active { background-color: white; }

/* Bottom bar container */
.bottom-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    pointer-events: auto;
}

.qr-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s, background-color 0.2s;
}
.qr-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.3);
}

.wa-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 15px rgba(255, 0, 79, 0.6);
    z-index: 5;
}

.pulsing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 79, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 0, 79, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 79, 0); }
}

.scroll-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.8rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    z-index: 10;
}

.scroll-indicator:hover {
    color: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.2);
}

.bouncing {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* Modals */
.fullscreen-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

.fullscreen-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 20px; right: 30px;
    background: none; border: none;
    color: white; font-size: 2rem; cursor: pointer;
}

.modal-content {
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 30px;
    border-radius: 15px;
    color: white;
}

#search-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 30px;
    border: none;
    outline: none;
}

.qr-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    margin: 20px 0;
}

/* Hotspots */
.hotspot-pin {
    position: absolute;
    width: 30px; height: 30px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid white;
    color: white;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    transform: translate(-50%, -50%);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.hotspot-pin:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 0.6);
}

.hotspot-popup {
    position: absolute;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    width: max-content;
    max-width: 250px;
    transform: translate(-50%, -120%); /* Above the pin */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 50;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.hotspot-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .glowing-text { font-size: 1.4rem; }
    .product-info-overlay { max-width: 75%; }
    .wa-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        gap: 6px;
    }
    .qr-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* Premium blurred background layer */
.product-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.4);
    transform: scale(1.1); /* Prevents blurred white edges */
    z-index: 1;
    pointer-events: none;
    transition: background-image 0.5s ease-in-out;
}

/* Rotate Device Overlay */
.rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

/* Show on narrow height screens in landscape orientation (mobile landscape) */
@media (max-height: 520px) and (max-width: 950px) and (orientation: landscape) {
    .rotate-overlay {
        display: flex;
    }
}

.rotate-content {
    font-size: 1.2rem;
    padding: 20px;
}

.rotate-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: rotatePhone 2s infinite ease-in-out;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}
