/* ============================================================
   VARIABILI CSS (gestite dal tema ruby-theme sul body)
   ============================================================ */
.products-section {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 40px;
    padding-top: 110px;
}

.product-box {
    position: relative;
    width: 95%;
    max-width: 1500px;
    height: 78vh;
    max-height: 780px;
    border-radius: 32px;
    background: #000000;
    overflow: hidden;
    border: 1px solid var(--box-border);
    box-shadow: 0 0 60px var(--box-shadow), inset 0 0 30px var(--box-shadow);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-box.animate-in {
    opacity: 1;
    transform: scale(1);
}

.product-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.product-overlay {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 35px 50px;
}

.product-header-section {
    display: flex;
    justify-content: flex-start;
}

.product-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 600px;
}

.product-title-area {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.product-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    line-height: 1.2;
    word-break: break-word;
}

.product-description-section {
    width: 100%;
    min-width: 0;
    margin-top: 10px;
}

.product-line {
    width: 100%;
    height: 1px;
    background: #ffffff;
    margin-bottom: 10px;
}

.product-description {
    font-size: 16px;
    color: #d4d4d4;
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.product-footer-section {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.website-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 1.5px;
    padding: 12px 35px;
    border: 2px solid var(--box-border);
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.website-link:hover {
    background-color: var(--link-hover);
    border-color: var(--link-hover);
    color: #000000;
    box-shadow: 0 0 20px var(--link-hover);
}

.right-line {
    position: absolute;
    top: 0;
    right: 50px;
    width: 2px;
    height: 100%;
    background-color: #ffffff;
    z-index: 150;
    transition: height 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.right-line.active {
    height: 100%;
}

/* ============================================================
   MOBILE – NAVBAR SOTTILE, VIDEO RETTANGOLO, PULSANTE IN BASSO
   ============================================================ */
@media (max-width: 768px) {

    /* ---- NAVBAR PIÙ SOTTILE ---- */
    .navbar {
        padding: 6px 16px !important;
        min-height: 44px !important;
        backdrop-filter: blur(8px) !important;
    }

    .navbar .logo-container .logo {
        font-size: 16px !important;
        letter-spacing: 0.5px !important;
    }

    .navbar .logo-divider {
        height: 18px !important;
        margin: 0 6px !important;
    }

    .nav-links {
        gap: 4px !important;
    }

    .nav-links a {
        font-size: 10px !important;
        padding: 4px 6px !important;
        letter-spacing: 0.8px !important;
    }

    /* ---- SEZIONE: LEGGERMENTE PIÙ IN BASSO ---- */
    .products-section {
        padding-top: 60px !important;
        padding-bottom: 10px;
        align-items: flex-start;
        height: 100vh;
    }

    /* ---- CONTENITORE PRINCIPALE: COLONNA, ALTEZZA AUTOMATICA ---- */
    .product-box {
        width: 92%;
        max-width: 500px;
        height: auto;
        min-height: calc(100vh - 80px);
        border-radius: 0;
        padding: 16px 16px 10px;
        background: transparent;
        border: none;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        overflow: visible;
        margin-top: 4px;
    }

    /* ---- VIDEO: DIVENTA UN RETTANGOLO 16:9 E VIENE SOPRA ---- */
    .product-media {
        position: relative;          /* esce dal flusso absolute */
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 0 !important;
        background: #000000;
        margin-bottom: 18px;
        flex-shrink: 0;
        z-index: 1;
    }

    /* ---- OVERLAY: SOTTO IL VIDEO, OCCUPA LO SPAZIO RESIDUO ---- */
    .product-overlay {
        position: relative;
        height: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 0;
        width: 100%;
    }

    /* ---- HEADER (TITOLO + DESCRIZIONE) ALLINEATO A SINISTRA ---- */
    .product-header-section {
        justify-content: flex-start;
        width: 100%;
        flex-shrink: 0;
    }

    .product-title-block {
        width: fit-content;
        align-items: flex-start;
        max-width: 100%;
    }

    .product-title-area {
        gap: 10px;
    }

    .product-title {
        font-size: 24px;
        font-weight: 700;
    }

    .product-description-section {
        width: 100%;
        margin-top: 8px;
        text-align: left;
    }

    .product-line {
        width: 100%;
        height: 1px;
        background: #ffffff;
        margin-bottom: 8px;
    }

    .product-description {
        font-size: 15px;
        text-align: left;
    }

    /* ---- FOOTER: PULSANTE IN BASSO A DESTRA ---- */
    .product-footer-section {
        justify-content: flex-end;
        margin-top: auto;
        padding-bottom: 20px;
        width: 100%;
        flex-shrink: 0;
    }

    .website-link {
        font-size: 14px;
        padding: 10px 28px;
    }

    .right-line {
        right: 16px;
    }
}