/* ===================================
   Layout Styles
   =================================== */

/* Prevent horizontal overflow on mobile.
   overflow-x:hidden is the fallback for older iOS Safari (<16);
   overflow-x:clip overrides it in browsers that support it (no BFC side-effects). */
html, body {
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100%;
}

/* svh fallback: browsers that don't support svh get vh */
@supports not (min-height: 1svh) {
    .min-h-svh, .min-h-\[85svh\] {
        min-height: 85vh;
    }
}

/* Safety: ensure long text wraps instead of overflowing */
h1, h2, h3, h4, h5, h6, p, span, a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Animation delay utilities */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

/* Initially hidden for animation */
.animate-on-load {
    opacity: 0;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism card */
.glass-card {
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .hover-lift:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

/* ===================================
   Fixed Background Orbs
   =================================== */
.fixed-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.bg-orb-1 {
    top: 10%;
    left: 5%;
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.15);
    animation: float 8s ease-in-out infinite;
}

.bg-orb-2 {
    top: 60%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.12);
    animation: float 10s ease-in-out infinite;
    animation-delay: -2s;
}

.bg-orb-3 {
    bottom: 10%;
    left: 30%;
    width: 350px;
    height: 350px;
    background: rgba(236, 72, 153, 0.1);
    animation: float 12s ease-in-out infinite;
    animation-delay: -4s;
}

.bg-orb-4 {
    top: 30%;
    right: 30%;
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.1);
    animation: float 9s ease-in-out infinite;
    animation-delay: -1s;
}

/* ===================================
   Account Dropdown Styles
   =================================== */
.account-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .account-btn:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
    }

.account-dropdown {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

    .account-dropdown .dropdown-item {
        color: #e5e7eb;
        padding: 10px 14px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        transition: all 0.2s ease;
    }

        .account-dropdown .dropdown-item:hover {
            background: rgba(59, 130, 246, 0.2);
            color: white;
        }

    .account-dropdown .dropdown-header {
        padding: 10px 14px;
    }

    .account-dropdown .dropdown-divider {
        margin: 4px 0;
        opacity: 0.3;
    }

/* Cart Navigation Styles */
.cart-nav-link {
    position: relative;
}

.cart-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 0.25rem;
    isolation: isolate;
}

.cart-icon-wrapper .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.cart-badge:hover {
    transform: scale(1.15);
}

/* ===================================
   Light Theme Overrides
   =================================== */

/* Background: replace dark gradient with light surface */
[data-theme="light"] .fixed-background {
    background: var(--bg-page, #ffffff);
}

[data-theme="light"] .fixed-background .absolute {
    background: linear-gradient(135deg, #ffffff, #f5f5f5, #ffffff) !important;
}

/* Tone down orbs heavily — subtle pastel wash only */
[data-theme="light"] .bg-orb {
    opacity: 0.12;
    filter: blur(120px);
}

[data-theme="light"] .bg-orb-1 {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .bg-orb-2 {
    background: rgba(139, 92, 246, 0.06);
}

[data-theme="light"] .bg-orb-3 {
    background: rgba(236, 72, 153, 0.05);
}

[data-theme="light"] .bg-orb-4 {
    background: rgba(59, 130, 246, 0.05);
}

/* Glass card — soft warm surface */
[data-theme="light"] .glass-card {
    background: rgba(245, 246, 248, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .hover-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Account dropdown */
[data-theme="light"] .account-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .account-dropdown .dropdown-item {
    color: #374151;
}

[data-theme="light"] .account-dropdown .dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1f2937;
}

[data-theme="light"] .account-btn {
    color: #6b7280;
}

[data-theme="light"] .account-btn:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.05);
}
