/* ============================================
   REDGRID PORTFOLIO - MINIMAL STYLE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0a;
    --bg-light: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #999999;
    --accent-red: #cccccc; /* Changed to neutral gray */
    --line-color: #333333;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    overflow: hidden;
}

a {
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-red);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left, .header-right, .header-center {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
}

.logo {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.7;
}

.studio-name {
    font-size: 16px;
    font-weight: 300;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999999;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.studio-name:hover {
    opacity: 0.7;
}

/* Language Selector */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 300;
    color: #999999;
    transition: opacity 0.3s ease, color 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
}

.lang-button:hover {
    color: var(--accent-red);
    opacity: 0.8;
}

.lang-menu {
    position: absolute;
    top: 45px;
    left: 0;
    background: var(--bg-light);
    display: none;
    flex-direction: column;
    min-width: 120px;
    z-index: 1000;
}

.lang-menu.active {
    display: flex;
}

.lang-option {
    background: none;
    border: none;
    color: #999999;
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    font-weight: 300;
}

.lang-option:hover {
    background: var(--bg-dark);
    color: var(--accent-red);
}

.lang-option.active {
    color: white;
    font-weight: 400;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999999;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent-red);
    opacity: 0.8;
}

.theme-icon {
    display: inline-block;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-button svg {
    width: 24px;
    height: 24px;
    stroke: #999999;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}

.menu-button:hover svg {
    stroke: var(--accent-red);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

#content-container {
    margin-top: 60px;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.page {
    width: 100%;
    height: 100%;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   PORTFOLIO PAGE
   ============================================ */

.portfolio-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Navigation */
.left-nav {
    width: 200px;
    padding: 0;
    border-right: none;
    overflow-y: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border-left: none;
    border-bottom: none;
    transition: all 0.3s ease;
    color: #999999;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.nav-item.category-link {
    font-size: 11px;
    color: #777777;
}

.nav-item:hover {
    color: var(--text-white);
}

.nav-item:hover .counter {
    opacity: 0.9;
}

.nav-item.active {
    color: var(--text-white);
}

.counter {
    display: inline-block;
    margin-left: 12px;
    padding: 0;
    background-color: transparent;
    color: #555555;
    font-size: 11px;
    font-weight: 300;
    min-width: 0;
    text-align: left;
    vertical-align: top;
    position: relative;
    top: -2px;
}

.nav-item:hover .counter {
    color: #777777;
    opacity: 1;
}

.nav-item.active .counter {
    background-color: transparent;
    color: var(--text-white);
}

/* Center - Main Image */
.center-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    padding: 40px;
    overflow: hidden;
}

.portfolio-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Убрал animation: zoomIn */
    opacity: 1;
    transition: opacity 0.2s ease-in-out; /* Плавное изменение прозрачности */
}

/* Right Carousel */
.right-carousel {
    width: 200px;
    padding: 40px 20px;
    border-left: none;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow: hidden;
    align-items: center;
    position: relative;
}

.carousel-counter {
    position: absolute;
    top: 50%;
    left: 20px; /* Adjust based on padding */
    transform: translateY(-50%);
    text-align: center;
    color: var(--text-gray);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    z-index: 10;
}

.carousel-container {
    flex: 1;
    overflow: visible;
    position: relative;
    height: 100%; /* Ensure container takes full height */
    margin-left: 45px; /* Offset for the absolute counter */
}

.carousel-track {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow-y: hidden; /* Disable user scrolling */
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-top: 50vh; /* Spacer to center first item */
    padding-bottom: 50vh; /* Spacer to center last item */
    margin-top: -60px; /* Offset for header/padding correction */
    align-items: center;
}

.carousel-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: transparent;
    cursor: pointer;
    overflow: visible;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-item:hover {
    opacity: 0.8;
}

.carousel-item.active {
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    gap: 30px;
}

.about-container p {
    max-width: 600px;
    text-align: center;
    font-size: 18px;
    color: var(--text-gray);
}

/* ============================================
   ORDER PAGE
   ============================================ */

.order-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    position: relative;
}

/* Wizard Header */
.wizard-header {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.wizard-steps {
    display: flex;
    gap: 15px;
}

.step-dot {
    width: 8px;
    height: 8px;
    background-color: var(--line-color);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.step-dot.active {
    background-color: var(--text-white);
}

/* Wizard Form */
.order-form {
    max-width: 600px;
    width: 100%;
    margin-bottom: 60px; /* Space for the bottom dots */
}

.wizard-step {
    display: none;
    flex-direction: column;
    gap: 30px;
    animation: fadeIn 0.4s ease;
}

.wizard-step.active {
    display: flex;
}

.step-title {
    font-size: 32px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.2;
}

.step-desc {
    text-align: center;
    color: var(--text-gray);
    font-size: 16px;
    max-width: 450px;
    margin: 0 auto;
}

/* Service Options */
.service-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.radio-option {
    position: relative;
    cursor: pointer;
}

.radio-option input {
    position: absolute;
    opacity: 0;
}

.radio-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--bg-light);
    border: 1px solid var(--line-color);
    color: var(--text-gray);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    height: 100px;
    text-align: center;
}

.radio-option input:checked + span {
    border-color: var(--text-white);
    color: var(--text-white);
    background-color: var(--bg-dark);
}

.radio-option:hover span {
    border-color: var(--text-gray);
}

/* Inputs & Textareas */
textarea {
    width: 100%;
    height: 150px;
    background-color: var(--bg-light);
    border: 1px solid var(--line-color);
    color: var(--text-white);
    padding: 15px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

textarea:focus, input:focus, select:focus {
    border-color: var(--text-white);
}

input[type="number"], input[type="text"] {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-light);
    border: 1px solid var(--line-color);
    color: var(--text-white);
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

select {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-light);
    border: 1px solid var(--line-color);
    color: var(--text-white);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.form-actions.center {
    justify-content: center;
}

.submit-btn {
    padding: 12px 30px;
    background-color: var(--text-white);
    color: var(--bg-dark);
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    opacity: 0.8;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    padding: 12px 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--text-white);
}

.close-wizard-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-wizard-btn:hover {
    color: var(--text-white);
}

@media (max-width: 768px) {
    .service-options {
        /* grid-template-columns: 1fr; - Keep 2 columns on mobile */
    }
    
    .step-title {
        font-size: 24px;
    }
}

/* ============================================
   MENU
   ============================================ */

/* FULLSCREEN MENU */
.menu-fullscreen {
    position: fixed;
    top: 60px; /* Below Header */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background-color: var(--bg-dark);
    z-index: 99; /* Below Header (100) */
    display: flex;
    flex-direction: column;
    padding: 40px 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

/* Удаляем menu-header и menu-close так как крестик теперь в основном хедере */
.menu-header, .menu-close {
    display: none;
}

.menu-content {
    flex: 1;
    display: flex;
    align-items: center; /* Центрирование по вертикали */
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.menu-grid {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

/* Column 1: Main Nav */
.nav-column {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-column a {
    font-size: 40px;
    font-weight: 300;
    text-transform: uppercase;
    color: var(--text-white);
    transition: color 0.3s ease;
    line-height: 1.2;
}

.nav-column a:hover {
    opacity: 0.7; /* No red color */
}

/* Column 2: Contacts */
.contacts-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 10px;
}

.contacts-column a {
    font-size: 16px;
    color: var(--text-white);
    transition: color 0.3s ease;
}

.contacts-column a:hover {
    opacity: 0.7;
}

/* Column 3: Newsletter */
.newsletter-column {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 10px;
}

.newsletter-desc {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.5;
    max-width: 300px;
}

.menu-label {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

/* Newsletter Form */
.input-group {
    display: flex;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 10px;
    margin-top: 10px;
}

.input-group input {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 16px;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.input-group button {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding-left: 10px;
}

.input-group button:hover {
    opacity: 0.7;
}

.newsletter-success {
    color: var(--text-white);
    font-size: 14px;
    margin-top: 10px;
    opacity: 0.7;
}

@media (max-width: 1024px) {
    .menu-grid {
        flex-direction: column;
        gap: 60px;
    }

    .nav-column a {
        font-size: 32px;
    }

    .menu-content {
        align-items: flex-start;
        padding-top: 20px;
        overflow-y: auto;
    }
}

/* ============================================
   SCROLLBARS
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--line-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-gray);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .left-nav {
        width: 150px;
        padding: 30px 15px;
    }

    .right-carousel {
        width: 120px;
        padding: 30px 15px;
    }

    .menu-sidebar {
        width: 100%;
        right: 0;
    }
}

@media (max-width: 768px) {
    .portfolio-container {
        flex-direction: column;
    }

    .left-nav {
        width: 100%;
        height: auto;
        padding: 10px 0;
        order: -1; /* Move to top */
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-bottom: 5px;
        padding: 0 20px;
        height: auto;
        overflow: visible;
    }

    .nav-item.mobile-hidden {
        display: none;
    }

    .nav-menu.expanded .nav-item.mobile-hidden {
        display: flex;
    }

    .nav-item {
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Mobile Expand Button */
    .mobile-expand-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #999999;
        cursor: pointer;
        padding: 5px;
        margin-top: -5px;
    }

    .mobile-expand-btn svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
    }
    
    .nav-item.category-link {
        font-size: 10px;
    }

    .right-carousel {
        display: flex !important;
        width: 100%;
        height: 80px;
        padding: 10px 0;
        border-left: none;
        position: fixed;
        bottom: 20px;
        left: 0;
        right: 0;
        z-index: 95;
        background-color: var(--bg-dark);
        align-items: center;
        gap: 0;
        transform: translateZ(0); /* Force GPU */
        -webkit-transform: translateZ(0);
        overflow: visible; /* Allow counter to be seen outside */
    }

    .right-carousel .carousel-counter {
        display: flex;
        position: absolute;
        top: -30px; /* Position above carousel */
        left: 50%;
        transform: translateX(-50%);
        color: var(--text-gray);
        font-size: 12px;
        background: transparent;
        padding: 0;
        z-index: 100;
    }

    .right-carousel .carousel-container {
        margin-left: 0;
        width: 100%;
        height: 100%;
        overflow-x: auto;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .right-carousel .carousel-container::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .right-carousel .carousel-track {
        flex-direction: row;
        width: max-content;
        height: 100%;
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 50vw;
        padding-right: 50vw;
        margin-top: 0;
        gap: 10px;
        align-items: center;
    }

    .right-carousel .carousel-item {
        height: 100%;
        width: auto;
        aspect-ratio: 16 / 9;
    }

    .center-image {
        width: 100%;
        flex: 1;
        padding: 20px;
        padding-bottom: 120px; /* Increased to account for carousel + gap */
        padding-top: 60px; /* Add top padding to balance */
        display: flex;
        align-items: center; /* Vertical center */
        justify-content: center; /* Horizontal center */
    }
    
    .portfolio-image {
        max-height: 50vh; /* Limit height on mobile */
        width: auto;
        max-width: 100%;
    }

    .menu-sidebar {
        width: 100%;
    }
}
