/* --- NEW STYLES FOR REDESIGN --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ky-bg-color: #F9FAFB;
    --ky-card-bg: #FFFFFF;
    --ky-primary-text: #111827;
    --ky-secondary-text: #6B7280;
    --ky-border-color: #E5E7EB;
    --ky-accent-color: #000; /* Your original black accent */
    --ky-font-family: 'Inter', sans-serif;
}

/* --- Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base styles for the page */
.pfc-container {
    background-color: var(--ky-bg-color);
    font-family: var(--ky-font-family);
    color: var(--ky-primary-text);
    padding: 1rem;
    margin-top: 1rem !important;
}

@media (min-width: 768px) {
    .pfc-container {
        padding: 2rem;
        margin-top: 3rem !important;
    }
}

/* --- Main Layout --- */
.ky-new-checkout-container {
    max-width: 900px; /* Controls the width of the whole component */
    margin: 0 auto;
    padding-block: 100px;
}

.ky-new-checkout-container h1 {
    font-size: 2.25rem; /* 36px */
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.ky-checkout-card-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 24px */
}

.ky-checkout-card {
    background-color: var(--ky-card-bg);
    border: 1px solid var(--ky-border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden; /* Ensures borders are clean */
}

.ky-card-header {
    padding: .5rem 1rem; /* 20px 24px */
    border-bottom: 1px solid var(--ky-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ky-card-header h2 {
    font-size: 2rem; /* 18px */
    font-weight: 600;
}

.ky-item-count {
    font-size: 1rem; /* 14px */
    color: var(--ky-secondary-text);
}

.ky-card-body {
    padding: 1.5rem; /* 24px */
}

/* --- 1. Order Summary Card --- */
.loading-state {
    color: var(--ky-secondary-text);
    padding: 1rem 0;
    text-align: center;
}
.ky-summary-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
}
.ky-summary-item:first-child { padding-top: 0; }
.ky-summary-item:last-child { padding-bottom: 0; }

.ky-summary-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 1px solid var(--ky-border-color);
    object-fit: cover;
    margin-right: 1rem;
}

.ky-summary-item-info {
    flex-grow: 1;
}
.ky-summary-item-info .item-name {
    font-weight: 500;
    display: block;
    color: var(--ky-primary-text);
    font-size: 1.2rem;
}
.ky-summary-item-info .item-details {
    font-size: 0.875rem;
    color: var(--ky-secondary-text);
    line-height: 1.4;
    margin-top: 2px;
}
/* Styles for addons/combos */
.item-details .detail-line {
    display: block;
    font-size: 0.8em;
    color: var(--ky-secondary-text);
}

.ky-summary-item-price {
    font-weight: 600;
    font-size: 0.95rem;
}

#ky-new-summary-items-list {
    border-bottom: 1px solid var(--ky-border-color);
}

.ky-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem; /* 14.4px */
    margin-bottom: 0.75rem;
    color: var(--ky-secondary-text);
}
.ky-summary-total-row.grand-total {
    font-size: 1.4rem; /* 16px */
    font-weight: 600;
    color: var(--ky-primary-text);
    margin-top: 1rem;
}
.ky-summary-total-row .value {
    font-weight: 500;
    color: var(--ky-primary-text);
}
.ky-summary-total-row.grand-total .value {
    font-weight: 600;
}

/* --- 2. Discount Code Card --- */
#coupon-section .coupon-field {
    display: flex;
    gap: 0.75rem; /* 12px */
}
#coupon-section input[type="text"] {
    flex-grow: 1;
    border: 1px solid var(--ky-border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--ky-font-family);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#coupon-section input[type="text"]:focus {
    outline: none;
    border-color: var(--ky-accent-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}
#coupon-section .apply-btn {
    padding: 0.75rem 1.25rem;
    background-color: #2D3748; /* Dark gray, matching image */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
#coupon-section .apply-btn:hover {
    background-color: #1A202C;
}
#applied-coupon-display {
    display: none; /* JS will show this */
    padding: 10px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-top: 1rem;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}
#applied-coupon-display #remove-coupon-btn {
    background: none;
    border: none;
    color: #EF4444; /* Red */
    cursor: pointer;
    font-size: 1rem;
}


/* --- 3. Payment Details Card (Your old styles, adapted) --- */

