/* ========================================
   MIGLIORAMENTI SPEDIZIONI E GESTIONE ORDINI
   ======================================== */

/* ========================================
   GESTIONE ERRORI E METODI NON DISPONIBILI
   ======================================== */

/* Nasconde automaticamente i metodi di spedizione non disponibili */
.table-checkout-shipping-method .row-error {
    display: none !important;
}

/* Nasconde le righe complete con errori */
.table-checkout-shipping-method tr:has(.message.error) {
    display: none !important;
}

/* Nasconde i messaggi di errore specifici */
.message.error:contains("This shipping method is not available"),
.message.error:contains("not available"),
.message.error:contains("contact us") {
    display: none !important;
}

/* Nasconde le righe che contengono solo errori e nessun radio button attivo */
.table-checkout-shipping-method tr:has(.message.error):not(:has(input[type="radio"]:not(:disabled))) {
    display: none !important;
}

/* Nasconde completamente i metodi di spedizione che mostrano errori */
.shipping-method-item:has(.message.message-error),
.table-checkout-shipping-method tr:has(.message.message-error) {
    display: none !important;
}

/* Nasconde i singoli shipping methods con errori */
.field.choice:has(.message.message-error) {
    display: none !important;
}

/* Nasconde l'intero container se contiene solo errori */
.shipping-method:has(.message.message-error):not(:has(input[type="radio"]:not(:disabled))) {
    display: none !important;
}

/* Nascondi specificamente i div error */
.col-error .message.error {
    display: none !important;
}

/* Nascondi le righe con classe row-error */
tr.row-error {
    display: none !important;
}

/* ========================================
   STILI BASE PER I METODI DI SPEDIZIONE
   ======================================== */

/* Stile per metodi di spedizione disponibili */
.table-checkout-shipping-method tr:has(input[type="radio"]:not(:disabled)) {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table-checkout-shipping-method tr:has(input[type="radio"]:checked) {
    background: #e8f5e8 !important;
    border-color: #4caf50 !important;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
    transform: translateY(-1px);
}

/* Hover effect per i metodi disponibili */
.table-checkout-shipping-method tr:has(input[type="radio"]:not(:disabled)):hover {
    border-color: #4caf50;
    background: #f0f8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ========================================
   MIGLIORAMENTI PICKUP LOCATION
   ======================================== */

/* Migliora l'aspetto del pickup location */
.table-checkout-shipping-method tr:has(input[value*="instore"]) {
    background: #f1f8e9 !important;
    border-left: 4px solid #4caf50 !important;
}

.table-checkout-shipping-method tr:has(input[value*="instore"]) td {
    padding: 12px 8px !important;
    font-weight: 600 !important;
    color: #2d7d32 !important;
}

/* Aggiungi icona al pickup */
.table-checkout-shipping-method td:contains("Pick in Store"):before {
    content: "📍 ";
    margin-right: 5px;
}

/* ========================================
   MIGLIORAMENTI MOBILE
   ======================================== */

@media (max-width: 768px) {
    /* Ottimizza la tabella per mobile */
    .table-checkout-shipping-method {
        display: block;
        width: 100%;
    }
    
    .table-checkout-shipping-method tr {
        display: block;
        width: 100%;
        margin-bottom: 12px;
        border-radius: 8px;
        border: 2px solid #e0e0e0;
        background: #fafafa;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .table-checkout-shipping-method td {
        display: block;
        width: 100%;
        padding: 8px 0;
        border: none;
        text-align: left;
    }
    
    /* Radio button più grande su mobile */
    .table-checkout-shipping-method input[type="radio"] {
        transform: scale(1.3);
        margin-right: 12px;
    }
    
    /* Prezzo più evidente su mobile */
    .table-checkout-shipping-method .col-price {
        font-size: 18px;
        font-weight: 700;
        color: #4caf50;
        text-align: right;
        padding: 8px 0;
    }
    
    /* Nome del metodo più grande */
    .table-checkout-shipping-method .col-method {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
    
    /* Carrier con logo più evidente */
    .table-checkout-shipping-method .col-carrier {
        display: flex;
        align-items: center;
        padding: 8px 0;
    }
    
    .table-checkout-shipping-method .col-carrier img {
        height: 32px !important;
        width: auto;
        margin-right: 12px;
    }
    
    /* Metodo selezionato su mobile */
    .table-checkout-shipping-method tr:has(input[type="radio"]:checked) {
        background: #e8f5e8 !important;
        border-color: #4caf50 !important;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
}

/* ========================================
   MIGLIORAMENTI LOGO E BRANDING
   ======================================== */

/* Logo Bartolini migliorato */
.table-checkout-shipping-method .col-carrier img[src*="bartolini"] {
    height: 28px !important;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Stile per altri carrier */
.table-checkout-shipping-method .col-carrier span {
    font-weight: 500;
    color: #555;
}

/* ========================================
   MIGLIORAMENTI ACCESSIBILITÀ
   ======================================== */

/* Focus visibile per i radio button */
.table-checkout-shipping-method input[type="radio"]:focus {
    outline: 2px solid #4caf50;
    outline-offset: 2px;
}

/* Label cliccabili più grandi */
.table-checkout-shipping-method label {
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.table-checkout-shipping-method label:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

/* ========================================
   MIGLIORAMENTI PERFORMANCE
   ======================================== */

/* Ottimizza le transizioni */
.table-checkout-shipping-method tr {
    will-change: transform, box-shadow;
}

/* Riduce il repaint durante le animazioni */
.table-checkout-shipping-method {
    contain: layout style paint;
}

/* ========================================
   MIGLIORAMENTI GESTIONE ORDINI
   ======================================== */

/* Stili per la pagina di gestione ordini */
.order-details-view {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.order-details-view .order-status {
    font-size: 18px;
    font-weight: 600;
    color: #4caf50;
    margin-bottom: 15px;
    padding: 10px;
    background: #e8f5e8;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
}

/* Responsive per gestione ordini */
@media (max-width: 768px) {
    .order-details-view {
        padding: 15px;
        margin: 10px;
    }
    
    .order-details-view .order-status {
        font-size: 16px;
        padding: 8px;
    }
}

/* ========================================
   MIGLIORAMENTI TRACKING SPEDIZIONI
   ======================================== */

/* Stili per il tracking delle spedizioni */
.shipment-tracking {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #007bff;
}

.shipment-tracking .tracking-number {
    font-weight: 600;
    color: #007bff;
    font-family: monospace;
    font-size: 14px;
}

.shipment-tracking .tracking-status {
    margin-top: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* ========================================
   MIGLIORAMENTI NOTIFICHE
   ======================================== */

/* Notifiche per aggiornamenti spedizione */
.shipping-notification {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    color: #0c5460;
}

.shipping-notification.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.shipping-notification.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.shipping-notification.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
} 