body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Crimson Pro', serif;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'MedievalSharp', cursive;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-image: url('/images/background.png');
    background-size: cover;
    background-position: center;
    padding-top: 90px;
    box-sizing: border-box;
}

.header {
    z-index: 10000;
    display: flex;
    justify-content: left;
    align-items: left;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-left: 40px;
}

.logo-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.menu-icon {
    font-size: 20px;
    color: white;
    cursor: pointer;
    position: absolute;
    right: 40px;
}

.popup-menu {
    display: none;
    position: fixed;
    top: 60px;
    right: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    z-index: 10001;
}

.popup-menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.popup-menu li {
    padding: 10px 0;
}

.popup-menu a {
    color: white;
    text-decoration: none;
    font-size: 18px;
}

.popup-menu a:hover {
    opacity: 0.8;
}

.popup-menu .copyright {
    font-size: 12px;
    color: #ccc;
    margin-top: 20px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 10%;
    overflow-y: auto;
}

.product-detail {
    width: 50vw;
    height: 50vh;
    min-height: 470px;
    max-height: 700px;
    min-width: 690px;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    position: absolute;
    top: 10%;
    left: 10%;
    bottom: 40%;
    z-index: 10000;
    backdrop-filter: blur(15px);
}

#product-name {
    color: white;
    font-size: 32px;
    margin: 0 0 20px 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    align-self: center;
}

.product-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-right: 240px;
    justify-content: space-between;
}

#large-image-container {
    display: none;
}

#large-image {
    width: 100%;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

#book-3d-model {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 75%;
    position: relative;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.loader.visible {
    opacity: 1;
}

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

.product-gallery {
    display: flex;
    justify-content: space-between;
    height: 95px;
    gap: 10px;
}

.gallery-item {
    flex: 1;
    height: 95px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.product-info {
    font-family: 'Crimson Pro', serif;
    width: 200px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 1);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    position: absolute;
    right: 20px;
    top: 60px;
    bottom: 20px;
}

.scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.info-block {
    margin-bottom: 15px;
}

.info-block h3 {
    font-size: 16px;
    margin-bottom: 5px;
    margin-top: 0;
}

.info-block p {
    margin: 0;
}

