/**
 * Custom Checkout Additional Styles
 * These styles supplement the main style.css for the checkout page
 */

/* Full page takeover for checkout */
body.woocommerce-checkout.custom-checkout-layout {
    background: #fff;
}

body.woocommerce-checkout.custom-checkout-layout .site-main,
body.woocommerce-checkout.custom-checkout-layout .entry-content,
body.woocommerce-checkout.custom-checkout-layout .woocommerce {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* Hide WooCommerce default notices container positioning */
body.woocommerce-checkout .woocommerce-notices-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

/* Billing section styling */
.checkout-form-section .woocommerce-billing-fields h3,
.checkout-form-section .woocommerce-shipping-fields h3 {
    display: none;
}

.checkout-form-section #billing_email_field {
    margin-bottom: 25px;
}

.checkout-form-section #billing_email_field label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Payment method styling */
.checkout-form-section .wc_payment_methods {
    margin: 25px 0;
}

.checkout-form-section .wc_payment_method {
    margin-bottom: 12px;
}

.checkout-form-section .wc_payment_method>input[type="radio"] {
    display: none;
}

.checkout-form-section .wc_payment_method>label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.checkout-form-section .wc_payment_method>label:hover {
    border-color: #a78bfa;
    background: #faf5ff;
}

.checkout-form-section .wc_payment_method>input[type="radio"]:checked+label {
    border-color: #7c3aed;
    background: #faf5ff;
}

.checkout-form-section .wc_payment_method .payment_method_title {
    font-weight: 500;
    color: #1f2937;
}

.checkout-form-section .payment_box {
    padding: 20px;
    margin-top: 15px;
    background: #f9fafb;
    border-radius: 10px;
    border: none;
}

/* BLIK specific styling */
.checkout-form-section .payment_method_blik .payment_box,
.checkout-form-section .payment_method_p24_blik .payment_box {
    text-align: center;
}

.blik-code-wrapper {
    margin: 20px 0;
}

.blik-code-wrapper label {
    display: block;
    margin-bottom: 15px;
    font-size: 14px;
    color: #6b7280;
}

.blik-code-wrapper .blik-input-group {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.blik-code-wrapper input.blik-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.blik-code-wrapper input.blik-digit:focus {
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.blik-separator {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: #9ca3af;
    padding: 0 4px;
}

/* Order review section */
.woocommerce-checkout-review-order {
    margin-top: 30px;
}

/* Hide default order table (only the table, not our custom div) */
table.woocommerce-checkout-review-order-table {
    display: none;
}

/* Place order button */
.woocommerce-checkout #place_order {
    width: 100%;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.woocommerce-checkout #place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(124, 58, 237, 0.35);
}

.woocommerce-checkout #place_order:active {
    transform: translateY(0);
}

/* Terms and conditions */
.woocommerce-terms-and-conditions-wrapper {
    margin: 20px 0;
}

.woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-text a {
    color: #7c3aed;
}

/* Form validation states */
.checkout-form-section .woocommerce-invalid input,
.checkout-form-section .woocommerce-invalid select {
    border-color: #ef4444 !important;
}

.checkout-form-section .woocommerce-validated input,
.checkout-form-section .woocommerce-validated select {
    border-color: #22c55e !important;
}

/* Coupon form */
.checkout-coupon-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.checkout-coupon-section .coupon-label {
    font-weight: 600;
    margin-bottom: 15px;
    color: #111827;
    font-size: 15px;
}

.checkout-coupon-section .coupon-input-group {
    display: flex;
    gap: 10px;
}

.checkout-coupon-section input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin: 0;
}

