:root {
    --primary: #E88A90;
    /* Darker Pastel Pink for better contrast */
    --primary-dark: #D46A72;
    /* Even darker for borders */
    --secondary: #FFDAC1;
    /* Pastel Orange/Peach */
    --accent: #E2F0CB;
    /* Pastel Green */
    --text: #3A3A3A;
    /* Darker Gray for better readability */
    --text-light: #6A6A6A;
    --background: #FFF5F5;
    /* Very light pinkish white */
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow: rgba(100, 100, 100, 0.1);
}

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

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background: transparent !important;
    /* Force transparency */
    color: var(--text);
}

/* --- Background System --- */
#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
    background-color: #FFF5F5;
    /* Fallback color */
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: opacity 1.5s ease-in-out;
    will-change: opacity;
}

/* Layer ordering */
#bg-layer-back {
    z-index: 1;
    opacity: 1;
}

#bg-layer-front {
    z-index: 2;
    opacity: 0;
}

.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    backdrop-filter: blur(25px);
    /* Stronger blur */
    -webkit-backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* --- Model Viewer --- */
model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
    background-color: transparent !important;
    z-index: 10;
    /* Above background, interactive */
    position: absolute;
    top: 0;
    left: 0;
    /* Prevent canvas stretching/reloading on pull */
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
}

/* --- UI Overlay --- */
#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Allow clicks to pass through to model */
    z-index: 15;
    /* Above model viewer */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    text-align: center;
    padding-top: 25px;
    /* Reduced to prevent overlap with side buttons */
    pointer-events: none;
    position: relative;
    z-index: 10;
    /* Above model viewer but below menu */
}

/* ... */

/* --- Catalog Menu (Compact Dropdown) - Liquid Glass --- */
#catalog-menu {
    position: absolute;
    top: 85px;
    left: 20px;
    width: 220px;
    /* Fixed width */
    max-height: 60vh;
    /* Liquid Glass Effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.75) 50%,
            rgba(255, 255, 255, 0.88) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.12),
        0 5px 20px rgba(255, 154, 162, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    z-index: 2000;
    overflow: hidden;
}

.brand-name {
    font-size: 3rem;
    font-weight: 700;
    color: #FF6F61;
    /* Stronger pastel coral */
    text-shadow: 2px 2px 0px #FFF, 4px 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-30px);
}

.cake-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
}

.cake-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.cake-description {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text);
    margin-top: 5px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
    /* Slight delay */
    text-shadow: 0 1px 5px rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.cake-description.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Botones Laterales (Menú y Compartir) - Liquid Glass */
.glass-btn.icon-btn {
    position: absolute;
    top: 30px;
    width: 48px;
    height: 48px;
    color: var(--primary-dark);
    /* Darker pink for better contrast */
    z-index: 100;
    pointer-events: auto;
    border-radius: 16px;
    /* Liquid Glass Effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.65) 50%,
            rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid rgba(200, 100, 110, 0.2);
    /* Subtle pink tinted border */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    /* Glow effect variable - controlled by JS */
    --glow-x: 50%;
    --glow-y: 50%;
    overflow: hidden;
}

/* Inner glow that follows mouse */
.glass-btn.icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--glow-x) var(--glow-y),
            rgba(212, 106, 114, 0.35) 0%,
            /* Darker pink glow */
            rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.glass-btn.icon-btn:hover::before {
    opacity: 1;
}

/* Fix hover/active for side buttons */
.glass-btn.icon-btn:hover {
    transform: scale(1.05) translateY(-2px);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.75) 50%,
            rgba(255, 255, 255, 0.9) 100%);
    box-shadow:
        0 12px 40px rgba(255, 154, 162, 0.25),
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.8);
}

.glass-btn.icon-btn:active {
    transform: scale(0.98);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#menu-btn {
    left: 20px;
}

#order-btn {
    right: 20px;
}

/* WhatsApp Liquid Glass */
.whatsapp-order {
    color: #25D366;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(220, 255, 235, 0.7) 50%,
            rgba(255, 255, 255, 0.85) 100%);
}

