/* File: css/custom-date-picker-style.css */

/* Swiper Container Styles */
.swiper-container {
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.swiper-slide {
    text-align: center;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0 !important;
    width: auto; /* Allow slides to size based on content */
    height: auto;
}

/* Add margin between datepicker labels */
#delivery-options .datepicker-label {
    margin: 0 10px;
}

/* Position Navigation Arrows Inside the Swiper Container */
#delivery-options {
    position: relative; /* To position arrows relative to this container */
}

#delivery-options .swiper-button-prev,
#delivery-options .swiper-button-next {
    position: absolute;
    top: auto !important;
    width: 60px;
    height: 100%;
    padding: 0;
    z-index: 1000;
    cursor: pointer;
    color: #000;
    background: white;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 0 !important;
}

/* Positioning Arrows Inside */
#delivery-options .swiper-button-prev {
    left: 0px; /* Adjust this value to position the arrow inside */
}

#delivery-options .swiper-button-next {
    right: 0px; /* Adjust this value to position the arrow inside */
}

#delivery-options .swiper-button-prev::after,
#delivery-options .swiper-button-next::after {
    font-size: 22px;
    font-weight: 900;
    -webkit-text-stroke-width: 1px;
    color: #000;
    /* If using font icons, ensure they are correctly set here */
}

/* Datepicker Labels */
#delivery-options .datepicker-label {
    display: flex;
    flex-direction: column;
    padding: 12px 0px;
    border-radius: 10px;
    line-height: 1.2;
    width: 66px; /* Fixed width for each datepicker label */
    cursor: pointer;
    transition: all 0.3s ease 0s;
    font-size: 14px;
}

div#delivery-options .swiper-slide.date-slide {
    width: auto;
}

#delivery-options .swiper-slide.selected span.datepicker-label {
    background: var(--e-global-color-secondary);
}

#delivery-options .swiper-slide:not(.selected):not(.blocked) .datepicker-label:hover {
    background: var(--e-global-color-secondary);
}

#delivery-options .swiper-slide.blocked .datepicker-label {
    background: transparent;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Disabled Add to Cart Button */
.add_to_cart_button.disabled-add-to-cart,
.single_add_to_cart_button.disabled-add-to-cart,
.add-to-cart.disabled-add-to-cart,
.ajax-add-to-cart.disabled-add-to-cart,
form.cart .button.disabled-add-to-cart {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative; /* For tooltip positioning */
}

/* Tooltip for Disabled Buttons */
.add_to_cart_button.disabled-add-to-cart:hover::after,
.single_add_to_cart_button.disabled-add-to-cart:hover::after,
.add-to-cart.disabled-add-to-cart:hover::after,
.ajax-add-to-cart.disabled-add-to-cart:hover::after,
form.cart .button.disabled-add-to-cart:hover::after {
    content: attr(title);
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    z-index: 1001; /* Ensure tooltip is above arrows */
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.add_to_cart_button.disabled-add-to-cart:hover::before,
.single_add_to_cart_button.disabled-add-to-cart:hover::before,
.add-to-cart.disabled-add-to-cart:hover::before,
.ajax-add-to-cart.disabled-add-to-cart:hover::before,
form.cart .button.disabled-add-to-cart:hover::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.75) transparent;
    z-index: 1001; /* Ensure tooltip arrow is above arrows */
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Initial and Selected Info Blocks */
div#initial-block, div#selected-info {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

button#modify-selection-button {
    padding: 0;
    height: auto;
    min-height: 0;
    font-size: 18px;
    color: black;
    font-weight: 400;
    background: transparent;
    line-height: 1;
    text-decoration: underline;
}

div#initial-block .texts, div#selected-info .texts {
    display: flex;
    gap: 7px;
    flex-direction: column;
}

div#date-availability-block .texts p {
    margin: 0;
    line-height: 1;
}

p#secondary-message {
    font-size: 80%;
}

#initial-message {
    font-weight: 700;
}

button#start-order-button {
    border-radius: 30px;
    height: 42px;
    width: 160px;
    padding: 0 10px;
}

span.inner-sob {
/*    font-size: 20px;
    font-family: 'TheYoungTechnay';
    font-weight: 500;
    font-style: italic;
    line-height: 0.9;
    background: #408040;
    height: 33px;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: center;
    justify-content: space-between;
    border-radius: 30px;
    padding: 0 10px;*/
}

i.sob-icon {
    background-image: url(data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2215%22%20viewBox%3D%220%200%2016%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M7.72924%200L10.1001%205.24746L16%205.2806L11.5927%209.09191L13.3834%2014.5515L8.28897%2011.6593L3.49488%2015L4.75313%209.40124L0%206.0053L5.87258%205.43968L7.72924%200Z%22%20fill%3D%22%23F9F1E1%22/%3E%3C/svg%3E);
    display: inline-block;
    width: 15px;
    height: 15px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Delivery Options Modal */
div#delivery-options {
    position: absolute;
    width: 100%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    background: white;
    z-index: 100;
    padding: 60px 40px 40px;
    box-shadow: 0 10px 12px -8px #00000052;
    border-radius: 25px;
    max-width: 555px;
}

