/* ==========================================================
   GFD DELIVERY DATE + TIMESLOT STYLES
   File: assets/css/delivery.css
   ========================================================== */

/* ---------------------------
   Header Top Bar Date Picker
---------------------------- */
.gfd-topbar-datepicker {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: medium;
    font-weight: 500;
}

.gfd-topbar-datepicker label {
    color: red;
    white-space: nowrap;
}

.gfd-topbar-datepicker input.gfd_delivery_date {
    width: 120px;
    padding: 3px 6px;
    margin-top: 4%;
    color: black;
    font-size: medium;
    cursor: pointer;
}


/* ---------------------------
   Checkout Wrapper (Section box)
---------------------------- */
.gfd-checkout-delivery-wrapper {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-top: 15px;
    background: #fafafa;
}

.gfd-checkout-delivery-wrapper h3.gfd-delivery-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}


/* ---------------------------
   Cart & Checkout: Date + Slot Layout
---------------------------- */
.gfd-cart-delivery-wrapper,
.gfd-checkout-delivery-wrapper {
    width: 100%;
    display: block;
}

/* Date + slot should be inline, side-by-side */
.gfd-cart-delivery-wrapper p,
.gfd-checkout-delivery-wrapper p {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-right: 16px;
    margin-bottom: 10px;
    font-size: medium;
    font-weight: 500;
}

/* Label styling */
.gfd-cart-delivery-wrapper label,
.gfd-checkout-delivery-wrapper label {
    color: blue;
    white-space: nowrap;
}

/* Delivery date input */
.gfd-cart-delivery-wrapper input.gfd_delivery_date,
.gfd-checkout-delivery-wrapper input.gfd_delivery_date {
    width: 120px;
    padding: 3px 6px;
    margin-top: 4%;
    font-size: medium !important;
    color: black;
    cursor: pointer;
}

/* Timeslot dropdown */
.gfd-cart-delivery-wrapper select.gfd_delivery_slot,
.gfd-checkout-delivery-wrapper select.gfd_delivery_slot {
    width: 180px;
    padding: 13px 11px;
    margin-top: 4%;
    font-size: medium;
    color: black;
    border-color: lightgrey;
    background: #fff;
}


/* ---------------------------
   CART Fix: force delivery to next line under coupon/update buttons
---------------------------- */
/* Force delivery section to new row in cart actions */
.woocommerce-cart td.actions .gfd-cart-delivery-wrapper {
    display: block;
    clear: both;
    margin-top: 15px;
}


/* ---------------------------
   Mobile fallback
---------------------------- */
@media (max-width: 768px) {

    .gfd-cart-delivery-wrapper p,
    .gfd-checkout-delivery-wrapper p {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-right: 0;
    }

    .gfd-cart-delivery-wrapper input.gfd_delivery_date,
    .gfd-cart-delivery-wrapper select.gfd_delivery_slot,
    .gfd-checkout-delivery-wrapper input.gfd_delivery_date,
    .gfd-checkout-delivery-wrapper select.gfd_delivery_slot {
        width: 100%;
        margin-top: 6px;
    }
}

/* GFD Branded Datepicker Container */
.ui-datepicker {
    width: 300px;
    padding: 0;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff !important; /* Ensure solid background */
    opacity: 1 !important; /* Remove any potential opacity */
}

/* Header Background (GFD Green) */
.ui-datepicker-header {
    background-color: #4CAF50 !important; 
    color: #ffffff !important;
    border: none !important;
    padding: 12px 0 !important;
    border-radius: 0;
    opacity: 1 !important;
}

/* Day Headers */
.ui-datepicker th {
    color: #444;
    font-weight: 600;
    padding: 12px 0;
    background: #f9f9f9;
}

/* Default Day Cells (Enabled) */
.ui-state-default, 
.ui-widget-content .ui-state-default {
    background: #ffffff !important; /* Solid white background */
    border: none !important;
    text-align: center !important;
    color: #333 !important;
    padding: 10px !important;
    border-radius: 4px; /* Slightly rounded for a modern look */
    opacity: 1 !important;
    display: block;
}

/* Hover Effect */
.ui-state-hover {
    background: #e8f5e9 !important; 
    color: #4CAF50 !important;
    cursor: pointer;
}

/* Active/Selected Day */
.ui-state-active, 
.ui-widget-content .ui-state-active {
    background-color: #4CAF50 !important; 
    color: #ffffff !important;
    font-weight: bold !important;
}

/* ✅ FIX: Visible Disabled Dates (Holidays/Past Dates) */
.ui-state-disabled, 
.ui-widget-content .ui-state-disabled {
    opacity: 1 !important; /* Force full visibility */
    background: #eeeeee !important; /* Solid light grey background */
}

.ui-state-disabled span,
.ui-state-disabled .ui-state-default {
    color: #999999 !important; /* Distinct grey text */
    background: #eeeeee !important;
    text-decoration: none !important;
    cursor: default !important;
}

/* Highlight Today */
.ui-datepicker-today .ui-state-highlight {
    border: 2px solid #4CAF50 !important;
    color: #4CAF50 !important;
    background: #ffffff !important;
}

/* Styling for Disabled Holiday Dates */
.gfd-holiday-disabled span.ui-state-default {
    background: #ffebee !important; /* Soft red background */
    color: #ef5350 !important;    /* Red text color */
    cursor: not-allowed !important;
    position: relative;
}

/* Optional: Show "Operation Closed" on hover using a pseudo-element if browser tooltips are too slow */
.gfd-holiday-disabled:hover::after {
    content: "Operation Closed";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
}

/* Target the cell specifically when the holiday class is present */
.ui-datepicker td.gfd-holiday-cell {
    background: #ffebee !important; /* Solid Light Red */
}

/* Target the link/span inside that cell */
.ui-datepicker td.gfd-holiday-cell .ui-state-default {
    background: #ffebee !important; 
    color: #d32f2f !important;
    border: 1px solid #ffcdd2 !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    display: block !important;
}

.gfd-slot-warning {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GFD Custom Branding for WooCommerce Error Notices */
.woocommerce-notices-wrapper .woocommerce-error {
    background-color: #fff5f5 !important; /* Soft petal pink background */
    border-top: 3px solid #e53e3e !important; /* Elegant deep red top border */
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: #c53030 !important; /* Deep readable red for text */
    padding: 20px 25px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    list-style: none !important;
    margin: 20px 0 !important;
    font-family: 'Poppins', sans-serif; /* Matching GFD branding */
}

/* Customizing the list item and icon */
.woocommerce-notices-wrapper .woocommerce-error li {
    padding-left: 30px !important;
    position: relative;
    line-height: 1.6 !important;
    font-weight: 500 !important;
}

/* Adding a custom icon (Floral/Info style) before the message */
.woocommerce-notices-wrapper .woocommerce-error li::before {
    /* Use the forward slash for CSS Unicode */
    content: "🌸"; 
    position: absolute;
    left: 0;
    top: 2px; /* Adjust based on your line-height */
    color: #e53e3e;
    font-size: 20px;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    font-weight: 400;
}

/* Bolding product names within the notice if they are quoted */
.woocommerce-notices-wrapper .woocommerce-error li strong,
.woocommerce-notices-wrapper .woocommerce-error li b {
    color: #2d3748 !important;
}