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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poiret One", sans-serif;
    font-size: clamp(18px, 2.5vw, 28px);
    background: #242424;
    border: 1px solid #ffcc00;
    line-height: 1.6;
    color: #E7E7E7;
    overflow-x: hidden;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

nav {
    background-color: rgba(32, 32, 32, 0.9); 
    border: 1px solid #ffcc00;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center; 
    padding: 20px 40px;
    border-bottom: 12px solid transparent; 
    border-image-source: url("../img/image_23d016.png");
    border-image-slice: 20%; 
    border-image-repeat: repeat;
    box-shadow: 0 5px 15px rgba(54, 53, 53, 0.6);
}

.nav-links {
    display: grid;
    grid-auto-flow: column;
    gap: 35px;
}

.site-title {
    font-family: "Russo One", sans-serif;
    font-weight: bold;
    color: #ffcc00;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

nav a:hover {
    color: #ffcc00;
}

#banner {
    width: 100%;
    height: 90vh;
    filter: blur(8px);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    animation: bannerLoop 9s infinite ease-in-out;
}

@keyframes bannerLoop {
    0%, 25% { background-image: url("../img/winery.jpg"); }
    50%, 66% { background-image: url("../img/valley.webp"); }
    100% { background-image: url("../img/winery.jpg"); }
}

main {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    padding: 60px 40px 100px 40px;
    background: #500000;
    border: 1px solid #ffcc00;
}

main::before {
    content: "";
    display: block;
    width: 100%;
    height: 100px;
    background-image: url("../img/LOGO.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 60px;
}

h1, h2, h3 {
    font-family: "Poiret One", sans-serif;
    margin-bottom: 30px;
    text-transform: uppercase;
    font-weight: bold;
}

#h1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-bottom: 120px;
    align-items: center;
    scroll-margin-top: 150px;
}

#h1 aside img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

article, figure {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

article.is-visible, figure.is-visible {
    opacity: 1;
    transform: translateY(0);
}

#h1 aside figure {
    transition-delay: 0.2s;
}

#collection {
    margin-bottom: 120px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    place-items: center;
    margin-top: 40px;
}

.grid-item {
    position: relative;
}

.grid-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;          
    height: 2px;
    background: #ffcc00;
    transition: width 0.4s ease;
}

.grid-item:hover::after {
    width: 100%;
}

.grid-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    margin-bottom: 15px;
}

.grid-item figcaption {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

footer {
    padding: 80px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    grid-column: 2 / 4;
    background: #252525;
    border: 1px solid #ffcc00;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ffcc00;
    font-size: 35px;
    cursor: pointer;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.modal-image-container img {
    width: 100%;
    border-radius: 4px;
}

.modal-info h2 {
    color: #ffcc00;
    margin-bottom: 10px;
}

.modal-price {
    display: block;
    font-size: 24px;
    margin: 20px 0;
    color: #E7E7E7;
}

.add-to-cart {
    background: transparent;
    border: 1px solid #ffcc00;
    color: #ffcc00;
    padding: 12px 25px;
    font-family: "Poiret One", sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

.add-to-cart:hover {
    background: #ffcc00;
    color: #202020;
}

@media (max-width: 1024px) {
    nav {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 15px;
        padding: 15px 20px;
    }

    #h1 {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    #banner {
        height: 60vh;
        background-attachment: scroll;
    }
    
    main::before {
        height: 60px;
        margin-bottom: 30px;
    }

    .modal-content {
        grid-column: 1 / 5;
        width: 90%;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .modal-body { 
        grid-template-columns: 1fr; 
        text-align: center; 
    }
}