/* Radio Buttons */
.payment-options {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.payment-option {
    position: relative;
    flex-grow: 1; /* Makes them share space */
}
.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.payment-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #fff;
    border: 2px solid var(--ky-border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}
.payment-label:hover {
    border-color: var(--ky-accent-color);
}
.payment-option input[type="radio"]:checked + .payment-label {
    border-color: var(--ky-accent-color);
    background: #f5f5f5;
}
.payment-option input[type="radio"]:checked + .payment-label .payment-text {
    color: var(--ky-accent-color);
    font-weight: 600;
}
.payment-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    transition: color 0.3s ease;
}

/* Stripe Container */
.payment-container {
    margin: 0;
    padding: 0;
}
#payment-element {
    margin: 0;
}
.payment-message {
    color: rgb(105, 115, 134);
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 12px;
    text-align: center;
    margin-top: 1rem;
    background: #f6f9fc;
    border-radius: 4px;
}

/* Ryft Container */
.Ryft--paysection {
    margin-top: 0;
}
.Ryft--paysection .card-details {
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}
.Ryft--payform {
    border: 1px solid var(--ky-border-color);
    padding: 15px;
    border-radius: 8px;
}
#pay-btn {
    width: 100%;
    background-color: var(--ky-accent-color) !important;
    border: 1px solid var(--ky-accent-color) !important;
    color: #fff;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
#pay-btn:hover {
    opacity: 0.85;
}
#pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#ryft-pay-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 10px;
}

/* Adyen Container */
#dropin-container {
    /* Adyen styles are mostly self-contained */
}

/* --- Old styles to remove (from .pfc-container) --- */
.page-header, .cartContainer {
    display: none;
}
/* --- Styling for Back Button --- */
.ky-card-header-actions {
    display: flex;
    align-items: center;
    /* gap: 12px; */
    flex-direction: column;
}

.ky-back-btn {
    background: none;
    border: 1px solid var(--ky-border-color);
    color: var(--ky-secondary-text);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--ky-font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ky-back-btn:hover,.ky-back-btn:focus
 {
    background-color: var(--ky-bg-color);
    border-color: #ccc;
    color: var(--ky-primary-text);
}

/* --- Styling for Additional Charges Dropdown --- */
.additional-charges-container {
    border-top: 1px solid var(--ky-border-color);
    border-bottom: 1px solid var(--ky-border-color);
    margin: 0.5rem 0;
}

.additional-charges-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    cursor: pointer;
    user-select: none;
}

.additional-charges-toggle .label {
    color: var(--ky-primary-text);
    font-size: 0.9rem;
}

.additional-charges-toggle .fa-chevron-down {
    transition: transform 0.3s ease-in-out;
    color: var(--ky-secondary-text);
    font-size: 0.8rem;
}

.additional-charges-container.open .fa-chevron-down {
    transform: rotate(180deg);
}

.additional-charges-list {
    padding-bottom: 0.5rem;
}

/* Tweak row styles inside the dropdown */
.additional-charges-list .ky-summary-total-row {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
/* --- View Summary Button --- */
.ky-view-summary-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ky-accent-color);
    background-color: transparent;
    border: 1px solid var(--ky-border-color);
    border-radius: 8px;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}
.ky-view-summary-btn:hover,.ky-view-summary-btn:focus {
    background-color: var(--ky-bg-color);
    color: #000;
}
.ky-view-summary-btn .fa-receipt {
    margin-right: 8px;
}

/* --- New Summary Item (No Image) --- */
.ky-summary-item-no-img {
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--ky-border-color);
}
.ky-summary-item-no-img:first-child { 
    padding-top: 0; 
}
.ky-summary-item-no-img:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.ky-summary-item-no-img .ky-summary-item-info {
    flex-grow: 1;
}
.ky-summary-item-no-img .item-name {
    font-weight: 500;
    display: block;
    color: var(--ky-primary-text);
    font-size: 1.4rem;
}
.ky-summary-item-no-img .item-details {
    font-size: 1.2rem;
    color: var(--ky-secondary-text);
    line-height: 1.4;
    margin-top: 2px;
}
.ky-summary-item-no-img .ky-summary-item-price {
    font-weight: 600;
    font-size: 1.2rem;
    padding-left: 10px;
}

#ky-new-summary-items-list {
    /* max-height: 250px;  */
    overflow-y: auto;
    border-radius: 12px;
    border-bottom: none;
    border: 1px solid var(--ky-border-color);
    padding: 1rem 1rem 1rem 1rem;
}

