:root {
    --bg-color: #ffffff; /* Pure white background */
    --sbj-red: #e30613; /* Bright red from the image */
    --text-primary: #333333;
    --text-secondary: #666666;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Branding (Top Left) */
.brand-container {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo img {
    height: 80px;
    object-fit: contain;
}

.fallback-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sbj-red);
    border: 3px solid var(--sbj-red);
    border-radius: 50%;
    padding: 10px 20px;
}

.brand-subtitle {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-transform: uppercase;
    font-style: italic;
}

/* Order Now Button (Top Right) */
.order-btn {
    position: fixed;
    top: 2.5rem;
    right: 2rem;
    background-color: var(--sbj-red);
    color: #ffffff;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 1px;
    box-shadow: 0 0 25px 8px rgba(227, 6, 19, 0.4);
    z-index: 100;
    transition: all 0.3s ease;
    animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.order-btn:hover {
    background-color: #c4000f;
    box-shadow: 0 0 35px 12px rgba(227, 6, 19, 0.6);
    animation-play-state: paused;
}

/* Navigation Arrows (Middle Left & Right) */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sbj-red);
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-arrow svg {
    width: 100px; /* Massive arrows like in the design */
    height: 100px;
}

.nav-arrow:hover {
    transform: translateY(-50%) scale(1.1);
}

.left-arrow {
    left: 4rem; /* Inside from the edge */
}

.right-arrow {
    right: 4rem;
}

/* Main Content (Flipbook Area) */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 1rem 4rem; /* Reduced padding to make the book physically larger on screen */
    height: 100vh;
    min-height: 0; /* Crucial to prevent vertical overflow */
    overflow: auto; /* Allows panning when zoomed in */
    align-items: center; /* keep centered horizontally */
}

.flipbook-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1.414 / 1; /* Forces the container to be the exact shape of a 2-page spread */
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Flipbook specific styling */
#flipbook {
    width: 100%;
    height: 100%;
    background: transparent;
}

.stf__block {
    box-shadow: 0 0px 40px rgba(0, 0, 0, 0.2); /* Soft shadow placed strictly on the book block */
}

/* Page Counter (Bottom Center) */
.controls-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.page-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

#page-input {
    width: 50px;
    background: #ffffff;
    border: 1px solid #ccc;
    color: var(--text-primary);
    padding: 0.3rem;
    border-radius: 4px;
    text-align: center;
    font-family: inherit;
    font-weight: 600;
}

#page-input:focus {
    outline: none;
    border-color: var(--sbj-red);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-arrow svg {
        width: 60px;
        height: 60px;
    }
    .left-arrow { left: 1rem; }
    .right-arrow { right: 1rem; }
    main { padding: 2rem 5rem; } /* Keeps it landscape on tablets/small laptops */
    .brand-container { top: 1rem; left: 1rem; }
    .order-btn { right: 1rem; padding: 0.8rem 1.5rem; }
}

@media (max-width: 768px) {
    /* Top Row: Branding */
    .brand-container { 
        top: 15px; 
        left: 15px; 
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }
    .brand-logo img { height: 40px; }
    .brand-subtitle { 
        margin-top: 0; 
        font-size: 1.1rem; 
        color: #000;
    }

    /* Main space adjustments for mobile */
    main { padding: 80px 10px 100px 10px; }

    /* Bottom Row: Arrows and Order Button */
    .nav-arrow {
        position: fixed;
        top: auto;
        bottom: 20px;
        transform: none;
    }
    .nav-arrow svg { width: 60px; height: 60px; }
    .left-arrow { left: 10px; }
    .right-arrow { right: 10px; }

    .order-btn {
        position: fixed;
        top: auto;
        bottom: 25px;
        left: 50%;
        /* Important to override JS and vertically align properly */
        transform: translateX(-50%) !important;
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
        box-shadow: 0 0 15px 5px rgba(227, 6, 19, 0.4);
    }

    /* Hide page counter to match image */
    .controls-container {
        display: none;
    }
}
