/* ==========================================================================
   PARTHENOPE RACING MERCHANDISE STORE - STYLE (CON HOVER INTERNATO)
   ========================================================================== */

:root {
    --f1-red: #e10600;
    --store-dark: #1b1b1b;
    --store-light: #f2f2f2;
    --pure-white: #ffffff;
    --text-main: #111111;
    --text-muted: #767676;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f6f6f6;
    color: var(--text-main);
}

/* TOP ANNOUNCEMENT BAR */
.promo-banner {
    background-color: var(--store-dark);
    color: var(--pure-white);
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.promo-banner span {
    color: var(--f1-red);
}

/* NAVBAR STORE */
.store-header {
    background-color: var(--pure-white);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.store-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.store-logo a {
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--store-dark);
    text-decoration: none;
    letter-spacing: -1px;
}

.store-logo span {
    color: var(--f1-red);
}

/* SEARCH BAR */
.search-container {
    flex-grow: 0.4;
    position: relative;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--store-light);
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: var(--pure-white);
    border-color: var(--store-dark);
}

/* NAV UTILS */
.nav-utils {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-util-item {
    color: var(--store-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-badge {
    background-color: var(--f1-red);
    color: var(--pure-white);
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 50%;
    font-weight: 700;
}

/* CATEGORIES BAR */
.categories-bar {
    background-color: var(--pure-white);
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
    gap: 35px;
    padding: 12px 0;
}

.category-link {
    text-decoration: none;
    color: var(--store-dark);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-link:hover, .category-link.active {
    color: var(--f1-red);
}

/* HERO STORE BANNER */
.store-hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1568605117036-5fe5e7bab0b7?q=80&w=1920');
    background-size: cover;
    background-position: center;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--pure-white);
    text-align: center;
    padding: 20px;
}

.store-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* PRODUCT GRID SECTION */
.shop-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 25px;
    border-left: 4px solid var(--f1-red);
    padding-left: 15px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* CARD PRODOTTO E-COMMERCE */
.product-card {
    background-color: var(--pure-white);
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--f1-red);
    color: var(--pure-white);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* BOX IMMAGINE PER LO SCAMBIO HOVER (FRONTE / RETRO) */
.product-img-wrapper {
    background-color: #ffffff;
    height: 340px;
    position: relative;
    overflow: hidden;
    display: block;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: opacity 0.4s ease-in-out;
}

.product-img-wrapper .img-back {
    opacity: 0;
}

.product-card:hover .product-img-wrapper .img-front {
    opacity: 0;
}

.product-card:hover .product-img-wrapper .img-back {
    opacity: 1;
}

/* INFO PRODOTTO */
.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-team {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-name:hover {
    color: var(--f1-red);
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: auto;
    margin-bottom: 15px;
}

.btn-add-to-cart {
    width: 100%;
    background-color: var(--store-dark);
    color: var(--pure-white);
    border: none;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add-to-cart:hover {
    background-color: var(--f1-red);
}

/* FOOTER STORE */
.store-footer {
    background-color: var(--store-dark);
    color: var(--pure-white);
    padding: 40px 20px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 60px;
    border-top: 4px solid var(--f1-red);
}

/* ==========================================================================
   MEDIA QUERIES - OTTIMIZZAZIONE RESPONSIVE PER SMARTPHONE e TABLET
   ========================================================================== */

@media (max-width: 768px) {
    /* 1. Header & Navigazione */
    .store-nav-top {
        flex-direction: column; /* Gli elementi vanno uno sotto l'altro */
        gap: 15px;
        padding: 15px 20px;
        text-align: center;
    }

    .search-container {
        width: 100%; /* La barra di ricerca occupa tutta la larghezza */
        order: 3;    /* La spingiamo in basso per estetica */
    }

    .nav-utils {
        width: 100%;
        justify-content: space-around; /* Distribuisce Account e Carrello */
        order: 2;
    }

    /* Barra Categorie orizzontale con scroll se sforna */
    .categories-bar {
        gap: 20px;
        padding: 12px 15px;
        justify-content: flex-start; 
        overflow-x: auto; /* Permette lo swipe laterale se le categorie sono tante */
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .categories-bar::-webkit-scrollbar {
        display: none; /* Nasconde la brutta barra di scorrimento su mobile */
    }

    /* 2. Hero Section */
    .store-hero {
        height: 200px; /* Abbassiamo l'altezza dell'immagine */
    }

    .store-hero h1 {
        font-size: 1.6rem; /* Testo più piccolo per non farlo andare a capo male */
    }
    
    .store-hero p {
        font-size: 0.9rem;
    }

    /* 3. Griglia Prodotti */
    .shop-container {
        padding: 0 20px; /* Riduciamo i margini laterali */
        margin: 25px auto;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Ottimizza lo spazio */
        gap: 20px;
    }

    .product-img-wrapper {
        height: 280px; /* Immagini leggermente più basse su mobile */
    }
    
    /* Disattiviamo l'effetto hover di scambio foto sui touch screen (può dare fastidio) */
    .product-card:hover .product-img-wrapper .img-front {
        opacity: 1;
    }
    .product-card:hover .product-img-wrapper .img-back {
        opacity: 0;
    }
}
}