.ky-summary-scroll-wrapper {
    position: relative; /* Key for positioning the icon */
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ky-border-color);
    margin-bottom: 1.5rem; /* Replaces the list's margin */
}

#ky-scroll-indicator {
    position: absolute;
    bottom: 25px; /* Sits just above the bottom border */
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid var(--ky-border-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--ky-secondary-text);
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    pointer-events: none; /* So it doesn't block scrolling */
}


/* --- Summary Modal Styles --- */
.ky-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ky-modal-content {
    background: var(--ky-card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ky-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ky-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ky-modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.ky-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--ky-secondary-text);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.ky-modal-close:hover {
    color: var(--ky-primary-text);
    background-color: transparent;
}

.ky-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.ky-modal-footer {
    padding: 1.5rem;
    background: var(--ky-bg-color);
    border-top: 1px solid var(--ky-border-color);
}

/* Use original item styles inside modal */
.ky-modal-body .ky-summary-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--ky-border-color);
}
.ky-modal-body .ky-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (max-width: 650px) {
    .ky-new-checkout-container{
        margin-inline:20px;
    }

}
  /* … */


/* Order Meta Info Container */
.ky-order-meta-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Badge for Order Type (Delivery/Collection) */
.ky-order-type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    width: fit-content;
}

.ky-order-type-badge.delivery {
    background-color: #e3f2fd; /* Light Blue */
    color: #0d47a1;
}

.ky-order-type-badge.collection {
    background-color: #e8f5e9; /* Light Green */
    color: #1b5e20;
}

/* Meta Rows (Time, Address, etc.) */
.ky-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    color: #555;
    align-items: flex-start;
}

.ky-meta-label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ky-meta-value {
    text-align: right;
    font-weight: 600;
    color: #000;
    max-width: 60%;
}
div#ky-new-summary-totals-list {
    padding-inline: 10px;
}

button.swal2-confirm.swal2-styled,button.swal2-cancel.swal2-styled{
    border: 1px solid #000;
    color: #000;
}
button.swal2-confirm.swal2-styled:hover,button.swal2-confirm.swal2-styled:focus,button.swal2-cancel.swal2-styled:hover,button.swal2-cancel.swal2-styled:focus{
    border: 1px solid var(--ky-accent-color);
    color: var(--ky-bg-color);
    background-color: var(--ky-accent-color);
}
.ProductSummary.is-condensed .ProductSummary-totalAmountContainer{
    justify-content: center !important;

}

/* --- New Styles to Display Item Image in Main Summary --- */

/* Base container for an item with an image */
.ky-summary-item-with-img {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color-light);
    gap: 15px; /* Space between image and text */
}

/* Style for the image thumbnail */
.ky-summary-item-with-img .item-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover; /* Ensures the image covers the box */
    flex-shrink: 0; /* Prevents the image from shrinking */
}

/* Adjustment for the item information wrapper */
.ky-summary-item-with-img .ky-summary-item-info {
    flex-grow: 1; /* Allows the info to take up available space */
    text-align: left;
}

/* Ensure the price is aligned to the right */
.ky-summary-item-with-img .ky-summary-item-price {
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0; /* Prevents the price from shrinking */
    font-size: 1.2rem;
}

/* Cleanup for the legacy no-image element (optional, but good practice) */
.ky-summary-item-no-img {
    display: flex; /* Keep the old style just in case it's used elsewhere */
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color-light);
}

/* Adjust the original item details for spacing */
.ky-summary-item-with-img .item-details {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* --- New Styles to Display Item Image in Main Summary --- */

/* Base container for an item with an image */
.ky-summary-item-with-img {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color-light);
    gap: 15px; /* Space between image and text */
}

/* Style for the image thumbnail */
.ky-summary-item-with-img .item-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover; /* Ensures the image covers the box */
    flex-shrink: 0; /* Prevents the image from shrinking */
}

/* Adjustment for the item information wrapper */
.ky-summary-item-with-img .ky-summary-item-info {
    flex-grow: 1; /* Allows the info to take up available space */
    text-align: left;
}

/* Ensure the price is aligned to the right */
.ky-summary-item-with-img .ky-summary-item-price {
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0; /* Prevents the price from shrinking */
    font-size: 1.2rem;
}

/* Cleanup for the legacy no-image element (optional, but good practice) */
.ky-summary-item-no-img {
    display: flex; /* Keep the old style just in case it's used elsewhere */
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color-light);
}