div#initial-block.called button#start-order-button {
    /* opacity: 0; */
}

/* Swiper Wrapper Adjustment */
div#delivery-options .swiper-wrapper {
    overflow: visible;
}

/* ======================= */
/* === New Additions === */
/* ======================= */

/* Close Button Styles */
#close-delivery-options-button {
    position: absolute;
    top: 10px; /* Adjusted from 0px for better spacing */
    right: 10px; /* Changed from -10px to 10px to position inside */
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    z-index: 1002; /* Ensure it's above other elements */
}

/* Loader Styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 2000; /* Above all other elements */
    display: none; /* Hidden by default */
    display: flex; /* Make it a flex container for centering */
    align-items: center;
    justify-content: center;
}

#loader .spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #408040;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Container for Delivery Options */
#delivery_type {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 0 5px;
}


/* Base Styles for Delivery and Pickup Options */
.delivery-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 22px;
    min-width: 50%;
    height: 48px;
    border-radius: 50px;
    transition: border 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    background-color: #ECECEC;
    gap: 10px;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.delivery-option:not(.selected):hover {
    background-color: #e0e0e0;
}

.delivery-option input[type="radio"] {
    display: none;
}

/* Icon Styles */
.delivery-option .delivery-icon {
    transition: transform 0.3s, border 0.3s, background-color 0.3s;
    border: 2px solid transparent;
    border-radius: 10px; /* Rounded corners */
    background-color: transparent; /* Ensure background doesn't override label */
}

.delivery-option.selected .delivery-icon {
    filter: brightness(10);
}

/* Selected Delivery Option Styles */
label.delivery-option.selected {
    background: #408040;
    color: white;
}

/* Optional: Add styles for blocked delivery options */
.swiper-slide.blocked .delivery-option {
    opacity: 0.5;
    cursor: not-allowed;
}

.swiper-slide.blocked .delivery-option .delivery-icon {
    pointer-events: none;
    border-color: transparent; /* Remove border from icon */
    background-color: transparent; /* Remove background from icon */
}

/* Focus Styles for Accessibility */
.delivery-option:focus-within {
    outline: 2px solid #408040; /* Green outline on focus */
    outline-offset: 2px;
}

/* Additional styles for selected class if using JS */
.delivery-option .delivery-icon.selected {
    border: 2px solid #408040;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(64, 128, 64, 0.5);
}

/* Body Classes for Delivery Selection */
body.delivery-not-selected .add_to_cart_button,
body.delivery-not-selected .single_add_to_cart_button,
body.delivery-not-selected .add-to-cart,
body.delivery-not-selected .ajax-add-to-cart,
body.delivery-not-selected form.cart .button.select-date-button {
    /* Optional: Additional styling if needed */
}

body.delivery-selected .add_to_cart_button,
body.delivery-selected .single_add_to_cart_button,
body.delivery-selected .add-to-cart,
body.delivery-selected .ajax-add-to-cart,
body.delivery-selected form.cart .button.select-date-button {
    /* Optional: Additional styling if needed */
}

/* Responsive Swiper Adjustments */
@media (max-width: 767px) {
#delivery-options .datepicker-label {
        width: 60px;
        margin: 0 2.5px;		
}	
    .swiper-container {
        width: 100%;
    }

    .swiper-slide {
        width: auto;
        height: auto;
    }
div#delivery-options {
    padding: 60px 15px 30px;
    gap: 5px;
}

    /* Adjust navigation arrows for smaller screens */
    #delivery-options .swiper-button-prev, #delivery-options .swiper-button-next {
        width: 40px;
    }
span.delivery-text {
    font-weight: 600;
    font-size: 16px;
}
label.delivery-option {
    padding: 0 15px;
    gap: 6px;
}	
}

@media (min-width: 768px) and (max-width: 1023px) {
    .swiper-container {
        width: 100%;
    }

    .swiper-slide {
        width: auto;
        height: auto;
    }

    /* Adjust navigation arrows for medium screens */
    #delivery-options .swiper-button-prev,
    #delivery-options .swiper-button-next {
        left: 10px;
        right: 10px;
    }
}

@media (min-width: 1024px) {
    .swiper-container {
        width: 100%;
    }

    .swiper-slide {
        width: auto;
        height: auto;
    }

    /* Adjust navigation arrows for large screens */
    #delivery-options .swiper-button-prev,
    #delivery-options .swiper-button-next {
        left: 15px;
        right: 15px;
    }
}

/* ======================= */
/* === RTL Support === */
/* ======================= */

/* Adjust navigation arrows for RTL */
html[dir="rtl"] #delivery-options .swiper-button-next {
    left: 0px; /* Position 'next' button to the left */
    right: auto;
}

html[dir="rtl"] #delivery-options .swiper-button-prev {
    right: 0px; /* Position 'prev' button to the right */
    left: auto;
}

/* Flip Arrow Icons for RTL */
html[dir="rtl"] #delivery-options .swiper-button-next::after {
    transform: rotate(0deg); /* No rotation needed */
}

html[dir="rtl"] #delivery-options .swiper-button-prev::after {
    transform: rotate(0deg); /* No rotation needed */
}
div#delivery-options #loader {
    z-index: -1;
}