/**
 * Stili aggiornati per My Account con nuove funzionalità
 * Salva come: generatepress-child/woocommerce/myaccount/myaccount.css
 */

/* Reset e base per my account */
.woocommerce-account .entry-hero-container-inner {
    display: none !important;
}

.woocommerce-account .content-area {
    margin-top: 0 !important;
    padding-top: 30px !important;
}

.woocommerce-account .entry-content-wrap {
    padding: 0;
}

.stemtech-myaccount-page {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
    padding: 0 20px;
    background: #f9fafb;
}

/* Override contenitori generatepress */
.woocommerce-account .content-wrap,
.woocommerce-account .site-content,
.woocommerce-account .content-container,
.woocommerce-account .site-container {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Container principale */
.myaccount-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Header account */
.account-header {
    background: white;
    color: black;
    padding: 40px 50px;
    text-align: center;
    position: relative;
}

.account-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.account-header * {
    position: relative;
    z-index: 1;
}

.account-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.account-welcome {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Navigation tabs */
.account-navigation {
    background: white;
    border-bottom: 2px solid #f1f5f9;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.account-navigation::-webkit-scrollbar {
    display: none;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 100%;
    justify-content: center;
}

.nav-tab {
    flex: 1;
    min-width: 160px;
}

.nav-tab a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    gap: 8px;
    white-space: nowrap;
    font-size: 14px;
}

.nav-tab a:hover {
    color: #1e3a5f;
    background: #f8fafc;
}

.nav-tab.active a {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    background: #f8fafc;
}

/* Icons per le tab */
.nav-tab a::before {
    content: '';
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.nav-tab[data-tab="dashboard"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"/><polyline points="9,22 9,12 15,12 15,22"/></svg>');
}

.nav-tab[data-tab="orders"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><path d="M9 9h6M9 15h6"/></svg>');
}

.nav-tab[data-tab="edit-address"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg>');
}

.nav-tab[data-tab="edit-account"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>');
}

.nav-tab[data-tab="change-password"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg>');
}

.nav-tab[data-tab="customer-logout"] a::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9"/></svg>');
}

/* Content area */
.account-content {
    padding: 50px;
}

/* Nascondi sidebar WooCommerce */
.woocommerce-MyAccount-navigation {
    display: none !important;
}

.woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
}

/* Stile del contenuto */
.woocommerce-MyAccount-content p,
.woocommerce-MyAccount-content div {
    color: #374151 !important;
}

.woocommerce-MyAccount-content a {
   
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-MyAccount-content a:hover {
    text-decoration: underline;
}

/* Dashboard cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.dashboard-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    border-color: #1e3a5f;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.dashboard-card h4 {
    color: #1e3a5f;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-card p {
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Stili per il form cambio password */
.change-password-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 40px;
    margin-top: 20px;
    border: 2px solid #e2e8f0;
}

.change-password-section h2 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

.change-password-section p {
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
}

.change-password-form .form-row {
    margin-bottom: 24px;
}

.change-password-form label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.change-password-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.change-password-form input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.password-requirements {
    color: #6b7280;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Gestione indirizzi migliorata */
.address-management-page h2 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

.addresses-description {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.5;
}

.billing-option-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.billing-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.billing-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.3);
    accent-color: #1e3a5f;
}

.addresses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.address-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
}

.address-card:hover {
    border-color: #1e3a5f;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.address-card h3 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.address-card address {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
    font-style: normal;
    min-height: 80px;
    font-size: 14px;
}

