/**
 * Cozyland — Single-Page Checkout Styles
 *
 * Matches existing cozyland design language:
 * - Browns: #453221 (text/buttons), #815936 (accents), #352B20 (dark)
 * - Beiges: #F8EADD, #F1E1D3, #FCFBF6
 * - Font: Montserrat (loaded via Google Fonts in header.php)
 */

/* ============================================================
   Shipping Forms Container
   ============================================================ */
.cozyland-checkout-forms {
    margin-top: 30px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
}

.cozyland-shipping-form {
    display: none;
}

.cozyland-shipping-form.active {
    display: block;
}

.cozyland-shipping-form h3 {
    color: #453221;
    font-family: Montserrat, sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #D4C5B5;
}

/* ============================================================
   Form Fields (matching existing WC style)
   ============================================================ */
.cozyland-shipping-form .form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    width: 100%;
}

.cozyland-shipping-form .form-row label {
    color: #453221;
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.cozyland-shipping-form .form-row input[type="text"],
.cozyland-shipping-form .form-row input[type="email"],
.cozyland-shipping-form .form-row input[type="tel"],
.cozyland-shipping-form .form-row input[type="number"] {
    background: transparent;
    border: none;
    border-bottom: 2px solid #453221;
    padding: 10px 0;
    font-size: 16px;
    font-family: Montserrat, sans-serif;
    color: #352B20;
    outline: none;
    transition: border-color 0.3s;
}

.cozyland-shipping-form .form-row input:focus {
    border-bottom-color: #815936;
}

/* ============================================================
   InPost Paczkomat Map
   ============================================================ */
.paczkomat-map-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
}

.paczkomat-map-container iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 10px;
}

.paczkomat-selected {
    margin-top: 10px;
    padding: 12px 15px;
    background: #E8F5E9;
    border-radius: 8px;
    color: #2E7D32;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.paczkomat-selected.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paczkomat-selected::before {
    content: '✓';
    font-weight: bold;
    font-size: 18px;
}

/* ============================================================
   Invoice (Faktura) Section
   ============================================================ */
.invoice-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #D4C5B5;
}

.invoice-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.invoice-checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #815936;
    cursor: pointer;
}

.invoice-checkbox-row label {
    color: #453221;
    font-family: Montserrat, sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

#invoice-fields {
    display: none;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

#nip-spinner {
    display: none;
    margin-left: 10px;
    color: #815936;
}

.nip-company-info {
    margin-top: 10px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #E0D5C8;
    font-size: 14px;
    color: #352B20;
}

.nip-company-info p {
    margin: 3px 0;
    line-height: 1.5;
}

.error-msg {
    color: #D32F2F;
    font-size: 13px;
    margin-top: 8px;
}

/* ============================================================
   Payment Methods Section
   ============================================================ */
.payment-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #D4C5B5;
}

.payment-section h3 {
    color: #453221;
    font-family: Montserrat, sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* BLIK — primary, prominent */
.blik-payment {
    background: linear-gradient(135deg, #FF6B00, #FF8F00);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 15px;
    text-align: center;
}

.blik-payment .blik-label {
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
}

.blik-payment .blik-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-bottom: 15px;
}

.blik-payment .blik-pay-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 15px auto 0;
    padding: 15px 30px;
    background: #fff;
    color: #FF6B00;
    font-family: Montserrat, sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.blik-payment .blik-pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.blik-payment .blik-pay-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* P24 — secondary */
.p24-payment {
    text-align: center;
    padding: 15px;
}

.p24-payment .p24-link {
    display: inline-block;
    padding: 12px 30px;
    background: #453221;
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s;
}

.p24-payment .p24-link:hover {
    background: #352B20;
    transform: translateY(-1px);
}

/* ============================================================
   COD Button
   ============================================================ */
.cod-order-section {
    margin-top: 25px;
    text-align: center;
}

.cod-order-button {
    display: inline-block;
    width: 100%;
    max-width: 400px;
    padding: 18px 30px;
    background: #453221;
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.cod-order-button:hover {
    background: #352B20;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(69, 50, 33, 0.3);
}

.cod-order-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   Error messages
   ============================================================ */
.checkout-errors {
    display: none;
    margin-bottom: 20px;
    padding: 15px;
    background: #FFF3F3;
    border: 1px solid #FFCDD2;
    border-radius: 10px;
}

.checkout-error {
    color: #D32F2F;
    font-size: 14px;
    padding: 5px 0;
}

.checkout-error::before {
    content: '⚠ ';
}

/* ============================================================
   Loading state
   ============================================================ */
button.loading {
    position: relative;
    color: transparent !important;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media screen and (max-width: 768px) {
    .cozyland-checkout-forms {
        padding: 20px;
    }

    .cozyland-shipping-form h3 {
        font-size: 18px;
    }

    .blik-payment {
        padding: 20px 15px;
    }

    .blik-payment input#blik-code {
        width: 150px;
        font-size: 24px;
        letter-spacing: 6px;
    }

    .blik-payment .blik-label {
        font-size: 17px;
    }

    .cod-order-button,
    .blik-payment .blik-pay-button {
        font-size: 15px;
        padding: 14px 20px;
    }

    .paczkomat-map-container iframe {
        height: 300px;
    }
}
