/* =============================================================
   WooCommerce Checkout & Cart – MITS Theme Styles
   ============================================================= */

/* ── Error/notice wrapper ────────────────────────────────────── */

.woocommerce-notices-wrapper {
    margin-top: 20px;
}

/* Błędy przy kasie — span na cały grid żeby nie rozwalały 2-kolumnowego layoutu */
.mits-checkout-form .woocommerce-NoticeGroup {
    grid-column: 1 / -1;
}

/* WC renders errors as <ul class="woocommerce-error"><li>…</li></ul> */
ul.woocommerce-error {
    display: block !important; /* main.css ustawia display:flex co powoduje poziome li */
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    overflow: hidden;
}

ul.woocommerce-error li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 18px;
    font-size: 0.9rem;
    color: #991b1b;
    line-height: 1.5;
    border-bottom: 1px solid #fee2e2;
}

ul.woocommerce-error li:last-child {
    border-bottom: none;
}

ul.woocommerce-error li::before {
    content: "⚠";
    flex-shrink: 0;
    font-size: 0.95rem;
    margin-top: 1px;
    color: #ef4444;
}

/* ── Payment methods ─────────────────────────────────────────── */

#payment ul.payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

/* Each payment method row — wrapping flex so payment_box goes below */
#payment ul.payment_methods li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 10px;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
    cursor: pointer;
}

#payment ul.payment_methods li:has(input:checked) {
    border-color: #5B8C5A;
    background: rgba(91, 140, 90, 0.04);
}

/* Radio + label row */
#payment ul.payment_methods li input[type="radio"] {
    flex-shrink: 0;
    accent-color: #5B8C5A;
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 14px 0 14px 14px;
}

#payment ul.payment_methods li label,
.mits-ck-summary .wc_payment_method label {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    padding: 14px 14px 14px 0;
    margin: 0;
    line-height: 1.4;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    gap: 0;
}

/* payment_box — full-width second row */
#payment .payment_box {
    flex: 0 0 100%;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 12px 14px 12px 42px;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    border-radius: 0;
}

#payment .payment_box p {
    margin: 0;
}

/* ── Order details table ─────────────────────────────────────── */

.woocommerce-order-details {
    margin-top: 28px;
}

.woocommerce-order-details__title,
.woocommerce-column__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.woocommerce-table--order-details thead tr {
    background: #f3f4f6;
}

.woocommerce-table--order-details thead th {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-table--order-details thead th:last-child {
    text-align: right;
}

.woocommerce-table--order-details tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.woocommerce-table--order-details tbody td {
    padding: 12px 14px;
    color: #374151;
    vertical-align: middle;
}

.woocommerce-table--order-details tbody td:last-child {
    text-align: right;
    font-weight: 600;
    color: #111827;
}

.woocommerce-table--order-details tbody a {
    color: #5B8C5A;
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-table--order-details tbody a:hover {
    text-decoration: underline;
}

.woocommerce-table--order-details .product-quantity {
    color: #6b7280;
    font-weight: 400;
    margin-left: 4px;
}

.woocommerce-table--order-details tfoot tr {
    border-top: 1px solid #e5e7eb;
}

.woocommerce-table--order-details tfoot th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.woocommerce-table--order-details tfoot td {
    padding: 10px 14px;
    text-align: right;
    font-weight: 600;
    color: #374151;
}

.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    border-top: 2px solid #e5e7eb;
    padding-top: 12px;
}

/* ── Customer details (billing address) ─────────────────────── */

.woocommerce-customer-details {
    margin-top: 24px;
}

.woocommerce-customer-details address {
    font-style: normal;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.7;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
}

.woocommerce-customer-details address p {
    margin: 4px 0 0;
}

.woocommerce-customer-details--phone::before {
    content: "📞 ";
    font-style: normal;
}

.woocommerce-customer-details--email::before {
    content: "✉ ";
    font-style: normal;
}

/* ── #payment — usuń domyślny border WooCommerce ─────────────── */

#payment {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* ── Obowiązkowy checkbox regulaminu ─────────────────────────── */

.mits-terms-row {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.mits-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.mits-terms-label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.mits-terms-label a {
    color: var(--mits-color-primary, #2D6A4F);
    text-decoration: underline;
}

/* ── Newsletter checkbox — ta sama ramka co checkbox regulaminu ── */

.mits-newsletter-checkout {
    margin: 0 0 16px !important;
    padding: 14px 16px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
}

.mits-newsletter-checkout .woocommerce-input-wrapper {
    display: block;
}

.mits-newsletter-checkout label.checkbox {
    display: block;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    font-weight: normal;
    margin: 0;
    padding-left: 26px;
    position: relative;
}

.mits-newsletter-checkout label.checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