.address-card .no-address {
    color: #9ca3af;
    font-style: italic;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.edit-address-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #1e3a5f;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.edit-address-btn:hover {
    color: white !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Form di modifica account senza password */
.edit-account-section .woocommerce-EditAccountForm {
    background: #f8fafc;
    border-radius: 16px;
    padding: 40px;
    margin-top: 20px;
    border: 2px solid #e2e8f0;
}

.edit-account-section h2 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Nascondi campi password nel form edit-account */
.edit-account-section .woocommerce-form-row:has(input[name="password_current"]),
.edit-account-section .woocommerce-form-row:has(input[name="password_1"]),
.edit-account-section .woocommerce-form-row:has(input[name="password_2"]),
.edit-account-section .form-row-password,
.edit-account-section fieldset {
    display: none !important;
}

.edit-account-section .woocommerce-form-row {
    margin-bottom: 24px;
}

.edit-account-section label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.edit-account-section input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.edit-account-section input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.edit-account-section button {
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.edit-account-section button:hover {
    background: #c2185b;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .stemtech-myaccount-page {
        padding: 0 16px;
    }
    
    .myaccount-container {
        margin: 20px 0;
    }
    
    .account-header {
        padding: 30px 24px;
    }
    
    .account-title {
        font-size: 2rem;
    }
    
    .account-content {
        padding: 30px 24px;
    }
    
    .nav-tabs {
        justify-content: flex-start;
    }
    
    .nav-tab {
        min-width: 120px;
        flex: none;
    }
    
    .nav-tab a {
        padding: 16px 12px;
        font-size: 13px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .addresses-grid {
        grid-template-columns: 1fr;
    }
    
    .address-card {
        padding: 20px;
        min-height: auto;
    }
}

/* Utility classes */
.st-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.st-address {
    margin: 0;
}

.required {
    color: #e91e63;
}

/* --- STILI AGGIUNTI DAL BLOCCO INTERNO --- */

/* Stili aggiuntivi per il form edit account */
.edit-account-section .woocommerce-EditAccountForm {
    background: #f8fafc;
    border-radius: 16px;
    padding: 40px;
    margin-top: 20px;
    border: 2px solid #e2e8f0;
}

.edit-account-section .form-row-first {
    float: left;
    width: 48%;
    margin-right: 4%;
}

.edit-account-section .form-row-last {
    float: right;
    width: 48%;
}

.edit-account-section .form-row-wide {
    width: 100%;
    clear: both;
}

.edit-account-section .clear {
    clear: both;
    height: 0;
    overflow: hidden;
}

.edit-account-section .woocommerce-form-row {
    margin-bottom: 24px;
}

.edit-account-section label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.edit-account-section input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.edit-account-section input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.edit-account-section button {
    
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.edit-account-section button:hover {
    background: #c2185b;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    transform: translateY(-1px);
}

.edit-account-section .required {
    
}

.edit-account-section em {
    display: block;
    margin-top: 5px;
    font-style: italic;
}

/* Responsive per i campi affiancati */
@media (max-width: 768px) {
    .edit-account-section .form-row-first,
    .edit-account-section .form-row-last {
        float: none;
        width: 100%;
        margin-right: 0;
    }
}

/* --- STILI PER TOGGLE PASSWORD --- */

/* Rende il contenitore un punto di riferimento per il posizionamento */
.password-field-wrapper {
    position: relative;
}

/* Posiziona l'icona in modo assoluto dentro al contenitore */
.password-field-wrapper .password-toggle {
    position: absolute;
    top: 50%; /* Centra verticalmente */
    right: 20px; /* Distanza dal bordo destro */
    transform: translateY(-50%); /* Allineamento verticale perfetto */
    background: none; /* Rimuove lo sfondo */
    border: none; /* Rimuove il bordo */
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem; /* Dimensione dell'icona */
    color: #64748b; /* Colore dell'icona */
}

/* Aggiunge spazio a destra nel campo di testo per non sovrapporre il testo all'icona */
.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] {
    padding-right: 50px !important;
}

/* ===================================================================
   STILI PER FORM MODIFICA INDIRIZZO (uniformato con edit-account)
   =================================================================== */

.address-edit-form-wrapper {
    background: #f8fafc;
    border-radius: 16px;
    padding: 40px;
    margin-top: 20px;
    border: 2px solid #e2e8f0;
}

.address-edit-header {
    margin-bottom: 30px;
}

.address-edit-header h2 {
    color: #1e3a5f;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

.address-edit-description {
    color: #64748b;
    line-height: 1.6;
    font-size: 16px;
}

/* Form fields styling */
.woocommerce-address-edit-form .woocommerce-address-fields {
    display: grid;
    gap: 0;
}

.woocommerce-address-edit-form .form-row {
    margin-bottom: 24px;
}

.woocommerce-address-edit-form label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.woocommerce-address-edit-form input[type="text"],
.woocommerce-address-edit-form input[type="email"],
.woocommerce-address-edit-form input[type="tel"],
.woocommerce-address-edit-form select,
.woocommerce-address-edit-form textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.woocommerce-address-edit-form input:focus,
.woocommerce-address-edit-form select:focus,
.woocommerce-address-edit-form textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.woocommerce-address-edit-form textarea {
    resize: vertical;
    min-height: 100px;
}

.woocommerce-address-edit-form select {
    cursor: pointer;
}

/* Form actions */
.woocommerce-address-edit-form .form-actions {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.woocommerce-address-edit-form .save-address-btn {
    background: #1e3a5f;
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woocommerce-address-edit-form .save-address-btn:hover {
    background: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.woocommerce-address-edit-form .back-btn {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.woocommerce-address-edit-form .back-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Campi affiancati */
.woocommerce-address-edit-form .form-row-first {
    float: left;
    width: 48%;
    margin-right: 4%;
}

.woocommerce-address-edit-form .form-row-last {
    float: right;
    width: 48%;
}

.woocommerce-address-edit-form .form-row-wide {
    width: 100%;
    clear: both;
}

.woocommerce-address-edit-form .clear {
    clear: both;
    height: 0;
    overflow: hidden;
}

/* Responsive per form indirizzi */
@media (max-width: 768px) {
    .address-edit-form-wrapper {
        padding: 24px;
    }
    
    .woocommerce-address-edit-form .form-row-first,
    .woocommerce-address-edit-form .form-row-last {
        float: none;
        width: 100%;
        margin-right: 0;
    }
    
    .woocommerce-address-edit-form .form-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .woocommerce-address-edit-form .save-address-btn,
    .woocommerce-address-edit-form .back-btn {
        width: 100%;
        text-align: center;
    }
}