/* Отключаем нативный скролл для плавного JS скролла */
html {
    scroll-behavior: auto;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #9B2C2C; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #742020; 
}

/* ПРЕЛОАДЕР */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1A202C;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.preloader-logo {
    width: 110px;
    height: 110px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse-logo 2s infinite ease-in-out;
}

.preloader-mark {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preloader-ring {
    position: absolute;
    inset: -10px;
    border: 1px solid #C5A065;
    border-radius: 2px;
    opacity: 0;
    animation: ring-expand 2s infinite ease-out;
}

@keyframes pulse-logo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ring-expand {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* АНИМАЦИЯ ПОЯВЛЕНИЯ */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-element.active {
    opacity: 1;
    transform: translateY(0);
}

/* МОДАЛЬНЫЕ ОКНА */
.modal-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Эффект блика */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: none;
    animation: shine 4s infinite linear;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* «Работаем с 2017 года» в hero. Блок живёт строго между шапкой и нижними
   карточками, а размеры считаются от высоты окна — иначе на низких экранах
   он наезжает на навигацию сверху и на карточки снизу. */
.hero-year {
    position: absolute;
    right: 2rem;
    top: 8.5rem;
    bottom: 11rem;
    z-index: 20;
}
@media (min-width: 1536px) {
    .hero-year {
        right: 4rem;
    }
}
.hero-year__num {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    line-height: 1;
    font-size: 150px;
    color: #fff;
    opacity: 0.9;
}
@media (min-width: 1536px) {
    .hero-year__num {
        font-size: 200px;
    }
}
.hero-year__num--top {
    margin-bottom: -0.27em;
}
.hero-year__num.text-brand-red {
    color: #9B2C2C;
    opacity: 1;
}
.hero-year__label {
    font-size: 14px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}
.hero-year__label--bottom {
    margin-bottom: 0;
    margin-top: 1.5rem;
}
.hero-year__line {
    width: 2px;
    height: 80px;
    margin-top: 1.25rem;
    background: linear-gradient(to bottom, transparent, #9CA3AF, transparent);
}

/* Невысокие окна: блоку негде развернуться в полный размер.
   Уменьшаем ступенями, а совсем при низком окне убираем — иначе
   он наезжает на навигацию сверху и на карточки снизу. */
@media (max-height: 969px) {
    .hero-year__num { font-size: 150px; }
    .hero-year__line { height: 56px; }
}
@media (max-height: 620px) {
    .hero-year { display: none !important; }
}

.hover-gold-border:hover {
    border-color: #C5A065;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#mobileMenu {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%);
}
#mobileMenu.active {
    transform: translateX(0);
}

#scrollToTop {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Фирменный «отпечаток» водяным знаком в фоне секций */
.section-watermark {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 520px;
    max-width: 55%;
    opacity: 0.05;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}
.section-watermark.left {
    right: auto;
    left: -80px;
    top: auto;
    bottom: -80px;
}

/* Фоновое фото секции «Доставка» — текст лежит поверх, читаемость держит оверлей */
.delivery-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}
.delivery-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(26, 32, 44, 0.97) 0%, rgba(26, 32, 44, 0.93) 40%, rgba(26, 32, 44, 0.86) 100%),
        linear-gradient(to bottom, rgba(26, 32, 44, 0.55) 0%, rgba(26, 32, 44, 0) 30%, rgba(26, 32, 44, 0.55) 100%);
}
@media (max-width: 767px) {
    .delivery-overlay {
        background: linear-gradient(to bottom, rgba(26, 32, 44, 0.94) 0%, rgba(26, 32, 44, 0.9) 60%, rgba(26, 32, 44, 0.95) 100%);
    }
}

/* Чертёжная сетка в фоне секции «Техническая документация» */
.blueprint-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(26, 32, 44, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 32, 44, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 75% 25%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 75% 25%, #000 0%, transparent 75%);
}
.blueprint-decor {
    position: absolute;
    top: -20px;
    right: 12px;
    width: 540px;
    max-width: 46%;
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}
@media (max-width: 767px) {
    .blueprint-decor {
        display: none;
    }
}
/* ПРОСМОТР ОБРАЗЦОВ ДОКУМЕНТОВ */
.doc-viewer-scroll {
    -webkit-overflow-scrolling: touch;
}
.doc-viewer-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
/* На узких экранах лист шире окна: даём ему всю ширину и вертикальный скролл */
@media (max-width: 767px) {
    .doc-viewer-img {
        width: 100%;
        height: auto;
        align-self: flex-start;
    }
}
