/**
 * @see _README_BEFORE_CHANGES.md — Read before making any changes.
 */
/**
 * WooCommerce Business Registration - Box & Dashboard
 */

/* =====================================================
   BOX
   ===================================================== */

.wc-br-box {
    margin-bottom: 1.5em;
}

.wc-br-box > h2 {
    display: block !important;
    padding: 0 0 0.5em !important;
    margin: 0 0 0.5em !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: 2px solid #dee2e6 !important;
    border-left: none !important;
    background: none !important;
    color: inherit !important;
}

.wc-br-box > .wc-br-box-desc,
.wc-br-box > .wc-br-box-notices,
.wc-br-box > .wc-br-box-badges,
.wc-br-box > .wc-br-box-data {
    padding: 0.5em 0 0;
}

.wc-br-box > .wc-br-box-desc:last-child,
.wc-br-box > .wc-br-box-notices:last-child,
.wc-br-box > .wc-br-box-badges:last-child,
.wc-br-box > .wc-br-box-data:last-child {
    padding-bottom: 0;
}

.wc-br-box > .wc-br-box-notices {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.wc-br-box > .wc-br-box-notices .wc-br-notice {
    margin: 0;
}

.wc-br-box > .wc-br-box-badges {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.wc-br-box > .wc-br-box-actions {
    padding: 0.75em 0 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625em;
    flex-wrap: wrap;
}

/* =====================================================
   ADDRESS CARDS
   ===================================================== */

.wc-br-box-data.wc-br-address-cards {
    padding: 0 !important;
    margin-top: 0.75em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.wc-br-address-card {
    display: flex;
    flex-direction: column;
    padding: 0.75em 0;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.wc-br-address-card + .wc-br-address-card {
    border-left: 1px solid #dee2e6 !important;
    padding-left: 1.5em !important;
}

.wc-br-address-card > h3 {
    display: block !important;
    margin: 0 0 0.5em !important;
    padding: 0 !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    background: none !important;
    border: none !important;
}

.wc-br-address-card > .wc-br-box-data {
    flex: 1;
    padding: 0;
}

.wc-br-address-card > .wc-br-box-actions {
    padding: 0.75em 0 0;
    margin: auto 0 0;
}

.wc-br-box-data address {
    font-style: normal;
    line-height: 1.6;
}

.wc-br-empty {
    margin: 0;
    font-style: italic;
    opacity: 0.7;
}

/* =====================================================
   DATA ROWS
   ===================================================== */

.wc-br-data-row {
    display: flex;
    padding: 0.375em 0;
    border-bottom: 1px solid #e9ecef;
}

.wc-br-data-row:last-child { border-bottom: none; }

.wc-br-data-row .label {
    width: 10em;
    font-weight: 600;
    flex-shrink: 0;
}

.wc-br-data-row .value { flex: 1; }

/* =====================================================
   DIFF
   ===================================================== */

.wc-br-diff-old {
    text-decoration: line-through;
    opacity: 0.6;
    margin-right: 0.5em;
}
.wc-br-diff-old a.wc-br-file-diff-link {
    text-decoration: none;
    opacity: 0.7;
}

.wc-br-diff-new {
    color: #198754;
    font-weight: 600;
}

/* =====================================================
   FORM TITLE fuori dal box
   ===================================================== */

.wc-br-form-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 1.25em 0 0.75em;
}

.wc-br-submit-row { margin-top: 0.75em; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media screen and (max-width: 640px) {
    .wc-br-box-data.wc-br-address-cards {
        grid-template-columns: 1fr;
    }
    .wc-br-address-card + .wc-br-address-card {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid #dee2e6 !important;
    }
}

@media screen and (max-width: 600px) {
    .wc-br-data-row { flex-direction: column; gap: 0.2em; }
    .wc-br-data-row .label,
    .wc-br-data-row .value { width: 100%; }
    .wc-br-box > .wc-br-box-actions { flex-direction: column; }
    .wc-br-box > .wc-br-box-actions .button { width: 100%; }
}

/* =====================================================
   BILLING PRIVATO — receipt preference + readonly/form
   ===================================================== */

/* Allineamento verticale label nella riga documento fiscale */
.wc-br-receipt-row {
    align-items: center;
}

.wc-br-receipt-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    gap: 0.6em;
}

.wc-br-receipt-label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

.wc-br-receipt-select {
    padding: 0.4em 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
    cursor: pointer;
    width: auto;
    max-width: 160px;
    flex-shrink: 0;
}

#wc-br-privato-edit-form .wc-br-box {
    margin-top: 0;
}

/* Spazio tra Salva dati e Annulla nel form privato */
#wc-br-privato-edit-cancel {
    margin-left: 0.5em;
}

/* ── Tabella dati fatturazione nella pagina indirizzi ────────────────────── */
.wc-br-addr-table {
    border-collapse: collapse;
    width: 100%;
}

.wc-br-addr-label {
    font-weight: normal;
    color: #757575;
    white-space: nowrap;
    padding-right: 1em;
    padding-bottom: 2px;
    text-align: left;
    vertical-align: top;
}

.wc-br-addr-value {
    padding-bottom: 2px;
    text-align: left;
    vertical-align: top;
}

/* ── Inline-style replacements ─────────────────────────────────────────── */
.wc-br-box-actions { margin-bottom: 1em; }
#wc-br-copy-message { margin-left: 8px; font-size: .9em; }