.add-to-cart {
    font-family: 'Crimson Pro', serif;
    margin-top: auto;
    background-color: rgba(155, 183, 100, 1);
    color: white;
    border: 2px solid rgba(155, 183, 100, 1);
    padding: 10px;
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.add-to-cart:hover {
    box-shadow: inset 0 0 0 2px white;
}

.product-list-container {
    height: 15vh;
    min-height: 180px;
    bottom: 40px;
    left: 10%;
    right: 10%;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    position: fixed;
}

.category-filter-wrapper {
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-block h3 {
    margin: 0;
}

.product-price {
    font-size: 16px !important;
    font-weight: bold;
    color: rgba(155, 183, 100, 1);
}

.category-filter {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start;
    background-color: transparent;
    padding: 5px 5px 0;
    position: relative;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    width: fit-content;
    border-radius: 8px 8px 0 0;
}

.category-filter button {
    font-family: 'MedievalSharp', cursive;
    padding: 10px 20px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;
    transition: background-color 0.3s, box-shadow 0.3s;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
    margin-right: 5px;
}

.category-filter button.active {
    background: linear-gradient(to bottom, rgba(217, 219, 126, 1), rgba(0, 0, 0, 0));
    position: relative;
    z-index: 2;
}

.product-list {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 20px 40px;
    position: relative;
    border-radius: 0 8px 8px 8px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1;
}

.product-list::-webkit-scrollbar {
    display: none;
}

.product-list {
    scrollbar-width: none;
}

.product-list-wrapper {
    display: flex;
    transition: transform 0.3s ease;
}

.product-item {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    border-radius: 10px;
    transition: transform 0.2s, border 0.2s, background-color 0.2s;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.product-item:hover, .product-item.active {
    border: 2px solid white;
}

.product-item.active {
    background-color: rgba(128, 128, 128, 0.5);
}

.product-item img {
    max-width: 100%;
    max-height: 100%;
}

.sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border-radius: 10px;
}

.slider-arrow {
    position: absolute;
    top: 110px;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.slider-arrow.left {
    left: 10px;
}

.slider-arrow.right {
    right: 10px;
}

.slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.slider-arrow.visible {
    display: flex;
}

.cart-container {
    position: fixed;
    right: 10%;
    bottom: 40px;
    width: 280px;
    height: 137px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 10000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.cart-container.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
}

.empty-cart-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.8em;
}

.empty-cart-button:hover {
    color: rgba(255, 255, 255, 1);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

.cart-total {
    margin-bottom: 10px;
    font-weight: bold;
}

.checkout-button {
    font-family: 'Crimson Pro', serif;
    background-color: rgba(155, 183, 100, 1);
    color: white;
    border: 2px solid rgba(155, 183, 100, 1);
    padding: 10px;
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
}

.checkout-button:hover {
    box-shadow: inset 0 0 0 2px white;
}

.product-list-container.with-cart {
    margin-right: 300px;
}

.remove-from-cart {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10009;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    cursor: pointer;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.8);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    color: white;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#imageModal .modal-content {
    background-color: transparent;
    border: none;
    max-width: 90%;
    max-height: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    cursor: default;
    z-index: 10020;
}

#imageModal img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #f1f1f1;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.payment-status-modal .modal-content {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 40px;
    border-radius: 10px;
    max-width: 400px;
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.modal-icon.success {
    color: #4CAF50;
}

.modal-icon.failure {
    color: #f44336;
}

.payment-status-modal h2 {
    margin-bottom: 15px;
}

.payment-status-modal p {
    margin-bottom: 0;
}

.payment-status-modal .close {
    color: white;
    opacity: 0.8;
}

.payment-status-modal .close:hover {
    opacity: 1;
}

/* @supports not (backdrop-filter: blur(10px)) {
    .product-list-container {
        background-color: rgba(51, 51, 51, 0.95);
    }
} */

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

@media (max-height: 600px) {
    .product-list-container {
        height: 20vh;
    }
}

.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/background.png');
    background-size: cover;
    background-position: center;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 2s ease-in-out, background-size 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.intro-overlay.active {
    pointer-events: auto;
}

.intro-overlay:not(.active) {
    pointer-events: none;
}

body.overlay-active .container > *:not(.intro-overlay) {
    pointer-events: none;
}

.intro-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    width: 350px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    color: white;
    z-index: 10000;
    position: relative;
}

.intro-content h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: 28px;
    margin-bottom: 15px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.intro-content p {
    font-family: 'Crimson Pro', serif;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.intro-button {
    font-family: 'Crimson Pro', serif;
    background-color: rgba(155, 183, 100, 1);
    color: white;
    border: 2px solid rgba(155, 183, 100, 1);
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
    z-index: 10001;
    margin-bottom: 12px;
}

#typewriter-text {
    font-family: 'Crimson Pro', serif;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 20px;
    white-space: pre-wrap;
    overflow: hidden;
}

.erin-image {
    position: fixed;
    right: 20%;
    width: 0px;
    height: auto;
    z-index: 9999;
    transition: all 1s ease;
}

.erin-image.moved {
    position: fixed;
    top: 20%;  
    right: -100px;
    width: 60%;
    z-index: 9999;
    transition: all 2s ease;
    bottom: 0;
}

.intro-button:hover {
    box-shadow: inset 0 0 0 2px white;
}

.product-detail, .product-list-container {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.shrink-background {
    background-size: 100% 100% !important;
}

.fade-out {
    opacity: 0 !important;
    transition: opacity 2s ease-in-out;
}

#productDetailModal .modal-content {
    text-align: left;
    background-color: rgba(255, 255, 255, 0.95);
    color: black;
}

#productDetailModal .product-detail-modal-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

#productDetailModal .add-to-cart {
    color: white;
    margin-top: 20px;
    left: 20px;
    right: 20px;
    width: 90%;
    position: fixed;
    bottom: 10px;
    background: rgba(155, 183, 100, 1);
    border: none;
    font-size: 18px;
    padding: 20px;
}

@media screen and (max-width: 860px) {

    .slider-arrow {
        display: none;
    }

    .product-list {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .product-list-wrapper {
        display: flex;
        gap: 10px; /* Разделение между элементами */
    }

    #large-image-container {
        display: block;
    }

    #book-3d-model {
        display: none;
    }

    .erin-image.moved {
        position: fixed;
        bottom: 0;
        left: -100px;
        width: auto;
        height: 80%;
        z-index: 9999;
        transition: all 2s ease;
    }

    .product-detail {
        display: none;
    }

    .cart-items {
        display: none;
    }

    .gallery-item {
        height: 80px;
    }

    .product-list-container {
        left: 5%;
        right: 5%;
        width: 90%;
        bottom: 20px !important;
    }

    .product-list-container.with-cart {
        left: 5%;
        right: 5%;
        width: 90%;
        bottom: 150px !important;
    }

    .cart-container {
        bottom: 60px;
        right: 5%;
        left: 5%;
        width: auto;
    }

    .cart-container.active {
        bottom: 10px;
        transform: scale(1) !important;
        transform-origin: center !important;
    }

    #productDetailModal .modal-content {
    }

    #modal-book-3d-model {
        display: none;
    }

    #productDetailModal .product-detail-modal-content {
        padding: 0;
    }

    #productDetailModal .modal-product-gallery {
        display: flex;
        justify-content: space-between;
        gap: 4px;
        overflow: hidden;
    }

    #productDetailModal .modal-product-gallery img {
        flex: 1;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        cursor: pointer;
        border-radius: 5px;
        transition: transform 0.3s ease;
    }

    #productDetailModal .modal-product-gallery img:hover {
        transform: scale(1.05);
    }

    #modal-large-image {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
        border-radius: 5px;
    }
}

/* Add this media query for height <= 770px */
@media (max-height: 770px) {
    .product-detail {
        transform: scale(0.9);
        transform-origin: left;
        top: 5%;
    }

    .product-list-container{
        transform: scale(0.9);
        transform-origin: left;
        bottom: 20px;
    }

    .cart-container{
        transform: scale(0.9);
        transform-origin: left;
        bottom: 20px;
        }

}
