/**
 * B2B Checkout Styles
 *
 * @since 1.10
 * @package Stampa_Digitale
 */

/* Type Selector Container */
.stampa-b2b-type-selector {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e4e7;
}

.stampa-b2b-type-selector h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Type Options Container */
.b2b-type-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Individual Type Option */
.b2b-type-option {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.b2b-type-option:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.b2b-type-option.active {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 2px 12px rgba(34, 113, 177, 0.2);
}

.b2b-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Type Icon */
.b2b-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    background: #e9ecef;
    border-radius: 50%;
    color: #666;
    transition: all 0.3s ease;
}

.b2b-type-option:hover .b2b-type-icon,
.b2b-type-option.active .b2b-type-icon {
    background: #2271b1;
    color: #fff;
}

.b2b-type-icon svg {
    width: 24px;
    height: 24px;
}

/* Type Label */
.b2b-type-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.b2b-type-option.active .b2b-type-label {
    color: #2271b1;
}

/* B2B Fields in Checkout */
.stampa-b2b-field {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.stampa-b2b-field.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden;
}

.stampa-b2b-field.visible {
    opacity: 1;
    max-height: 200px;
    visibility: visible;
}

/* Company Fields Group */
.stampa-company-field {
    background: #f8f9fa;
    border-radius: 4px;
}

.stampa-company-field label {
    color: #2271b1 !important;
    font-weight: 600 !important;
}

.stampa-company-field input {
    border: 1px solid #2271b1 !important;
}

.stampa-company-field input:focus {
    border-color: #135e96 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2) !important;
}

/* B2B Details in Order View */
.stampa-b2b-details {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
}

.stampa-b2b-details h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2271b1;
}

.stampa-b2b-details table {
    margin: 0;
}

.stampa-b2b-details th {
    width: 40%;
    padding: 8px 10px;
    text-align: left;
    background: #e9ecef;
}

.stampa-b2b-details td {
    padding: 8px 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .b2b-type-options {
        flex-direction: column;
    }

    .b2b-type-option {
        max-width: 100%;
        flex-direction: row;
        padding: 15px;
        gap: 15px;
    }

    .b2b-type-icon {
        margin-bottom: 0;
        width: 40px;
        height: 40px;
    }

    .b2b-type-icon svg {
        width: 20px;
        height: 20px;
    }

    .stampa-b2b-type-selector {
        padding: 15px;
    }
}

/* Animation for field appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stampa-b2b-field.animate-in {
    animation: slideDown 0.3s ease forwards;
}

/* Validation States */
.stampa-b2b-field.woocommerce-invalid input {
    border-color: #d63638 !important;
}

.stampa-b2b-field.woocommerce-validated input {
    border-color: #00a32a !important;
}

/* Required indicator for B2B fields */
.stampa-b2b-field.required label::after {
    content: " *";
    color: #d63638;
}
