/* Custom Scrollbar */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    scroll-padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
}

#hero-section,
#hero-section > section {
    max-width: 100%;
}

#preview-section,
#choose-look-section,
#selected-piece-bar {
    max-width: 100%;
}

#choose-look-section {
    width: auto;
}

#onboarding-guide,
#selected-piece-bar,
#tryon-action-card,
#upload-panel,
#photo-preview-card {
    width: auto;
    max-width: 100%;
}

#selected-piece-bar,
#selected-piece-bar * {
    min-width: 0;
}

#onboarding-guide .guide-step,
.stage-pill {
    min-width: 0;
    overflow: hidden;
}

.pwa-phone-shell {
    background:
        radial-gradient(circle at 50% 9%, rgba(197, 138, 29, 0.10), transparent 28%),
        linear-gradient(180deg, #fffaf4 0%, #fbf5ec 42%, #fff7f2 100%);
}

.tryon-control-sheet {
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.tryon-product-rail {
    scroll-snap-type: x mandatory;
}

.tryon-product-rail .product-card {
    scroll-snap-align: start;
}

.tryon-history-rail {
    scroll-snap-type: x mandatory;
}

.tryon-history-rail .history-card {
    scroll-snap-align: start;
}

.hero-user-photo {
    filter: none;
    mix-blend-mode: normal;
}

.hero-model-photo {
    filter: saturate(1.03) contrast(1.01);
    mix-blend-mode: normal;
}

#bottom-nav nav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
}

.bg-burgundy { background-color: #7a0032; }
.text-burgundy { color: #7a0032; }
.border-burgundy { border-color: #7a0032; }
.bg-claret { background-color: #5f062a; }
.text-claret { color: #5f062a; }
.bg-jade { background-color: #0f8a45; }
.text-jade { color: #0f8a45; }
.bg-ivory { background-color: #fffaf2; }
.bg-pearl { background-color: #f8f3ea; }
.text-ink { color: #171717; }
.shadow-luxury { box-shadow: 0 22px 60px rgba(122, 0, 50, 0.12); }

.product-cutout {
    mix-blend-mode: multiply;
    filter: saturate(1.06) contrast(1.03);
}

.home-action-card {
    min-height: 86px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 15px;
    background: rgba(255,255,255,0.86);
    box-shadow: 0 8px 18px rgba(122,0,50,0.06);
    padding: 7px 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    font-size: 9px;
    line-height: 1.12;
    font-weight: 700;
}
.home-action-card > .material-symbols-outlined:first-child {
    font-size: 23px !important;
}
.home-card-chevron {
    margin-top: 0;
    font-size: 14px !important;
    color: #7a0032;
    opacity: .85;
}
.home-action-card:active {
    transform: scale(0.98);
}

.chip-btn {
    flex-shrink: 0;
    min-height: 42px;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.07);
    background: rgba(255,255,255,0.86);
    color: #64748b;
    padding: 0 18px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    box-shadow: 0 8px 22px rgba(122,0,50,0.05);
}
.chip-btn.active {
    border-color: #7a0032;
    background: #7a0032;
    color: white;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glassmorphism */
.ios-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Text Gradients */
.gold-gradient-text {
    background: linear-gradient(to right, #D4AF37, #F9E4B7, #D4AF37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Toast Animation */
@keyframes slideUpFade {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.toast-enter {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Material Symbols Fix */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Login Modal */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.login-modal.show {
    display: flex;
}

/* Order Status */
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-completed { background: #dbeafe; color: #1e40af; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Gold Color */
.text-gold {
    color: #c58a1d;
}
.bg-gold {
    background-color: #c58a1d;
}
.border-gold {
    border-color: #c58a1d;
}

/* Line Clamp */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Snap Scroll */
.snap-x {
    scroll-snap-type: x mandatory;
}
.snap-center {
    scroll-snap-align: center;
}
.snap-mandatory {
    scroll-snap-type: x mandatory;
}

/* Shimmer Loading Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* Camera Video Mirror Effect (for front camera selfie view) */
#camera-video.mirror {
    transform: scaleX(-1);
}

/* Camera Modal Animations */
#camera-modal {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 390px) {
    #choose-look-section {
        margin-left: 14px;
        margin-right: 14px;
        padding-left: 12px;
        padding-right: 12px;
    }

    #onboarding-guide {
        padding: 10px;
    }

    #onboarding-guide .guide-step {
        height: 30px;
        width: 30px;
    }

    #advisor-hint {
        font-size: 11px;
        line-height: 1.45;
    }
}
