/* ==========================================================================
   BASE STYLES - Общие стили для всех устройств
   ========================================================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* CSS Variables */
:root {
    /* Colors */
    --primary-red: #B91414;
    --primary-dark: #251A1F;
    --primary-light: #FFFFFD;
    --text-secondary: rgba(37, 26, 31, 0.7);
    --text-muted: rgba(37, 26, 31, 0.5);
    --background-light: #FBF8F6;
    --background-subtle: rgba(57, 7, 7, 0.02);
    --background-accent: #F6E6E4;
    
    /* Typography */
    --font-primary: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-times: 'Times New Roman', serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index layers */
    --z-header: 1000;
    --z-modal: 9999;
    --z-overlay: 10000;
    
    /* Breakpoints */
    --mobile-max: 480px;
    --tablet-min: 481px;
    --desktop-min: 769px;
    --desktop-large: 1440px;
}

/* Responsive Display Classes */
.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

/* ==========================================================================
   UNIVERSAL LOADER - Универсальный лоадер для всех устройств
   ========================================================================== */

.loader-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--primary-light) !important;
    z-index: var(--z-overlay) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity var(--transition-slow), visibility var(--transition-slow) !important;
}

.loader-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

.loader-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    background-color: var(--primary-light) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
}

.loader-logo {
    font-family: var(--font-serif) !important;
    font-weight: 500 !important;
    color: var(--primary-dark) !important;
    text-align: center !important;
    animation: loaderPulse 2s ease-in-out infinite !important;
    
    /* Responsive font size */
    font-size: clamp(32px, 5vw, 64px) !important;
    letter-spacing: clamp(-1.6px, -0.05em, -3.2px) !important;
    line-height: 1 !important;
}

@keyframes loaderPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Base body styles */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background-color: var(--primary-light);
    color: var(--primary-dark);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Typography base */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-red);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: #8a1010;
}

/* Button base styles */
button {
    font-family: var(--font-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

button:hover {
    transform: translateY(-2px);
}

/* Form elements */
input, textarea {
    font-family: var(--font-primary);
    outline: none;
    border: none;
    transition: all var(--transition-normal);
}

/* 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;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hide custom scrollbar on desktop */
@media (min-width: 769px) {
    ::-webkit-scrollbar {
        display: none;
    }
    
    body {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Hide custom scrollbar on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        display: none;
    }
    
    body {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Print styles */
@media print {
    * {
        color: black !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    .no-print {
        display: none !important;
    }
}