.checkout-coupon-section button {
    padding: 12px 20px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.checkout-coupon-section button:hover {
    background: #333;
    border-color: #333;
}

.checkout-coupon-section button:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

.coupon-message {
    margin-top: 10px;
    font-size: 13px;
}

.coupon-message .coupon-success {
    color: #059669;
}

.coupon-message .coupon-error {
    color: #dc2626;
}

/* Old styles kept for compatibility but overridden largely by above */
.checkout-form-section .checkout_coupon {
    display: block !important;
    /* Hide default WC coupon form if it somehow appears */
}

/* Custom checkbox styling */
.custom-checkbox-group {
    margin-bottom: 15px;
}

.custom-checkbox-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    cursor: pointer;
}

.custom-checkbox-group input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.custom-checkbox-group .checkbox-label a {
    color: #7c3aed;
    text-decoration: underline;
}

/* Security badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
}

.security-badge svg {
    width: 18px;
    height: 18px;
    color: #22c55e;
}

.security-badge strong {
    color: #635bff;
    font-weight: 600;
}

/* Checkout footer */
.checkout-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.checkout-footer .copyright {
    font-size: 13px;
    color: #9ca3af;
}

/* Loading state */
.woocommerce-checkout.processing .checkout-form-section {
    pointer-events: none;
    opacity: 0.6;
}

.woocommerce-checkout.processing .checkout-form-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   REVIEWS STYLES
   ========================================= */
.checkout-product-reviews {
    margin-top: 20px;
    text-align: left;
}

.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    border: 1px solid #228880;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    box-shadow: 0 2px 5px rgba(34, 136, 128, 0.1);
    background: #fff;
    box-sizing: border-box;
    white-space: normal;
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #228880;
    display: block;
}

.review-author {
    display: block;
    font-size: 1.0em;
    color: #228880;
    line-height: 1.2;
}

.review-rating {
    color: #f39c12;
    font-size: 0.9em;
    line-height: 1;
}

.review-content {
    font-style: italic;
    font-size: 0.9em;
    line-height: 1.4;
    color: #333;
}

/* Navigation buttons - hidden on desktop */
.slider-arrow {
    display: none;
}


/* Responsive adjustments */
@media (max-width: 1200px) {
    .checkout-product-section {
        padding: 40px 35px;
    }

    .checkout-form-section {
        padding: 40px 35px;
    }
}

@media (max-width: 968px) {
    .custom-checkout-wrapper {
        flex-direction: column;
    }

    .checkout-product-section {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .checkout-form-section {
        min-width: auto;
    }

    body.woocommerce-checkout .woocommerce-notices-wrapper {
        position: relative;
        top: auto;
        right: auto;
        max-width: 100%;
        padding: 15px;
    }
}

@media (max-width: 768px) {

    /* Mobile Reviews Slider */
    .reviews-slider-wrapper {
        position: relative;
        padding-top: 50px;
        /* Make space for arrows */
    }

    .reviews-container {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
        padding-bottom: 10px;
    }

    .reviews-container::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .review-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }

    .slider-arrow {
        display: flex;
        position: absolute;
        top: 0;
        width: 36px;
        height: 36px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        font-size: 16px;
        color: #374151;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .slider-arrow.prev {
        right: 45px;
        /* Position next to next button */
        left: auto;
    }

    .slider-arrow.next {
        right: 0;
        left: auto;
    }
}


@media (max-width: 600px) {

    .checkout-product-section,
    .checkout-form-section {
        padding: 25px 20px;
    }

    .checkout-product-section .product-title {
        font-size: 22px;
    }

    .checkout-product-section .product-price {
        font-size: 24px;
    }

    .blik-code-wrapper input.blik-digit {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }

    .checkout-form-section input[type="text"],
    .checkout-form-section input[type="email"],
    .checkout-form-section input[type="tel"],
    .checkout-form-section select {
        padding: 12px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

/* Print styles */
@media print {
    .custom-checkout-wrapper {
        display: block;
    }

    .checkout-product-section,
    .checkout-form-section {
        page-break-inside: avoid;
    }
}


.woocommerce form.checkout_coupon {
    width: 100%;
}

.coupon-inputs-wrapper {
    display: flex;
    flex: 1;

}

.woocommerce form.checkout_coupon .button {
    margin-top: 36px;
}