body {
    margin: 0px;
    font-family: Golos Text, Arial, sans-serif;
    font-weight: 500;
}

a {
    text-decoration: none;
    color: black;
}

.controls-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: none;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    z-index: 100;
    padding: 10px;
    border-radius: 10px;
    transition: opacity 0.3s;
}

.controls-arrows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 155px;
    height: 125px;
}

.controls-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#controlsMovementSvg {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

#controlsMovementSvg.hidden {
    opacity: 0;
    pointer-events: none;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f0f2f5;
    flex-direction: column;
}

#secondDroorMenu {
    display: block;
    opacity: 0;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    height: 90%;
    /*max-height: 90vh;*/
    overflow-y: auto;
    border-radius: 0;
    padding: 20px;
    z-index: 200;
    pointer-events: none;
    transition: opacity 0.3s;
}

#secondDroorMenu::-webkit-scrollbar {
    width: 8px;
}

#secondDroorMenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 10px 10px 0;
}

#secondDroorMenu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#secondDroorMenu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.btn-link {
    width: 6.5em;
    height: 2.3em;
    margin: 0.5em;
    background: #F6CC00;
    color: white;
    border: none;
    border-radius: 0.625em;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-open {
    width: 6.5em;
    height: 2.3em;
    margin: 0.5em;
    background: black;
    color: white;
    border: none;
    border-radius: 0.625em;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-open:hover, .btn-link:hover {
    color: black;
}

.btn-open:after, .btn-link:after {
    content: "";
    background: white;
    position: absolute;
    z-index: -1;
    left: -20%;
    right: -20%;
    top: 0;
    bottom: 0;
    transform: skewX(-45deg) scale(0, 1);
    transition: all 0.5s;
}

.btn-open:hover:after, .btn-link:hover:after {
    transform: skewX(-45deg) scale(1, 1);
    -webkit-transition: all 0.5s;
    transition: all 0.5s;
}

.btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-close:hover img {
    transform: scale(1.1);
}

button:focus {
    outline: none;
}

.block-button-models {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.model-button {
    text-align: center;
}

.model-button img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.model-button:hover img {
    border-color: grey;
}

.door-info {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    position: fixed;
    left: 50%;
    bottom: 15%;
    transform: translateX(-50%);
    background: #fa3c3c;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 18px;
    z-index: 300;
}

.group-models, .model-button {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.group-models:hover {
    transform: translateY(-5px);
}

.group-models img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-title {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
}

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    justify-content: center;
    align-items: center;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: white;
    width: 80%;
    height: 80%;
    /*max-width: 900px;*/
    /*max-height: 80vh;*/
    overflow-y: auto;
    padding: 15px;
    border-radius: 12px;
    position: relative;
}

.popup-title {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
}

.model-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.items-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.items-wrapper {
    flex: 1;
    position: relative;
    transition: height 0.3s ease;
    padding-top: 10px;
}

.items-grid {
    display: grid;
    gap: 20px;
    transition: transform 0.3s ease;
    width: 100%;
}

.navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 10px;
    margin-right: 10px;
    align-self: center;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-btn:hover {
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.5);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.catalog-item {
    position: relative;
    margin-bottom: 8px;
}

.catalog-title {
    font-size: 20px;
    font-weight: bold;
    padding: 15px;
    background: #d9d9d9;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.catalog-title:hover {
    background: #d9d9d9;
    color: white;
}

.catalog-title img.arrow {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.catalog-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    padding: 0 15px;
    background-color: #a1a1a1;
    transition: grid-template-rows 0.5s ease, opacity 0.3s ease, padding 0.3s ease;
    position: relative;
    z-index: 1;
    margin-top: 0;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
}

.catalog-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background-color: #a1a1a1;
    border-radius: 0 0 8px 8px;
}

.catalog-content > * {
    min-height: 0;
    overflow: hidden;
}

.catalog-content.open {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-top: 15px;
    padding-bottom: 15px;
    margin-top: -8px;
}

.catalog-content.open > * {
    overflow-y: hidden;
}

.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 10px 10px 0;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/*модель*/

#modelInfoPopup {
    display: block;
    opacity: 0;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    /*max-width: 976px;*/
    /*max-height: 800px;*/
    /*max-height: 90vh;*/
    overflow-y: auto;
    border-radius: 12px;
    /*padding: 20px;*/
    z-index: 200;
    pointer-events: none;
    transition: opacity 0.3s;

}