/* Adjust the original item details for spacing */
.ky-summary-item-with-img .item-details {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 5px;
}


/* --- MOBILE RESPONSIVE FIXES --- */

/* 1. Tablet & Mobile Global Adjustments (Max Width 768px) */
@media (max-width: 768px) {
    
    /* Fix container spacing */
    .pfc-container {
        padding: 1rem 0.5rem !important;
        margin-top: 1rem !important;
    }

    .ky-new-checkout-container {
        padding-block:60px 30px !important; /* Reduced from 100px */
        margin-inline: 10px;
        width: auto;
    }

    /* Smaller main heading */
    .ky-new-checkout-container h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    /* Card adjustments */
    .ky-card-body {
        padding: 1.25rem; /* Slightly reduced padding */
    }

    /* HEADER FIX: Stack the header elements so they don't overlap */
    .ky-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 1.25rem;
    }

    .ky-card-header h2 {
        font-size: 1.3rem; /* Smaller card titles */
        order: 1; /* Keep title at top if desired, or adjust order */
        width: 100%;
        text-align: left;
        margin: 0;
    }

    /* Move buttons to logical places */
    .ky-back-btn {
        order: 0; /* Back button at very top */
        font-size: 0.9rem;
        margin-bottom: 5px;
        padding-left: 0; /* Align with text */
        border: none; /* Cleaner look on mobile */
        color: var(--ky-secondary-text);
    }
    
    .ky-card-header-actions {
        order: 2; /* Actions below title */
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
        padding-top: 10px;
        border-top: 1px dashed var(--ky-border-color);
    }

    /* 2. Order Summary List Items */
    .ky-summary-item-with-img {
        gap: 12px;
    }
    
    .ky-summary-item-with-img .item-thumbnail {
        width: 60px; /* Slightly smaller images */
        height: 60px;
    }

    .ky-summary-item-with-img .item-name {
        font-size: 15px; /* Prevent text wrapping issues */
    }

    .ky-summary-item-with-img .ky-summary-item-price {
        font-size: 1rem;
    }

    /* 3. Coupon Section */
    #coupon-section .coupon-field {
        flex-direction: column; /* Stack input and button */
        gap: 10px;
    }
    
    #coupon-section input[type="text"] {
        width: 100%;
        padding: 12px; /* Larger touch target */
    }
    
    #coupon-section .apply-btn {
        width: 100%; /* Full width button */
        padding: 12px;
    }
    
    #applied-coupon-display {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    /* 4. Payment Options */
    .payment-options {
        flex-direction: column; /* Stack payment methods vertically */
        gap: 8px;
    }
    
    .payment-label {
        justify-content: flex-start; /* Align text to left */
        padding-left: 20px;
    }

    /* 5. Modal Fixes (Full screen on mobile) */
    .ky-modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .ky-modal-body {
        flex-grow: 1; /* Allow body to take available space */
    }
    
    /* 6. General Button Touch Targets */
    button, .payment-label, input {
        min-height: 44px; /* Minimum tappable area standard */
    }
}

/* Extra Small Devices (Phone Portrait) */
@media (max-width: 480px) {
    .ky-summary-item-with-img .item-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .ky-summary-total-row {
        font-size: 1rem;
    }
    
    .ky-summary-total-row.grand-total {
        font-size: 1.2rem;
    }
    .ky-meta-row{
        font-size: 0.8rem;
    }
}

span.elementor-icon-list-text,h2.elementor-heading-title.elementor-size-default,.elementor-element.elementor-element-515f5cfb.elementor-widget.elementor-widget-text-editor {
    color: #fff !important;
}
svg.e-font-icon-svg.e-fab-whatsapp,svg.e-font-icon-svg.e-fab-tiktok,svg.e-font-icon-svg.e-fab-instagram,svg.e-font-icon-svg.e-fas-map-pin,svg.e-font-icon-svg.e-fas-phone-alt,svg.e-font-icon-svg.e-fas-envelope-open {
    fill: #fff !important;
}

@media (max-width: 991.98px) {
    body.page-template-default.page-id-XXX { /* Replace with your checkout page ID or class */
        padding-top: 80px !important; /* Adjust based on your header height */
    }
    
    .pf-main-header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background-color: #ffffff !important; /* Force a color to see if it appears */
        z-index: 9999 !important;
    }
}