/**
 * Gestione Prodotti - Stili Form Regalo
 * 
 * Stili per il form regalo interattivo
 */

/* ========================================================================
   CONTENITORI PRINCIPALI
   ======================================================================== */

.gf-wrapper {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
}

/* Loading spinner */
.gf-loading {
    padding: 2rem;
    text-align: center;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gf-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: gfspin 0.7s linear infinite;
}

/* ========================================================================
   ANIMAZIONI
   ======================================================================== */

@keyframes gfspin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes gfFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gfPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes gfSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ========================================================================
   SEZIONI FORM
   ======================================================================== */

.gf-section {
    margin-bottom: 1.5rem;
}

.gf-section,
.gf-gift-section,
.gf-submit {
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
}

.gf-section-label {
    font-family: "Louvette Display Regular", Sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    margin: 0 0 10px;
}

.gf-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 1.25rem 0;
}

/* ========================================================================
   TIPO DI ORDINE (Per me / È un regalo)
   ======================================================================== */

.gf-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gf-type-card {
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    transform: translateY(0);
}

.gf-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gf-type-card.active {
    border: 1.5px solid #111;
    background: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gf-type-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
    color: #111;
}

.gf-type-card span {
    font-size: 14px;
    color: #777;
}

/* ========================================================================
   GRIGLIA VARIANTI PRODOTTO
   ======================================================================== */

.gf-variants-grid {
    display: grid;
    gap: 0;
}

.gf-variants-head,
.gf-variant-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
}

.gf-variants-head {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    padding-bottom: 8px;
}

.gf-variant-row:not(.gf-variant-row-first) {
    padding: 20px 0;
    border-top: 1px solid #9f9753;
}

.gf-variant-row:first-child {
    padding: 0 0 20px 0;
    border-top: none;
}

/* Riga del servizio principale */
.gf-variant-row-first {
    padding: 26px 0px;
    color: #9f9753;
    background: #fff;
    border: 1px solid #9f9753;
}

.gf-variant-row-first .gf-var-name {
    padding-left: 16px;
    font-size: 18px;
    color: #9f9753;
}

/* Nome della variante */
.gf-var-name {
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

.gf-var-desc {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-top: 4px;
    line-height: 1em;
}

.gf-var-price {
    font-size: 14px;
    color: #777;
}

/* ========================================================================
   CONTROLLO QUANTITÀ
   ======================================================================== */

.gf-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

button.gf-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    color: #111;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    font-family: inherit;
    transform: scale(1);
}

button.gf-qty-btn:hover {
    color: #9f9753;
    background: none;
    transform: scale(1.1);
}

button.gf-qty-btn:active,
.gf-qty-btn:focus {
    color: #9f9753;
    background: none;
    transform: scale(0.95);
}

.gf-qty-num {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
}

/* ========================================================================
   RIEPILOGO TOTALI
   ======================================================================== */

.gf-subtotals {
    margin-bottom: 1.5rem;
}

.gf-subtotals.animate {
    animation: fadeOutIn 0.6s ease;
}

.gf-sub-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    color: #666;
    padding: 3px 0;
}

.gf-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #9f9753;
    margin-top: 8px;
    padding-top: 10px;
}

.gf-total-row .tl {
    font-size: 22px;
    font-weight: 600;
    color: #111;
}

.gf-total-row .tv {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
}

/* ========================================================================
   SEZIONE REGALO (nascondiglio di default)
   ======================================================================== */

.gf-gift-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.gf-gift-section.show {
    opacity: 1;
    max-height: 500px;
}

/* ========================================================================
   CAMPI MODULO
   ======================================================================== */

.gf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.gf-field label {
    font-size: 14px;
    color: #666;
}

.gf-wrapper input[type=text],
.gf-wrapper input[type=email],
.gf-wrapper textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: #111;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.gf-wrapper textarea {
    resize: vertical;
    min-height: 75px;
}

.gf-wrapper input:focus,
.gf-wrapper textarea:focus {
    outline: none;
    border-color: #9f9753;
    box-shadow: 0 0 0 3px rgba(159, 151, 83, 0.1);
    transform: translateY(-1px);
}

/* Griglia 2 colonne */
.gf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ========================================================================
   PULSANTE SUBMIT
   ======================================================================== */

.gf-section-submit {
    text-align: center;
}

button.gf-submit {
    background-color: var(--e-global-color-secondary);
    font-family: "Louvette Display Regular", Sans-serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 1.5px;
    fill: #FFFFFF;
    color: #FFFFFF;
    border-style: solid;
    border-width: 1px;
    border-color: var(--e-global-color-secondary);
    border-radius: 0px;
    padding: 8px 20px 7px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

button.gf-submit:hover {
    background: #fff;
    color: #9f9753;
    border: 1px solid #9f9753;
}

button.gf-submit:focus {
    background: #fff;
    color: #9f9753;
    border: 1px solid #9f9753;
}

button.gf-submit:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

button.gf-submit.loading {
    animation: gfPulse 1.5s infinite;
}

/* ========================================================================
   MESSAGGI DI ERRORE
   ======================================================================== */

.gf-error {
    color: #c00;
    font-size: 0.82rem;
    margin-top: 6px;
    display: none;
}

.gf-req {
    color: #c00;
}
