/* ==============================================
   CSS CHECKOUT
   ============================================== */

p#billing_tipo_cliente_field span.woocommerce-input-wrapper {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tipo-cliente-campo input[type="radio"] {
    margin-right: -20px;
    transform: scale(1);
    accent-color: #ec671b;
}

.tipo-cliente-campo label {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.tipo-cliente-campo label:hover {
    color: #ec671b;
}

.tipo-cliente-campo input[type="radio"]:checked+label {
    color: #ec671b;
    font-weight: 700;
}


/* Opzionale: Rimuove il "Sei un..." e l'asterisco se non necessario */
.tipo-cliente-campo .label-inline {
    display: none;
    /* Nasconde l'etichetta principale "Sei un..." se è solo un testo */
}


p#billing_tipo_cliente_field label {
    margin: 0;
}

span.optional {
    display: none;
}

@media only screen and (max-width: 639px) {
    p#billing_tipo_cliente_field span.woocommerce-input-wrapper {
        flex-flow: nowrap;
    }
}


/* Applica solo ai form-row normali, NON a .tipo-cliente-campo */
.form-row:not(.tipo-cliente-campo) label {
    text-transform: uppercase;
    border-radius: 5px;
    font-weight: bold;
    color: #f2ac72 !important;
    letter-spacing: 1px;
    font-size: 12px !important;
}

/* ==============================================
   CSS CART
   ============================================== */
.prova-anche-wrapper {
    margin: 60px 0 40px;
    padding: 40px 0;
    background: #fff7f2;
    border-radius: 10px;
    position: relative;
}

.prova-anche-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ec671b, #ec671b, #fff7f2, #ec671b, #ec671b);
}

.prova-anche-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.prova-anche-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #ec671b;
    margin: 0 0 10px;
    font-family: 'Medel', sans-serif;
}

.prova-anche-subtitle {
    font-size: 1.1em;
    color: #000;
    margin: 0;
    font-weight: 400;
    font-family: 'Lato', sans-serif;
}

.prova-anche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.prova-anche-item {
    background: white;
    border-radius: 10px;
    padding: 0;
    /*box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);*/
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prova-anche-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.prova-anche-item.featured {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.prova-anche-item.removing {
    transform: scale(0.8);
    opacity: 0;
}

.prova-anche-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.prova-anche-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.prova-anche-item:hover .prova-anche-thumb img {
    transform: scale(1.1);
}

.prova-anche-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prova-anche-overlay span {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
}

.prova-anche-thumb:hover .prova-anche-overlay {
    opacity: 1;
}

.prova-anche-content {
    padding: 25px 20px;
}

.prova-anche-product-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3436;
    font-family: 'Lato', sans-serif;
    margin: 0 0 12px;
    line-height: 1.4;
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.prova-anche-price {
    font-size: 1.4em;
    font-weight: 700;
    color: #e17055;
    margin-bottom: 20px;
    font-family: 'Lato', sans-serif;
}

.prova-anche-price del {
    color: #b2bec3;
    font-size: 0.8em;
    margin-right: 5px;
}

.prova-anche-price ins {
    text-decoration: none;
}

.prova-anche-actions {
    margin-top: auto;
}

.prova-anche-add-to-cart {
    width: 100%;
    padding: 14px 20px;
    background: #ffc800;
    color: #510000;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Lato', sans-serif;
}

.prova-anche-add-to-cart:hover:not(.loading):not(.added):not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #fff !important;
}

.prova-anche-add-to-cart:disabled {
    background: #b2bec3;
    cursor: not-allowed;
    transform: none;
}

.prova-anche-add-to-cart.loading {
    background: #b2bec3;
    cursor: not-allowed;
}

.prova-anche-add-to-cart.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.prova-anche-add-to-cart.added {
    background: #00b894;
    cursor: default;
}

.prova-anche-added-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.prova-anche-added-text svg {
    animation: checkmark 0.3s ease;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}



img.frafocaccia {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 250px !important;
}


/* 🔹 Evidenziazione metodo di spedizione gratuita */
.woocommerce ul#shipping_method li label[for*="free_shipping"] {
    color: #ec671b;
    font-weight: 700;
    border-radius: 8px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .prova-anche-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .prova-anche-title {
        font-size: 1.8em;
    }

    .prova-anche-item {
        margin: 0 10px;
    }

    .prova-anche-item.featured {
        transform: none;
    }
}

@media only screen and (max-width: 639px) {
    img.frafocaccia {
        position: absolute;
        top: -3.8%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 200px !important;
    }

    td.product-thumbnail {
        display: block !important;
    }

    td.product-thumbnail:before {
        content: none !important;
    }

    .prova-anche-wrapper {
        z-index: 0;
    }


    .elementor-widget-woocommerce-checkout-page .woocommerce-checkout .form-row>span {
        display: block;
    }

    span.woocommerce-input-wrapper label {
        width: 100%;
        margin: 20px 0 0 !important;
        display: block;
    }

    p#billing_email_field {
        width: 100%;
    }

    p#billing_phone_field {
        width: 100%;
    }

    .e-checkout__column.e-checkout__column-end {
        margin-top: 70px;
    }
}


/** FUNZIONE REGALI NEL CARRELLO **/
#bonus-box {
    background: #f6f6f6;
    border-radius: 10px;
    padding: 25px 20px 35px;
    margin-top: 30px;
    font-family: system-ui, sans-serif;
    text-align: center;
    color: #222;
}

#bonus-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.bonus-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto 25px;
    position: relative;
}

.bonus-icon {
    font-size: 40px;
    line-height: 1;
}

.progress-area {
    flex: 1;
    position: relative;
}

.progress-line {
    position: relative;
    height: 14px;
    background: #ddd;
    border-radius: 30px;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 14px;
    background: #f8cc32;
    border-radius: 30px;
    transition: width .4s ease;
}

.step {
    position: absolute;
    top: 20px;
    transform: translateX(-80%);
    text-align: center;
}

.step .triangle {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 8px solid #ccc;
    margin: 0 auto 6px;
    transition: .3s ease;
}

.step.active .triangle {
    border-bottom-color: #f8cc32;
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
}

.step small {
    display: block;
    font-size: 12px;
    color: #777;
    font-weight: 400;
}

.bonus-text {
    font-size: 15px;
    margin-top: 80px;
    line-height: 1.4;
}

.bonus-text strong {
    color: #000;
}

.bonus-achieved {
    color: #007a00;
    font-weight: 600;
}


@media (max-width: 480px) {

    /* riduco padding e font */
    #bonus-box {
        padding: 20px 15px 25px;
    }

    #bonus-box h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    /* la struttura principale diventa verticale */
    .bonus-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* barra più sottile e più corta */
    .progress-area {
        width: 90%;
    }

    .progress-line {
        height: 12px;
    }

    /* le tappe si impilano sotto la barra */
    .step {
        position: static;
        transform: none;
        margin-top: 10px;
        text-align: center;
    }

    /* triangolino sopra la scritta */
    .step .triangle {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 7px solid #ccc;
        margin-bottom: 4px;
    }

    .step.active .triangle {
        border-bottom-color: #f8cc32;
    }

    .step-label {
        font-size: 13px;
        display: block;
    }

    .step small {
        font-size: 11px;
        display: block;
        color: #777;
    }

    /* messaggi sotto la barra con meno spazio */
    .bonus-text {
        margin-top: 20px;
        font-size: 14px;
    }

    .bonus-icon {
        display: none;
    }
}