/**
 * Altragraph Ticket Forms - Foglio di stile per l'area pubblica (Frontend).
 * Percorso: /altragraph-ticket-forms/assets/css/altgr-tf-frontend.css
 */

/* Contenitore principale del modulo */
.atf-forms-wrapper {
    margin: 20px 0;
    padding: 0;
    width: 100%;
    clear: both;
}

/* Struttura del Fieldset del Gruppo di Biglietti */
.atf-checkbox-group {
    background-color: var(--atf-color-group-bg, #f5f5f5);
    border: 1px solid var(--atf-color-group-border, #c6d0e9);
    border-radius: var(--atf-radius-group, 6px);
    margin: 0 0 20px 0;
    padding: 20px;
    box-sizing: border-box;
}

.atf-checkbox-group:last-of-type {
    margin-bottom: 25px;
}

/* Legenda e Label del Gruppo */
.atf-group-label {
    font-size: var(--atf-label-size, 16px);
    font-weight: var(--atf-label-weight, bold);
    color: var(--atf-color-label, #424242);
    padding: 0 10px;
    margin: 0;
    border: none;
    background: transparent;
    display: inline-block;
    width: auto;
}

.atf-required-mark {
    color: var(--atf-color-error, #f55050);
    margin-left: 3px;
}

/* Lista delle Opzioni Interne - Struttura Mobile-First (Flexbox) */
.atf-options-list {
    margin-top: 10px;
}

.atf-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    gap: 15px;
}

.atf-option-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.atf-option-row:first-child {
    padding-top: 5px;
}

/* Informazioni descrittive del biglietto */
.atf-option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.atf-checkbox-label {
    font-weight: 600;
    color: var(--atf-color-label, #424242);
    line-height: 1.3;
}

.atf-option-price {
    font-size: var(--atf-price-size, 15px);
    color: var(--atf-color-price, #797979);
    font-weight: 500;
    margin-top: 2px;
}

.atf-option-description {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    line-height: 1.3;
}

/* Selettore Quantitativo Strutturato (+ / -) */
.atf-quantity-selector {
    display: flex;
    align-items: center;
    width: var(--atf-qty-width, 100px);
    height: var(--atf-qty-height, 45px);
    border: 1px solid var(--atf-color-group-border, #c6d0e9);
    border-radius: var(--atf-qty-radius, 6px);
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

/* Pulsanti Incrementali */
.atf-qty-btn {
    width: 30px;
    height: 100%;
    background-color: var(--atf-color-btn-bg, #eeeeee);
    color: var(--atf-color-btn-text, #424242);
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    user-select: none;
    transition: background-color 0.15s ease;
}

.atf-qty-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.atf-qty-btn:focus {
    outline: 2px solid var(--atf-color-primary, #3340d3);
    outline-offset: -2px;
}

/* Input Numerico Centrale */
.atf-qty-input {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--atf-color-label, #424242);
    box-shadow: none !important;
    -moz-appearance: textfield;
}

/* Rimozione frecce native Chrome/Safari */
.atf-qty-input::-webkit-outer-spin-button,
.atf-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.atf-qty-input:focus {
    outline: none !important;
    background: #fff !important;
}

/* Blocco Riassuntivo Totale Dinamico */
.atf-total-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #fff;
    border: 2px solid var(--atf-color-primary, #3340d3);
    border-radius: var(--atf-radius-group, 6px);
    margin: 25px 0;
    box-sizing: border-box;
}

.atf-total-label {
    font-size: var(--atf-total-size, 16px);
    font-weight: bold;
    color: var(--atf-color-total-label, #424242);
}

.atf-total-value {
    font-size: calc(var(--atf-total-size, 16px) * 1.2);
    font-weight: 800;
    color: var(--atf-color-total-value, #3340d3);
}

/* Evidenziazione degli errori di convalida a frontend */
.atf-input-error {
    border-color: var(--atf-color-error, #f55050) !important;
    background-color: rgba(245, 80, 80, 0.03) !important;
}

/* Nasconde visivamente gli elementi nativi mascherati */
.atf-hidden-price {
    display: none !important;
    visibility: hidden !important;
}

/* Contenitore blocco quantità allineato staticamente per il carrello (#4) */
.atf-cart-qty-locked {
    font-weight: 600;
    color: var(--atf-color-label, #424242);
    display: inline-block;
    padding: 4px 8px;
}

/* =========================================================================
   COMPATIBILITÀ TEMA / COMPONENTI ESTERNI
   ========================================================================= */

/* Soppressione selettiva residuo etichetta quantità spuria del tema (#3) */
b.my-quatity-label {
    display: none !important;
}

/* Breakpoint Responsive per Schermi Desktop e Tablet */
@media screen and (min-width: 480px) {
    .atf-checkbox-group {
        padding: 25px;
    }
    
    .atf-quantity-selector {
        width: calc(var(--atf-qty-width, 100px) * 1.15);
    }
}