/* ============================================
   ALFERA WISHLIST v12 — Mobile card layout
   Brand color: #577271
   Font: inherits from theme (Inter/system)
   ============================================ */

/* Wishlist Container */
.alfera-wishlist-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

/* Empty State */
#wishlist-empty-message {
    text-align: center;
    padding: 60px 40px;
    background: #f7f8fa;
    border-radius: 12px;
    color: #666;
}

#wishlist-empty-message p {
    font-size: 17px;
    margin-bottom: 20px;
}

#wishlist-empty-message .button {
    display: inline-block;
    background: #577271;
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

#wishlist-empty-message .button:hover {
    background: #465c5b;
}

/* ============================================
   TABLE (Desktop)
   ============================================ */
.wishlist-table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    margin-bottom: 40px;
    border: 1px solid #e8eaed;
}

.alfera-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.alfera-wishlist-table thead th {
    text-align: left;
    padding: 14px 16px;
    background: #577271;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: none;
    white-space: nowrap;
}

.alfera-wishlist-table thead th:first-child {
    border-radius: 11px 0 0 0;
    padding-left: 20px;
}

.alfera-wishlist-table thead th:last-child {
    border-radius: 0 11px 0 0;
    padding-right: 20px;
}

.alfera-wishlist-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: middle;
    font-size: 14px;
    color: #333;
}

.alfera-wishlist-table tbody tr:last-child td {
    border-bottom: none;
}

.alfera-wishlist-table tbody tr:hover {
    background: #f9fafa;
}

.col-check {
    width: 40px;
    text-align: center !important;
}

.col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #577271;
    cursor: pointer;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-thumb {
    width: 96px;
    height: 96px;
    max-width: none;          /* batte img{max-width:100%} del tema (altrimenti l'img si comprimeva) */
    box-sizing: border-box;
    object-fit: contain;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    background: #ffffff;
    flex-shrink: 0;
}
/* Il wrapper <a> è un flex-item della colonna: NON deve comprimersi, altrimenti
   con img{max-width:100%} del tema l'immagine si riduceva a ~30px nonostante width:96px. */
.product-info .product-link.product-image-link {
    flex: 0 0 auto;
    width: 96px;
}

.product-name {
    font-weight: 600;
    color: #222;
    font-size: 14px;
    line-height: 1.4;
}

.unit-price,
.total-price {
    font-weight: 700;
    color: #222;
    font-size: 14px;
    white-space: nowrap;
}

.total-price {
    color: #577271;
}

.qty-input {
    width: 72px;
    padding: 8px 10px;
    border: 1px solid #d5d7db;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
}

.qty-input:focus {
    outline: none;
    border-color: #577271;
    box-shadow: 0 0 0 2px rgba(87, 114, 113, 0.15);
}

/* ============================================
   TOGGLE SWITCH (Stampa SI/NO)
   ============================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccd0d4;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background-color: #577271;
}

input:focus + .slider {
    box-shadow: 0 0 2px #577271;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

.print-status-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */
.add-to-cart-btn,
.add-to-cart-btn.button,
.add-to-cart-btn.button.alt,
button.add-to-cart-btn {
    background: #577271 !important;
    color: #fff !important;
    border: none !important;
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.2px;
}

