/* Import component styles */
@import url('header.css');
@import url('animations.css');

/* Base styles and variables */
:root {
    --primary-red: rgb(209, 13, 0);
    --bright-red: rgb(255, 0, 0);
    --darker-red: rgb(140, 8, 0);
    --darkest-red: rgb(80, 0, 0);
    --blood-shadow: 0 0 20px rgba(209, 13, 0, 0.3);
    --dark-gradient: linear-gradient(45deg, rgba(0,0,0,0.95), rgba(20,0,0,0.95));
}

/* Critical CSS - Load First */
body {
    background: #000;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: lighter;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Container Styles */
.containers {
    margin: 0 auto;
    position: relative;
    padding: 0 8%;
    contain: content;
}

.container {
    margin: 12rem auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: relative;
    background: var(--dark-gradient);
    border-radius: 20px;
    padding: 4rem;
    box-shadow: var(--blood-shadow);
    max-width: 1200px;
    contain: layout style paint;
}

.container:nth-child(even) {
    flex-direction: row-reverse;
}

.text {
    flex: 1;
    padding: 3rem;
    position: relative;
    z-index: 2;
    contain: layout style;
}

.title {
    font-size: clamp(2.5rem, 6vw, 6rem);
    line-height: 1em;
    color: var(--primary-red);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
    will-change: transform;
}

.description {
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    margin-top: 25px;
    line-height: 1.6;
    opacity: 0.9;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--primary-red);
}

.image {
    flex: 1;
    max-width: 50%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(209, 13, 0, 0.3);
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.3s ease;
    contain: layout style;
}

/* Modal Styles */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 250;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0,0,0,0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
    contain: layout size;
}

.modal:not(.hide) {
    opacity: 1;
}

.modal.hide {
    display: none;
}

.modalContent {
    position: relative;
    width: 90%;
    max-width: 500px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(209, 13, 0, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(209, 13, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    contain: layout size paint;
}

#checkoutForm {
    width: 100%;
    flex: 1;
    border: none;
    display: block;
    background: white;
}

/* Button Styles */
.order-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    color: white;
    background: linear-gradient(45deg, var(--primary-red), var(--bright-red));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
}

.order-button.fixed {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.order-button.stop-above-footer {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.closeButton {
    width: 100%;
    min-height: 50px;
    padding: 1rem;
    margin: 0;
    border: none;
    background: linear-gradient(45deg, var(--primary-red), var(--bright-red));
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    text-transform: uppercase;
    font-weight: 600;
    z-index: 251;
    position: relative;
}

.closeButton:hover {
    background: linear-gradient(45deg, var(--bright-red), var(--primary-red));
}

.closeButton:active {
    transform: scale(0.98);
}

/* Footer Styles */
.footer {
    background: var(--dark-gradient);
    padding: 4rem 2rem;
    margin-top: 4rem;
    text-align: center;
    contain: layout style paint;
}

.footer .bottom {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    opacity: 0.7;
}

.footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Performance Optimizations */
.image, .title, .description {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    transform: translate3d(0, 0, 0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .text, .image {
        width: 100%;
        max-width: 100%;
    }
    
    .container {
        flex-direction: column;
        margin: 6rem auto;
        padding: 2rem;
    }
    
    .container:nth-child(even) {
        flex-direction: column;
    }
    
    .description {
        text-align: center;
        border-left: none;
        padding-left: 0;
        border-top: 3px solid var(--primary-red);
        padding-top: 20px;
    }

    .modalContent {
        width: 95%;
        height: 95vh;
    }
    
    .closeButton {
        min-height: 60px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {    
    .container {
        margin: 4rem auto;
        padding: 1rem;
    }
    
    .order-button {
        max-width: 250px;
        font-size: 1rem;
    }

    .modalContent {
        width: 98%;
        height: 98vh;
    }
    
    .closeButton {
        min-height: 50px;
        font-size: 1.1rem;
    }
}

/* Utility Classes */
.hide-content {
    display: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: rgba(209, 13, 0, 0.5);
    border-radius: 6px;
    border: 3px solid #000;
}

/* Selection Styling */
::selection {
    background: rgba(209, 13, 0, 0.7);
    color: #fff;
}

/* Print Styles */
@media print {
    .modal,
    .order-button,
    .go-down {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