.whatsapp-order::before {
    background: radial-gradient(circle at var(--glow-x) var(--glow-y),
            rgba(37, 211, 102, 0.5) 0%,
            rgba(255, 255, 255, 0) 60%) !important;
}

.whatsapp-order:hover {
    background: linear-gradient(135deg,
            rgba(37, 211, 102, 0.95) 0%,
            rgba(18, 140, 126, 0.9) 100%);
    color: white;
    box-shadow:
        0 12px 40px rgba(37, 211, 102, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Item Share Button */
.item-share-btn {
    display: none;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
}

.cake-item.active .item-share-btn {
    display: flex;
}

.item-share-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Loader */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.loader.visible {
    opacity: 1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 183, 178, 0.3);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Botones Glass - General - Liquid Glass Style */
.glass-btn {
    pointer-events: auto;
    position: relative;
    /* Liquid Glass Background */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.5) 40%,
            rgba(255, 255, 255, 0.7) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    color: var(--text);
    padding: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    --glow-x: 50%;
    --glow-y: 50%;
    overflow: hidden;
}

/* Liquid shimmer effect */
.glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--glow-x) var(--glow-y),
            rgba(255, 200, 200, 0.5) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.glass-btn:hover::before {
    opacity: 1;
}

.glass-btn:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.7) 40%,
            rgba(255, 255, 255, 0.85) 100%);
    box-shadow:
        0 15px 45px rgba(255, 154, 162, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

.glass-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Specific hover for AR btn */
#ar-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

/* Botón AR Principal */
#ar-controls {
    position: absolute;
    bottom: 25px;
    /* Lower position for better visibility */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: auto;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 50;
    /* Below menu */
}

/* --- Snow Effect --- */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.8) 50%,
            rgba(255, 255, 255, 0.4) 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: snowFall linear infinite;
    --drift: 0px;
}

@keyframes snowFall {
    0% {
        transform: translateY(-10px) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

/* --- Text Animations --- */
.brand-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 8px 20px;
    gap: 0;
}

/* Individual Brand Name Lines - Subtle Style */
.brand-name-line {
    font-family: 'Pacifico', cursive;
    color: #FFF5F5;
    /* Subtle soft shadow instead of hard lines */
    text-shadow:
        0 2px 15px rgba(200, 80, 100, 0.4),
        0 4px 25px rgba(180, 60, 80, 0.25),
        0 0 40px rgba(255, 200, 200, 0.3);
    position: relative;
    z-index: 1;
    line-height: 1;
    animation: floatText 6s ease-in-out infinite;
}

.brand-name-sweet {
    font-size: 2.2rem;
    animation-delay: 0s;
}

.brand-name-clarita {
    font-size: 3rem;
    animation-delay: 0.3s;
}

@keyframes floatText {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Gloss Effect DISABLED - was causing hard lines on title */
/*
.brand-name-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    animation: gloss 4s infinite linear;
    pointer-events: none;
}
*/

@keyframes gloss {
    0% {
        left: -100%;
    }

    100% {
        left: 150%;
    }
}

.cake-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);

    /* Shimmer Effect */
    background: linear-gradient(to right, var(--text) 0%, var(--primary) 50%, var(--text) 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s infinite linear;
}

@keyframes floatText {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* --- Dynamic AR Instruction - Liquid Glass --- */
.ar-instruction {
    /* Liquid Glass Background */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(255, 255, 255, 0.45) 50%,
            rgba(255, 255, 255, 0.6) 100%);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    transition: all 0.5s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    white-space: nowrap;
}

.ar-instruction.visible {
    opacity: 1;
}

.ar-instruction svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* AR Button - Liquid Glass Premium */
#ar-btn {
    border-radius: 50px;
    padding: 16px 36px;
    font-weight: 700;
    font-size: 1rem;
    gap: 12px;
    /* Darker Liquid Glass Pink Gradient for better contrast */
    background: linear-gradient(135deg,
            rgba(232, 138, 144, 0.98) 0%,
            rgba(212, 106, 114, 0.95) 50%,
            rgba(190, 85, 95, 0.98) 100%);
    color: white;
    border: 2px solid rgba(160, 60, 70, 0.4);
    box-shadow:
        0 15px 45px rgba(180, 80, 95, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on AR button */
#ar-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.25) 50%,
            transparent 100%);
    animation: shimmerAR 3s infinite;
}