.add-to-cart-btn:hover,
.add-to-cart-btn.button:hover,
.add-to-cart-btn.button.alt:hover,
button.add-to-cart-btn:hover {
    background: #465c5b !important;
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn.atc-loading,
.add-to-cart-btn.atc-success {
    pointer-events: none;
    min-width: 48px;
    text-align: center;
}

.atc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: atc-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes atc-spin {
    to { transform: rotate(360deg); }
}

.add-to-cart-btn.atc-success {
    background: #2e7d55 !important;
}

.atc-tick {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

/* Remove button */
.remove-btn {
    background: none;
    border: none;
    color: #bbb;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.remove-btn:hover {
    color: #d33;
    background: #fff0f0;
}

/* ============================================
   MOBILE CARDS
   ============================================ */
.wishlist-cards-container {
    display: none;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

.wishlist-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8eaed;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Card Top: image + info */
.card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
}

.wishlist-card .product-thumb {
    width: 110px;
    height: 110px;
    max-width: none;
    box-sizing: border-box;
    border-radius: 10px;
    object-fit: contain;
    padding: 5px;
    border: 1px solid #e8eaed;
    background: #ffffff;
    flex-shrink: 0;
}
.wishlist-card .product-link.product-image-link {
    flex: 0 0 auto;
    width: 110px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.card-name-row .product-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.card-name-row .product-check {
    width: 18px;
    height: 18px;
    accent-color: #577271;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.card-info > .unit-price {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

/* Qty + Print controls in card */
.card-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.card-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-qty-label {
    font-size: 12px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-qty .qty-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 13px;
}

.card-print {
    display: flex;
    align-items: center;
}

/* Card Bottom: total + actions */
.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f7f8fa;
    border-top: 1px solid #f0f1f3;
    gap: 12px;
}

.card-total-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-total-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.card-total-info .total-price {
    font-size: 17px;
    font-weight: 800;
    color: #577271;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.card-actions .add-to-cart-btn {
    padding: 9px 14px !important;
    font-size: 12px !important;
}

.card-actions .remove-btn {
    font-size: 18px;
    padding: 6px 8px;
}

/* ============================================
   CONTACT FORM SECTION
   ============================================ */
.wishlist-form-section {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e8eaed;
}

.wishlist-form-intro {
    flex: 1;
    min-width: 300px;
}

.wishlist-form-intro h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: #222;
    line-height: 1.3;
}

.wishlist-form-intro p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 15px;
}

.wishlist-form-container {
    flex: 1;
    min-width: 300px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.half {
    flex: 1;
}

.form-group.full {
    width: 100%;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    padding: 11px 14px;
    border: 1px solid #d5d7db;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #333;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #577271;
    box-shadow: 0 0 0 2px rgba(87, 114, 113, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

.form-actions {
    margin-top: 20px;
}

.button.primary {
    background: #577271;
    color: #fff;
    border: none;
    padding: 13px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.button.primary:hover {
    background: #465c5b;
}

.form-privacy {
    margin-top: 16px;
    font-size: 12px;
    color: #888;
}

.form-privacy a {
    color: #577271;
    text-decoration: underline;
}

.form-response {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.form-response.success {
    background: #edf9f0;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.form-response.error {
    background: #fef2f2;
    color: #c53030;
    border: 1px solid #fed7d7;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .alfera-wishlist-wrapper {
        padding: 12px;
    }

    /* Hide table, show cards */
    .wishlist-table-container {
        display: none;
    }

    .wishlist-cards-container {
        display: flex;
    }

    .wishlist-form-section {
        flex-direction: column;
        padding: 24px;
        gap: 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 14px;
    }

    .wishlist-form-intro h2 {
        font-size: 22px;
    }
}

/* v19: Colonne Colore / Taglia con override tema (text color forzato) */
.alfera-wishlist-table .col-color,
.alfera-wishlist-table .col-size {
    width: 108px;
    text-align: center;
}

/* v32.3: ridistribuzione spazio — più respiro al nome prodotto, colonna
   carrello compatta (bottone icona), così il titolo non si schiaccia. */
.alfera-wishlist-table .col-product {
    min-width: 300px;
}
.alfera-wishlist-table .col-cart {
    width: 64px;
    text-align: center;
}
/* Bottone "Aggiungi al carrello" come ICONA nella tabella desktop (il testo
   occupava troppo spazio). Su mobile resta il bottone con testo. */
.alfera-wishlist-table .add-to-cart-btn.add-to-cart-btn--icon {
    width: 46px;
    height: 46px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.alfera-wishlist-table .add-to-cart-btn--icon .wl-cart-ico {
    display: block;
}

.alfera-wishlist-wrapper .variant-color-select,
.alfera-wishlist-wrapper .variant-size-select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    cursor: pointer !important;
}

.alfera-wishlist-wrapper .variant-color-select option,
.alfera-wishlist-wrapper .variant-size-select option {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    font-weight: normal !important;
    padding: 4px 8px !important;
}

.alfera-wishlist-wrapper .variant-color-select:disabled,
.alfera-wishlist-wrapper .variant-size-select:disabled {
    color: #888 !important;
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
}

/* v24: widget "Stampa" disabilitato per prodotti ALFERAIT (visibile ma non cliccabile) */
.alfera-print-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}
.alfera-print-disabled .switch,
.alfera-print-disabled .print-toggle,
.alfera-print-disabled .print-status-label {
    cursor: not-allowed;
}

/* v28: link su immagine e nome prodotto (scheda WC) */
.product-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
.product-link:hover,
.product-link:focus {
    color: inherit;
    text-decoration: none;
}
.product-link.product-image-link {
    display: inline-block;
    line-height: 0;
}
.product-link.product-image-link img.product-thumb {
    transition: opacity .15s ease;
}
.product-link.product-image-link:hover img.product-thumb,
.product-link.product-image-link:focus img.product-thumb {
    opacity: .85;
}
.product-link.product-name-link .product-name {
    transition: color .15s ease;
}
.product-link.product-name-link:hover .product-name,
.product-link.product-name-link:focus .product-name {
    color: #577271;
    text-decoration: underline;
}