.model-content {
    display: flex;
}

.model-content-left {
    max-width: 592px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 32px 32px 32px 32px;
    gap: 20px;
}

.model-content-right {
    width: calc(376px + 32px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 32px 32px 1px;
}

.grid {
    display: grid;
    gap: 24px;
}

.btn-link-product {
    font-size: 16px;
    line-height: 24px;

}

.model-title {

    font-size: 20px;
    line-height: 28px;
}

.border-bottom {
    border-bottom: 1px solid #3f3f456b;
}

.model-article {
    color: #A1A1A7;
    font-size: 13px;
    line-height: 18px;
    /*padding-top: 24px;*/
    /*padding-bottom: 24px;*/
}

.model-price {
    font-size: 24px;
    line-height: 32px;
}

.model-availability {
    font-size: 14px;
    margin-left: 10px;
}

.model-availability.in-stock {
    color: #32cb41;
}

.model-availability.out-of-stock {
    color: #f91a35;
}

.model-image {
    background-color: #F8F8FC;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.model-image img {
    mix-blend-mode: multiply;
}

.model-text-block {
    font-size: 13px;
    line-height: 18px;
    color: #555558;
    display: -webkit-box;
    -webkit-line-clamp: 13;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/*.link-product {*/
/*    display: inline-flex;*/
/*    align-items: center;*/
/*    gap: 8px;*/
/*}*/
/*.link-product span {*/
/*    padding-right: 5px;*/
/*}*/

/*.link-product svg {*/
/*    vertical-align: middle;*/
/*}*/

.link-product:hover {
    color: #555558;
}

.btn-link-product {
    width: 100%;
}
.btn-link-product a {
    display: block;
    width: 100%;
    background-color: #dc2f2f;
    color: white;
    text-align: center;
    padding: 12px 0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-link-contacts a {
    display: block;
    width: 100%;
    background-color: #dc2f2f;
    color: white;
    text-align: center;
    padding: 12px 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-link-product a:hover, .btn-link-contacts a:hover {
    background-color: #c92222;
    color: white;
    text-decoration: none;
}
.model-slider {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.model-slider img {
    width: 100%;
    height: auto;
    height: 600px;
    width: 600px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.model-slider button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.model-slider button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.model-slider button img {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
    filter: grayscale(100%) brightness(0.5);
}

.model-slider button:hover img {
    filter: invert(18%) sepia(95%) saturate(7000%) hue-rotate(-1deg) brightness(92%) contrast(105%) grayscale(0%);
}

.model-slider button:first-of-type {
    left: -20px;
}

.model-slider button:last-of-type {
    right: -20px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .model-slider {
        max-width: 100%;
        margin: 0;
    }
    
    .model-slider img {
        max-height: 400px;
    }
    
    .model-slider button {
        width: 35px;
        height: 35px;
        padding: 8px;
    }
    
    .model-slider button img {
        width: 16px;
        height: 16px;
    }
    
    .model-slider button:first-of-type {
        left: -15px;
    }
    
    .model-slider button:last-of-type {
        right: -15px;
    }
}

/* Ensure buttons are visible on all backgrounds */
.model-slider button {
    z-index: 10;
}

@media (min-width: 768px) {
    .model-content{
        flex-direction: row;
        align-items: stretch;
        height: 100%;
    }
}

@media (max-width: 767px) {
    .model-content {
        flex-direction: column;
        padding: 32px;
    }
    .model-content-left,
    .model-content-right {
        max-width: 100%;
        width: 100%;
        padding: 10px 0;
    }
    #modelInfoPopup {
        width: 40vh;
    }


}

@media (max-width: 992px) {
    .model-text-block {
        -webkit-line-clamp: 5;
    }
}

@media (min-width: 768px) and (max-width: 1400px){
    #modelInfoPopup {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
    }
    .model-content {
        justify-content: center;
    }
}

@media (max-width: 992px) and (min-width: 768px) {


    .model-content-left {
        max-width: 50%;
        padding: 20px;
    }

    .model-content-right {
        width: 50%;
        padding: 32px 32px 32px 1px;
    }

    .model-image img {
        max-width: 100%;
        height: auto;
    }

    .model-content-left:empty,
    .model-content-left:has(.model-image:empty) {
        display: none;
    }

    .model-content-left:empty + .model-content-right,
    .model-content-left:has(.model-image:empty) + .model-content-right {
        width: 100%;
        margin: 0 auto;
        padding: 32px;
    }

    .model-content-right:only-child {
        width: 100%;
        padding: 32px;
    }

}
@media (max-width: 575px) {
    #modelInfoPopup {
        width: 100%;
        height: 100%;
        padding: 10px;
    }
    .model-content-right {
        padding: 0;
        width: auto;
    }

    .model-text-block {
        -webkit-line-clamp: unset;
    }
}

/*w*/

@media (min-width: 1921px) {
    .block-button-models {
        grid-template-columns: repeat(7, 1fr);
        grid-template-rows: repeat(2, auto);
    }

    .group-title {
        font-size: 18px;
        padding: 18px 10px;
    }
}

@media (min-width: 1920px) {
    .items-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 25px;
    }

    .items-wrapper.nav-mode {
        height: calc(2 * (220px + 25px));
    }
}

@media (max-width: 1919px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .items-wrapper {
        height: calc(2 * (200px + 20px));
    }
}

@media (min-width: 1200px) and (max-width: 1919px) {
    .items-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }

    .items-wrapper.nav-mode {
        height: calc(2 * (200px + 20px));
    }
}

@media (min-width: 1200px) and (max-width: 1920px) {
    .block-button-models {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .block-button-models {
        grid-template-columns: repeat(2, 1fr);
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 991px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-btn {
        width: 35px;
        height: 35px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .items-wrapper.nav-mode {
        height: calc(2 * (180px + 15px));
    }

    .nav-btn {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .block-button-models {
        grid-template-columns: 1fr;
    }

    .group-title {
        font-size: 14px;
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    .catalogList{
        padding-top: 15px;
    }

    .items-container {
        flex-direction: column;
    }

    .navigation-buttons {
        display: none;
    }

    .items-wrapper.scroll-mode {
        width: 100%;
    }

    .items-wrapper.scroll-mode::-webkit-scrollbar {
        width: 6px;
    }

    .items-wrapper.scroll-mode::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .items-wrapper.scroll-mode::-webkit-scrollbar-thumb {
        background: grey;
        border-radius: 10px;
    }

    .items-wrapper.scroll-mode::-webkit-scrollbar-thumb:hover {
        background: grey;
    }
}

@media (min-width: 768px) {
    #secondDroorMenu {
        padding: 30px;
        border-radius: 12px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .block-button-models {
        grid-template-columns: repeat(1, 1fr);
    }

    .group-title {
        font-size: 14px;
        padding: 10px 8px;
    }
}

@media (max-width: 575px) {
    .block-button-models {
        grid-template-columns: 1fr;
        max-height: 70vh;
    }

    .group-title {
        font-size: 16px;
        padding: 14px 10px;
    }

    #secondDroorMenu {
        width: 100%;
        height: 100%;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .items-wrapper.scroll-mode {
        max-height: 300px;
    }

    .items-grid.scroll-mode {
        grid-template-columns: 1fr;
    }
}

/* Phone orientation warning styles */
.orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.orientation-warning h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.orientation-warning p {
    font-size: 1.2rem;
    max-width: 80%;
    line-height: 1.5;
}

/* Phone controls styles */
.phone-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 999;
    padding: 0 20px;
    box-sizing: border-box;
}

.joystick-container {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: auto;
    touch-action: none;
}

.joystick-base {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.joystick-base.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.joystick-knob {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Movement joystick - bottom left */
#joystick-move {
    left: 20px;
    bottom: 20px;
}

/* Look joystick - bottom right */
#joystick-look {
    right: 100px;
    bottom: 20px;
}

/* Action buttons */
.action-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    touch-action: manipulation;
}

.action-btn:active, .action-btn.active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Fullscreen button */
.fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    z-index: 998;
    touch-action: manipulation;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .phone-controls {
        height: 150px;
    }

    .joystick-container {
        width: 100px;
        height: 100px;
    }

    .joystick-knob {
        width: 35px;
        height: 35px;
    }

    .action-buttons {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }

    .fullscreen-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@font-face {
    font-family: 'Golos Text';
    src: url('fonts/golos-text/fonts/golos-text-v4-cyrillic-ext_latin-500.woff2') format('woff2'),
    url('fonts/golos-text/fonts/golos-text-v4-cyrillic-ext_latin-500.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
