/* Delivery Date Modal Styles */
.wc-delivery-modal {
    display: none;
    position: fixed;
    z-index: 998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.wc-delivery-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: wc-delivery-modal-slide-down 0.3s ease-out;
}

@keyframes wc-delivery-modal-slide-down {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wc-delivery-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-delivery-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.wc-delivery-modal-close {
    color: #999;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wc-delivery-modal-close:hover,
.wc-delivery-modal-close:focus {
    color: #333;
}

.wc-delivery-modal-body {
    padding: 24px;
}

.wc-delivery-date-info {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.wc-delivery-date-range-info {
    margin-bottom: 20px;
}

.wc-delivery-restriction-notice {
    background-color: #f0f7ff;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin: 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.wc-delivery-restriction-notice strong {
    color: #2271b1;
}

.wc-delivery-date-field {
    margin-bottom: 16px;
}

.wc-delivery-date-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wc-delivery-date-picker {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    cursor: pointer;
    background-color: #fff;
}

.wc-delivery-date-picker:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wc-delivery-modal-error {
    background-color: #fcf2f2;
    border-left: 4px solid #dc3232;
    padding: 12px 16px;
    margin-top: 16px;
    border-radius: 4px;
}

.wc-delivery-modal-error p {
    margin: 0;
    color: #dc3232;
    font-size: 14px;
}

.wc-delivery-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.wc-delivery-modal-footer .button {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
    background-color: #f7f7f7;
    color: #333;
}

.wc-delivery-modal-footer .button:hover {
    background-color: #e7e7e7;
}

.wc-delivery-modal-footer .button.alt {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.wc-delivery-modal-footer .button.alt:hover {
    background-color: #135e96;
    border-color: #135e96;
}

.wc-delivery-modal-footer .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Datepicker customization for available/unavailable dates */
.wc-delivery-modal ~ .ui-datepicker,
#ui-datepicker-div {
    z-index: 10000000 !important;
    position: absolute !important;
    box-sizing: border-box !important;
}

.ui-datepicker {
    z-index: 10000000 !important;
    position: absolute !important;
    box-sizing: border-box !important;
}

.ui-datepicker * {
    box-sizing: border-box !important;
}

.ui-datepicker table {
    width: 100% !important;
    margin: 0 !important;
}

.ui-datepicker td,
.ui-datepicker th {
    padding: 0 !important;
}

.ui-datepicker td.wc-delivery-date-available a {
    background-color: #e7f5e7;
    color: #2d5016;
    font-weight: 600;
}

.ui-datepicker td.wc-delivery-date-available a:hover {
    background-color: #d4edd4;
}

.ui-datepicker td.wc-delivery-date-unavailable {
    opacity: 0.4;
}

.ui-datepicker td.wc-delivery-date-unavailable a {
    cursor: not-allowed;
}

/* Delivery Date Notice in Cart/Checkout */
.wc-delivery-date-notice {
    background-color: #f0f7ff;
    border-left: 4px solid #2271b1;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 15px;
}

.wc-delivery-date-notice strong {
    color: #2271b1;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 600px) {
    .wc-delivery-modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .wc-delivery-modal-header {
        padding: 16px 20px;
    }

    .wc-delivery-modal-header h3 {
        font-size: 18px;
    }

    .wc-delivery-modal-body {
        padding: 20px;
    }

    .wc-delivery-modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }

    .wc-delivery-modal-footer .button {
        width: 100%;
    }
}