@keyframes shimmerAR {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

#ar-btn:hover {
    background: linear-gradient(135deg,
            rgba(245, 160, 165, 1) 0%,
            rgba(230, 130, 140, 0.98) 50%,
            rgba(210, 110, 120, 1) 100%);
    box-shadow:
        0 20px 60px rgba(200, 100, 120, 0.55),
        0 8px 25px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

/* --- Catalog Menu --- */


/* ... existing styles ... */

/* Compact Menu - Cake List */
.cake-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    margin-top: 8px;
    max-height: calc(60vh - 100px);
}

#close-viewer-btn {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    border: none;
    z-index: 3001;
}

/* Dropdown open state */
#catalog-menu.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Compact Menu Title */
#catalog-menu h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ... */

#close-viewer-btn {
    position: absolute;
    top: 60px;
    /* Lower position */
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    border: none;
    z-index: 3001;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollbar styling for glass menu */
.cake-list::-webkit-scrollbar {
    width: 4px;
}

.cake-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.cake-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

/* Compact Cake Items - Liquid Glass Style */
.cake-item {
    padding: 12px 14px;
    margin-bottom: 4px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.4) 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cake-item:hover {
    background: linear-gradient(135deg,
            rgba(255, 154, 162, 0.25) 0%,
            rgba(255, 200, 200, 0.2) 100%);
    border-color: rgba(255, 154, 162, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(255, 154, 162, 0.15);
}

.cake-item.active {
    background: linear-gradient(135deg,
            rgba(255, 154, 162, 0.35) 0%,
            rgba(255, 200, 200, 0.25) 100%);
    border-color: rgba(255, 154, 162, 0.4);
    box-shadow:
        0 4px 20px rgba(255, 154, 162, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cake-item.active .cake-name {
    color: var(--primary);
    font-weight: 600;
}

.cake-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    max-width: 140px;
    /* Limit name width */
}

/* WhatsApp Button */
.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn svg {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* --- QR Modal (Updated) - Liquid Glass --- */
#qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#qr-modal.visible {
    display: flex;
    opacity: 1;
}

.qr-card {
    /* Liquid Glass Effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.7) 50%,
            rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 35px;
    border-radius: 28px;
    text-align: center;
    max-width: 340px;
    position: relative;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.12),
        0 10px 30px rgba(255, 154, 162, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#qr-modal.visible .qr-card {
    transform: scale(1);
}

.qr-card h2 {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6F61 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.qr-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

#close-qr-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    /* Liquid Glass Button */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#close-qr-btn:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.8) 100%);
    color: var(--text);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* --- Swiper Styles --- */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-wrapper {
    height: 100%;
    /* Ensure wrapper takes full height */
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: transparent;
    display: flex !important;
    /* Force flex */
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
    /* Ensure full height */
    width: 100% !important;
}

.swiper-slide img {
    display: block;
    max-width: 95%;
    max-height: 85%;
    /* Use % of container to avoid vh issues */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Custom Swiper Navigation - Liquid Glass */
.swiper-button-next,
.swiper-button-prev {
    color: var(--text) !important;
    /* Liquid Glass Effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0.7) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    width: 50px !important;
    height: 50px !important;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.3rem !important;
    font-weight: bold;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.75) 100%) !important;
    transform: scale(1.1);
    box-shadow:
        0 12px 40px rgba(255, 154, 162, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.8) !important;
    opacity: 0.6 !important;
    width: 10px;
    height: 10px;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: var(--primary) !important;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 154, 162, 0.5);
}

/* --- Photo Thumbs - Liquid Glass --- */
#photo-thumbs-container {
    position: absolute;
    bottom: 120px;
    /* Above AR controls */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 60;
    padding: 12px 16px;
    /* Liquid Glass Effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    max-width: 90%;
    overflow-x: auto;
    pointer-events: auto;
}

.thumb-img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.thumb-img:hover,
.thumb-img.active {
    border-color: var(--primary);
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 154, 162, 0.3);
}

/* --- Photo Viewer Overlay --- */
#photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#photo-viewer.visible {
    display: flex;
    opacity: 1;
}

.viewer-content {
    width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewer-img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#close-viewer-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    /* Liquid Glass Button */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.85) 0%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text);
    font-size: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 48px;
    height: 48px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3001;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#close-viewer-btn:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.7) 100%);
    transform: scale(1.1);
    box-shadow:
        0 12px 40px rgba(255, 154, 162, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.viewer-controls {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
}

/* --- AR Controls Updates --- */
#ar-controls {
    position: absolute;
    bottom: 20px;
    /* Lower position */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: auto;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 50;
}

.ar-instruction {
    background: rgba(255, 255, 255, 0.4);
    /* More subtle */
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text);
    backdrop-filter: blur(3px);
    animation: float 3s ease-in-out infinite;
    order: 2;
    opacity: 0.9;
}

#ar-btn {
    border-radius: 50px;
    padding: 12px 30px;
    /* Smaller padding */
    font-weight: 600;
    font-size: 1rem;
    /* Smaller font */
    gap: 10px;
    background: #FF9AA2;
    color: white;
    border: 2px solid rgba(191, 78, 100, 0.6);
    box-shadow: 0 5px 15px rgba(191, 78, 100, 0.5);
    order: 1;
    /* Place above instruction */
}

#qr-modal.visible {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

.qr-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
}

.qr-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.qr-content p {
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-light);
    font-size: 1.1rem;
}

.qr-image {
    width: 220px;
    height: 220px;
    border-radius: 15px;
    margin: 0 auto;
    display: block;
    border: 2px solid #eee;
    padding: 10px;
}

/* --- Mobile Permission Overlay - Liquid Glass --- */
#permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 245, 245, 0.95) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

/* Permission Card - Liquid Glass */
.permission-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.7) 50%,
            rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    padding: 40px 50px;
    text-align: center;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.08),
        0 10px 30px rgba(255, 154, 162, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    max-width: 320px;
    animation: permissionSlideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes permissionSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.permission-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg,
            rgba(255, 154, 162, 0.2) 0%,
            rgba(255, 200, 200, 0.3) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.permission-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.permission-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.tap-hint {
    display: inline-block;
    background: linear-gradient(135deg,
            rgba(255, 154, 162, 0.9) 0%,
            rgba(255, 130, 140, 0.85) 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow:
        0 8px 25px rgba(255, 154, 162, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    cursor: pointer;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 154, 162, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(255, 154, 162, 0.5);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Mobile Landscape Optimizations --- */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Hide photo selector in landscape mobile */
    #photo-thumbs-container {
        display: none !important;
    }

    /* Hide AR instruction popup */
    .ar-instruction {
        display: none !important;
    }

    /* Lower AR button position in landscape */
    #ar-controls {
        bottom: 8px;
        gap: 4px;
    }

    #ar-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
    }

    /* Compact header for landscape */
    header {
        padding-top: 10px;
    }

    .brand-name-sweet {
        font-size: 1.6rem;
    }

    .brand-name-clarita {
        font-size: 2.2rem;
    }

    .cake-title {
        font-size: 1.1rem;
        margin-top: 5px;
    }

    .cake-description {
        font-size: 0.75rem;
        max-width: 90%;
    }

    /* Adjust side buttons */
    .glass-btn.icon-btn {
        top: 15px;
        width: 40px;
        height: 40px;
    }

    #menu-btn {
        left: 15px;
    }

    #order-btn {
        right: 15px;
    }
}