/* Luxury Main CSS - Premium Base Styles for Ziyorate */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Luxury Brand Variables */
:root {
    /* Premium Color Palette */
    --cream-50: #FDFCF9;
    --cream-100: #F8F6F1;
    --cream-200: #F5F1E8;
    --cream-300: #EFEBE0;
    
    --green-900: #0A1F1A;
    --green-800: #0F2922;
    --green-700: #1B4D3E;
    --green-600: #2D6B5A;
    --green-500: #4A8B7A;
    
    --gold-400: #E6C068;
    --gold-500: #D4AF37;
    --gold-600: #B8941F;
    --gold-700: #9A7B1A;
    
    --neutral-900: #1A1A1A;
    --neutral-800: #2A2A2A;
    --neutral-700: #404040;
    --neutral-600: #525252;
    --neutral-500: #737373;
    --neutral-400: #A3A3A3;
    --neutral-300: #D4D4D4;
    --neutral-200: #E5E5E5;
    --neutral-100: #F5F5F5;
    --neutral-50: #FAFAFA;
    
    --white: #FFFFFF;
    --black: #000000;
    
    /* Typography Scale */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */
    
    /* Font Weights */
    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing Scale */
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */
    --space-32: 8rem;        /* 128px */
    
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Luxury Shadows */
    --shadow-luxury: 0 8px 30px rgba(27, 77, 62, 0.12);
    --shadow-luxury-lg: 0 15px 40px rgba(27, 77, 62, 0.15);
    --shadow-gold: 0 8px 25px rgba(212, 175, 55, 0.2);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-luxury: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    zoom: 0.8;
    color: var(--neutral-800);
    background-color: var(--cream-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    margin-top: 3%;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-medium);
    line-height: 1.2;
    color: var(--green-800);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-4);
    line-height: 1.7;
    color: var(--neutral-600);
}

/* Links */
a {
    color: var(--green-700);
    text-decoration: none;
    transition: all var(--transition-base);
}

a:hover {
    color: var(--gold-600);
}

/* Container System */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-8);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-12);
    }
}

/* IMAGE LOADING SYSTEM */

/* Base Image Container */
.image-container {
    position: relative;
    overflow: hidden;
    background: var(--cream-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Skeleton Base */
.image-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--neutral-200) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        var(--neutral-200) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite ease-in-out;
    z-index: 2;
    transition: opacity var(--transition-luxury);
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading Spinner */
.image-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    z-index: 3;
    opacity: 1;
    transition: opacity var(--transition-luxury);
}

.loading-ring {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top: 3px solid var(--gold-500);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

/* Luxury Loading Dots */
.image-loading-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: var(--space-2);
    z-index: 3;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--gold-500);
    border-radius: 50%;
    animation: dot-bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Pulse Loading Effect */
.image-loading-pulse {
    position: absolute;
    inset: 0;
    background: var(--cream-200);
    z-index: 2;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Wave Loading Effect */
.image-loading-wave {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        var(--cream-200) 25%,
        transparent 25%,
        transparent 75%,
        var(--cream-200) 75%,
        var(--cream-200)
    );
    background-size: 20px 20px;
    animation: wave 2s linear infinite;
    z-index: 2;
}

@keyframes wave {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}

/* Image States */
.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--transition-luxury);
    z-index: 1;
}

/* Loading State */
.image-container.loading img {
    opacity: 0;
}

.image-container.loading .image-skeleton,
.image-container.loading .image-loading-spinner,
.image-container.loading .image-loading-dots,
.image-container.loading .image-loading-pulse,
.image-container.loading .image-loading-wave {
    opacity: 1;
}

/* Loaded State */
.image-container.loaded img {
    opacity: 1;
}

.image-container.loaded .image-skeleton,
.image-container.loaded .image-loading-spinner,
.image-container.loaded .image-loading-dots,
.image-container.loaded .image-loading-pulse,
.image-container.loaded .image-loading-wave {
    opacity: 0;
    pointer-events: none;
}

/* Error State */
.image-container.error {
    background: var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-error-icon {
    color: var(--neutral-400);
    font-size: var(--text-2xl);
}

/* Specific Image Types */

/* Product Images */
.product-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: var(--cream-100);
}

.product-image .image-skeleton {
    border-radius: var(--radius-2xl);
}

/* Hero Images */
.hero-image {
    position: relative;
    border-radius: var(--radius-3xl);
    overflow: hidden;
    background: var(--cream-100);
}

.hero-image .image-skeleton {
    border-radius: var(--radius-3xl);
}

/* Collection Images */
.collection-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--cream-100);
}

/* Lazy Loading Integration */
.lazy-image {
    opacity: 0;
    transition: opacity var(--transition-luxury);
}

.lazy-image.loaded {
    opacity: 1;
}

/* Progressive Enhancement */
.no-js .image-container .image-skeleton,
.no-js .image-container .image-loading-spinner,
.no-js .image-container .image-loading-dots {
    display: none;
}

.no-js .image-container img {
    opacity: 1;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-luxury);
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--green-700);
    color: var(--white);
    border-color: var(--green-700);
    box-shadow: var(--shadow-luxury);
}

.btn-primary:hover {
    background-color: var(--green-800);
    border-color: var(--green-800);
    box-shadow: var(--shadow-luxury-lg);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--green-700);
    border-color: var(--green-700);
}

.btn-secondary:hover {
    background-color: var(--green-700);
    color: var(--white);
}

.btn-gold {
    background-color: var(--gold-500);
    color: var(--white);
    border-color: var(--gold-500);
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    background-color: var(--gold-600);
    border-color: var(--gold-600);
    transform: translateY(-1px);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
}

.section-eyebrow {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gold-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-light);
    color: var(--green-800);
    margin-bottom: var(--space-6);
}

.section-description {
    font-size: var(--text-lg);
    color: var(--neutral-600);
    line-height: 1.7;
    margin-bottom: 0;
}

/* Card System */
.card {
    background-color: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-luxury);
    overflow: hidden;
    transition: all var(--transition-luxury);
}

.card:hover {
    box-shadow: var(--shadow-luxury-lg);
    transform: translateY(-4px);
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-luxury);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Color Utilities */
.text-gold { color: var(--gold-600); }
.text-green { color: var(--green-700); }
.text-neutral { color: var(--neutral-600); }

/* Spacing Utilities */
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

/* Responsive Typography */
@media (max-width: 640px) {
    :root {
        --text-4xl: 2rem;      /* 32px */
        --text-5xl: 2.5rem;    /* 40px */
        --text-6xl: 3rem;      /* 48px */
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .image-loading-spinner {
        width: 30px;
        height: 30px;
    }
    
    .loading-ring {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
}

@media (min-width: 1024px) {
    .section-title {
        font-size: var(--text-5xl);
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-auto {
    will-change: auto;
}

/* Focus Management */
.focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .image-skeleton,
    .loading-ring,
    .loading-dot,
    .image-loading-pulse,
    .image-loading-wave {
        animation: none;
    }
    
    .image-container img {
        transition-duration: 0.01ms;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .image-skeleton {
        background: linear-gradient(
            90deg,
            var(--neutral-800) 0%,
            var(--neutral-600) 50%,
            var(--neutral-800) 100%
        );
    }
    
    .loading-ring {
        border-top-color: var(--neutral-900);
    }
    
    .loading-dot {
        background: var(--neutral-900);
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .image-skeleton,
    .image-loading-spinner,
    .image-loading-dots,
    .image-loading-pulse,
    .image-loading-wave {
        display: none !important;
    }
    
    .image-container img {
        opacity: 1 !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    img {
        page-break-inside: avoid;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}