/* ============================================================
   BOXIN PUBLIC CSS — My Account portal + general styles
   ============================================================ */

/* ── Fix: Keep WC My Account sidebar when on Boxin endpoint ── */
.woocommerce-account .woocommerce-MyAccount-navigation {
    display: block !important;
}
.woocommerce-account .woocommerce-MyAccount-content {
    display: block !important;
}

/* ── Portal container ── */
.boxin-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    max-width: 860px;
    color: #1a1a1a;
}

/* ── Section header ── */
.boxin-portal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #8B0000;
}
.boxin-portal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
}

/* ── Contract card ── */
.boxin-contract-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #8B0000;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* ── Card header ── */
.boxin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.boxin-unit-badge {
    background: #8B0000;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    padding: 8px 18px;
    border-radius: 6px;
    letter-spacing: .5px;
}
.boxin-contract-status {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Details grid ── */
.boxin-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-bottom: 18px;
}
.boxin-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.boxin-detail .label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}
.boxin-detail .value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

/* ── Overdue alert ── */
.boxin-overdue-alert {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    color: #b71c1c;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Buttons ── */
.boxin-card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.boxin-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.boxin-btn-secondary:hover { background: #eee; }
.boxin-btn-danger {
    background: #8B0000;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background .15s;
}
.boxin-btn-danger:hover { background: #6b0000; }
.boxin-pay-btn {
    background: #8B0000;
    color: #fff;
    padding: 8px 18px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.boxin-pay-btn:hover { background: #6b0000; color: #fff; text-decoration: none; }
.boxin-pay-btn-sm {
    background: #8B0000;
    color: #fff;
    padding: 5px 14px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.boxin-dl-btn {
    color: #8B0000;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #8B0000;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* ── Termination form ── */
.boxin-termination-form {
    background: #fff8f0;
    border: 1px solid #ffe0b2;
    padding: 20px;
    border-radius: 8px;
    margin-top: 16px;
}
.boxin-termination-form h4 { margin: 0 0 12px 0; font-size: 15px; color: #333; }
.boxin-form-group { margin-bottom: 14px; }
.boxin-form-group label { display: block; font-size: 13px; margin-bottom: 5px; font-weight: 600; color: #555; }
.boxin-form-group textarea { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }

/* ── No contract ── */
.boxin-no-contract {
    text-align: center;
    padding: 48px 24px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}
.boxin-no-contract p { font-size: 16px; color: #666; margin-bottom: 16px; }

/* ── Invoices table ── */
.boxin-invoices-section { margin-top: 32px; }
.boxin-invoices-section h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #8B0000;
    color: #1a1a1a;
}
.boxin-invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.boxin-invoice-table th {
    background: #8B0000;
    color: #fff;
    padding: 11px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}
.boxin-invoice-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.boxin-invoice-table tr:last-child td { border-bottom: none; }
.boxin-invoice-table tr:hover td { background: #fafafa; }

/* Status badges */
.boxin-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.status-paid       { background: #e8f5e9; color: #1b5e20; }
.status-pending    { background: #fff3e0; color: #e65100; }
.status-overdue    { background: #ffebee; color: #b71c1c; }
.status-cancelled  { background: #f5f5f5; color: #666; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .boxin-details-grid { grid-template-columns: 1fr; }
    .boxin-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .boxin-invoice-table { font-size: 12px; }
    .boxin-invoice-table th, .boxin-invoice-table td { padding: 8px 10px; }
}

/* ── Reservation widget — billing choice ── */
.boxin-payment-choice { margin-bottom: 22px; }
.boxin-payment-choice h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #888; margin: 0 0 10px; }
.boxin-payment-option {
    display: flex; align-items: center; gap: 12px;
    border: 2px solid #e8e8e8; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
    transition: border-color .18s, box-shadow .18s, background .18s;
    background: #fff;
}
.boxin-payment-option:hover { border-color: #c0392b; background: #fdf5f5; }
.boxin-payment-option:has(input:checked) {
    border-color: #c0392b;
    background: linear-gradient(135deg, #fdf5f5 0%, #fff 100%);
    box-shadow: 0 2px 10px rgba(192, 57, 43, .12);
}
/* Custom radio */
.boxin-payment-option input[type="radio"] {
    -webkit-appearance: none; appearance: none;
    flex-shrink: 0; width: 18px; height: 18px;
    border: 2px solid #ccc; border-radius: 50%;
    background: #fff; cursor: pointer; transition: border-color .15s;
}
.boxin-payment-option input[type="radio"]:checked {
    border-color: #c0392b;
    background: #c0392b;
    box-shadow: inset 0 0 0 3px #fff;
}
/* Icon */
.boxin-payment-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
/* Text block */
.boxin-payment-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.boxin-payment-text strong { display: block; font-size: 14px; font-weight: 700; color: #1a1a1a; line-height: 1.3; }
.boxin-payment-text small { display: block; font-size: 12px; color: #666; line-height: 1.4; }
/* Error */
.boxin-billing-error { font-size: 13px; font-weight: 600; color: #c62828; background: #ffebee; border: 1px solid #ef9a9a; border-radius: 6px; padding: 8px 12px; margin: 6px 0 0; }
/* Exact size label in reservation widget */
.boxin-exact-size { font-size: 13px; color: #555; margin: 0 0 6px; }
.boxin-exact-size strong { color: #1a1a1a; }
