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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 1000;
    background: #7c94b0;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lang-btn {
    padding: 8px 15px;
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #000000;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.lang-btn.active {
    background: #dbae08;
    color: #000000;
}

/* Top Section with Water Background */
.top-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #0a0a0a url('images/water.jpg') center center;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px 20px 20px;
}

.top-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
    pointer-events: none;
}

.top-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(5, 84, 158, 0.6) 0%, rgba(5, 84, 158, 0.3) 50%, rgba(5, 84, 158, 0.1) 80%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    gap: 40px;
}

/* Book Cover Styles */
.book-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.book-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
}

.book-cover {
    position: relative;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-top-right-radius: 35px;
    border-bottom-right-radius: 35px;
}

.book-image {
    display: block;
    max-width: 500px;
    height: auto;
}

/* Annotations */
.annotation {
    position: absolute;
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #000000;
    max-width: 300px;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.annotation span {
    display: block;
    line-height: 1.3;
}

.annotation-rating {
    color: #ffd700;
    display: none;
}

.annotation-top-left {
    top: 50px;
    left: -350px;
}

.annotation-top-right {
    top: 50px;
    right: -305px;
}

body.lang-en .annotation-top-right {
    right: -220px;
}

.annotation-middle-left {
    top: 300px;
    left: -330px;
}

.annotation-rating {
    bottom: 100px;
    left: -233px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.rating-stars {
    display: flex;
    gap: 3px;
    font-size: 20px;
}

.star {
    color: #ffd700;
}

.star.outline {
    color: transparent;
    -webkit-text-stroke: 2px #ffd700;
    text-stroke: 2px #ffd700;
}

.rating-text {
    font-size: 20px;
}

.annotation-bottom-right {
    bottom: 100px;
    right: -355px;
    font-size: 20px;
}

/* Arrows */
.arrow {
    position: absolute;
    width: 80px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.85;
}

.arrow-top-left {
    top: -4px;
    right: -72px;
    background-image: url('images/arrow.png');
    transform: rotate(45deg);
    width: 80px;
    height: 80px;
}

.arrow-top-right {
    top: -4px;
    left: -67px;
    background-image: url('images/arrow.png');
    transform: rotate(-50deg) scaleX(-1);
    width: 80px;
    height: 80px;
}

.arrow-middle-left {
    top: 0;
    right: -58px;
    background-image: url('images/arrow.png');
    transform: rotate(45deg);
    width: 80px;
    height: 80px;
}

.arrow-rating {
    top: -15px;
    right: -25px;
    background-image: url('images/arrow.png');
    transform: rotate(45deg);
    width: 80px;
    height: 80px;
}

.arrow-bottom-right {
    top: -10px;
    left: -70px;
    background-image: url('images/arrow.png');
    transform: rotate(-45deg) scaleX(-1);
    width: 80px;
    height: 80px;
}

body.lang-en .arrow-bottom-right {
    left: -50px;
}

/* Buy Buttons */
.buy-buttons {
    position: relative;
    display: flex;
    gap: 20px;
    z-index: 10;
    justify-content: center;
    margin-top: 20px;
}

.buy-button {
    padding: 15px 30px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    background-color: #dbae08;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.buy-button:hover {
    background-color: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.buy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.buy-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}

.buy-button:disabled:hover {
    background-color: #dbae08;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Description Section */
.description-section {
    margin: 60px auto;
    padding: 60px 40px 0;
    min-height: 33.33vh;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Carousel Section */
.carousel-section {
    width: 100%;
    background-color: #fff;
    margin: 60px 20px;
    position: relative;
    z-index: 1;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(219, 174, 8, 0.5) transparent;
    -webkit-overflow-scrolling: touch;
}

.carousel-wrapper::-webkit-scrollbar {
    height: 8px;
}

.carousel-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.carousel-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(219, 174, 8, 0.5);
    border-radius: 4px;
}

.carousel-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(219, 174, 8, 0.8);
}

.carousel-slide {
    flex: 0 0 auto;
    width: calc((100% - 80px) / 3);
    min-width: 250px;
    opacity: 1;
}

.carousel-slide.active {
    opacity: 1;
}

/* Ensure 5th slide is visible on desktop */
.carousel-slide-mobile-hidden {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 80vh;
    border-radius: 4px;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(219, 174, 8, 0.8);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-button:hover {
    background-color: rgba(219, 174, 8, 1);
}

.carousel-prev {
    left: -55px;
}

.carousel-next {
    right: -55px;
}

.carousel-dots {
    display: none;
}

@media (max-width: 768px) {
    .carousel-section {
        padding: 40px 10px;
        margin: 40px 0;
        width: 100%;
        box-sizing: border-box;
    }

    .carousel-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    /* Hide carousel controls on mobile */
    .carousel-button {
        display: none;
    }

    .carousel-dots {
        display: none;
    }

    /* Mosaic layout for mobile */
    .carousel-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
        overflow: hidden;
        overflow-x: hidden;
        scroll-behavior: auto;
        height: auto;
        width: 100%;
        box-sizing: border-box;
    }

    /* Hide 5th slide on mobile (limit to 4 images) */
    .carousel-slide-mobile-hidden {
        display: none !important;
    }

    .carousel-slide {
        width: 100%;
        min-width: 0;
        margin: 0;
        display: flex;
        overflow: hidden;
    }

    /* First image - spans 2 rows on left */
    .carousel-slide:nth-child(1) {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    /* Second image - top right */
    .carousel-slide:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    /* Third image - middle right */
    .carousel-slide:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    /* Fourth image - bottom, spans full width */
    .carousel-slide:nth-child(4) {
        grid-column: 1 / 3;
        grid-row: 3;
    }

    .carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        max-height: none;
        border-radius: 8px;
        display: block;
    }
}

@media (min-width: 1200px) {
    .carousel-slide {
        width: calc((100% - 80px) / 4);
    }
}

.description-section h1 {
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #000000;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.3;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.description-section p {
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #000000;
    line-height: 1.6;
    text-align: left;
    margin: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 16px;
        min-height: auto;
        gap: 16px;
    }

    .book-wrapper {
        width: 100%;
        transform: none;
        position: relative;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
    }

    .book-cover {
        width: 100%;
        max-width: calc(100vw - 32px);
        margin: 0 auto;
        order: 2;
    }

    .book-image {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Hide all arrows on mobile */
    .arrow {
        display: none !important;
    }

    /* Reorganize annotations for mobile */
    .annotation {
        position: static !important;
        margin: 0 auto;
        max-width: calc(100vw - 32px);
        font-size: 18px;
        text-align: center;
        width: 100%;
    }

    /* Top annotations - above book */
    .annotation-top-left {
        position: static !important;
        margin-bottom: 16px;
        order: 1;
        left: auto !important;
        top: auto !important;
    }

    .annotation-top-right {
        position: static !important;
        margin-bottom: 16px;
        order: 1;
        right: auto !important;
        top: auto !important;
    }

    /* Bottom annotations - below book */
    .annotation-middle-left {
        position: static !important;
        margin-top: 16px;
        order: 3;
        left: auto !important;
        top: auto !important;
    }

    .annotation-bottom-right {
        position: static !important;
        margin-top: 16px;
        order: 3;
        right: auto !important;
        bottom: auto !important;
    }

    .annotation-rating {
        display: none;
    }

    /* Buttons - below annotations, side by side */
    .buy-buttons {
        position: static !important;
        transform: none !important;
        margin-top: 16px;
        width: 100%;
        max-width: calc(100vw - 32px);
        flex-direction: row;
        gap: 12px;
        left: auto !important;
        bottom: auto !important;
    }

    .buy-button {
        flex: 1;
        width: 50%;
        font-size: 16px;
        padding: 12px 8px;
        white-space: normal;
        line-height: 1.2;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .description-section {
        padding: 24px 16px;
        margin: 24px 0;
        width: 100%;
        box-sizing: border-box;
    }

    .description-section h1 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .description-section p {
        font-size: 16px;
        text-align: left;
    }
}

/* Footer */
.site-footer {
    background-color: #0a0a0a;
    color: #ffffff;
    padding: 40px 20px;
    margin-top: 60px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-copyright,
.footer-purchase,
.footer-email {
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: #ffffff;
    line-height: 1.6;
}

.footer-purchase a,
.footer-email a {
    color: #dbae08;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-purchase a:hover,
.footer-email a:hover {
    color: #ffed4e;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 30px 16px;
        margin-top: 40px;
    }

    .footer-content {
        gap: 10px;
    }

    .footer-copyright,
    .footer-purchase,
    .footer-email {
        font-size: 14px;
    }
}

