/* Delivery Date Manager - Checkout Styles
 */

/* Animacje dla pól wielorodzinnych */
.ddm-multibuilding-field {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 200px;
    margin-bottom: 20px;
    transform: translateY(0);
}

.ddm-multibuilding-field.ddm-hiding {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    transform: translateY(-10px);
}

/* Animacja wejścia z efektem bounce */
@keyframes slideInBounce {
    0% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        transform: translateY(-15px) scale(0.95);
    }
    60% {
        opacity: 0.8;
        max-height: 180px;
        margin-bottom: 18px;
        transform: translateY(2px) scale(1.02);
    }
    100% {
        opacity: 1;
        max-height: 200px;
        margin-bottom: 20px;
        transform: translateY(0) scale(1);
    }
}

/* Animacja wyjścia z efektem fade */
@keyframes slideOutFade {
    0% {
        opacity: 1;
        max-height: 200px;
        margin-bottom: 20px;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

.ddm-animate-in {
    animation: slideInBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.ddm-animate-out {
    animation: slideOutFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.ddm-hidden-field {
    display: none !important;
}

/* Styling for multibuilding checkbox field */
p#billing_is_multibuilding_field {
    width: 90% !important;
}

input#billing_is_multibuilding {
    width: auto !important;
}

.ddm-entrance-code-field.ddm-show {
    display: block !important;
}

/* Address field labels fix - use higher specificity instead of !important */
.woocommerce-checkout #billing_address_2_field label,
.woocommerce-checkout #shipping_address_2_field label,
.woocommerce-checkout #billing_apartment_field label {
    position: static;
    clip: auto;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    display: block;
    font-size: inherit;
    color: inherit;
}

/* Remove screen-reader-text class from address field labels */
.woocommerce-checkout #billing_address_2_field label.screen-reader-text,
.woocommerce-checkout #shipping_address_2_field label.screen-reader-text,
.woocommerce-checkout #billing_apartment_field label.screen-reader-text {
    position: static;
    clip: auto;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
}

/* Hide optional text labels - but preserve layout */
.woocommerce .optional,
.woocommerce-checkout .optional,
.form-row .optional,
.form-field .optional,
span.optional,
em.optional {
    visibility: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Postal code validation styles */
.form-row.not-validated input, 
input.not-validated {
    border-color: #e74c3c !important;
    box-shadow: 0 0 3px rgba(231, 76, 60, 0.3) !important;
}

.form-row.validated input, 
input.validated {
    border-color: #0a6b0d !important;
    box-shadow: 0 0 3px rgba(10, 107, 13, 0.3) !important;
}

/* Red highlighting for multibuilding fields */
.ddm-highlight {
    border: 2px solid #d9534f !important;
    border-radius: 4px;
    background-color: transparent !important;
    padding: 15px !important;
}

.ddm-highlight label {
    color: #d9534f !important;
    font-weight: 600;
}

.ddm-highlight input {
    border-color: #d9534f !important;
    box-shadow: 0 0 5px rgba(217, 83, 79, 0.3) !important;
    background-color: #fff !important;
}

.ddm-highlight input:focus {
    border-color: #d9534f !important;
    box-shadow: 0 0 8px rgba(217, 83, 79, 0.5) !important;
}

/* Override any yellow backgrounds from WooCommerce or other plugins */
.ddm-floor-field,
.ddm-entrance-code-field,
#billing_floor_field,
#billing_entrance_code_field {
    background-color: transparent !important;
}

.ddm-floor-field input,
.ddm-entrance-code-field input,
#billing_floor_field input,
#billing_entrance_code_field input {
    background-color: #fff !important;
}

/* Ensure no yellow background on any field states */
.ddm-floor-field.woocommerce-invalid,
.ddm-entrance-code-field.woocommerce-invalid,
.ddm-floor-field.woocommerce-invalid-required-field,
.ddm-entrance-code-field.woocommerce-invalid-required-field {
    background-color: transparent !important;
}

/* Delivery hours info styling */
.ddm-delivery-hours {
    color: #d9534f !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    padding: 8px !important;
    background: #f8f8f8 !important;
    border-left: 4px solid #d9534f !important;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
}

/* Night delivery info box styling */
.ddm-info-box {
    width: 100% !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
}

p#billing_night_delivery_info_field {
    width: 93% !important;
}

.ddm-info-box input {
    display: none !important;
}
.ddm-info-box .woocommerce-input-wrapper {
    display: block !important;
    /*margin-top: 15px !important;*/
    /*padding: 15px !important;*/
    /*background: #e8f4fd !important;*/
    /*border: 2px solid #bee5eb !important;*/
    /*border-radius: 8px !important;*/
    /*color: #0c5460 !important;*/
    /*font-size: 14px !important;*/
    /*line-height: 1.5 !important;*/
    /*font-weight: 500 !important;*/
    /*text-align: center !important;*/
    box-shadow: 0 2px 4px rgba(190, 229, 235, 0.3) !important;
}

.ddm-info-box .woocommerce-input-wrapper > span {
    display: block !important;
    width: 100% !important;
    /*font-weight: 600 !important;*/
    /*color: #d9534f !important;*/
    /*margin-bottom: 8px !important;*/
    /*font-size: 15px !important;*/
}

span#billing_night_delivery_info-description{
    background: #13294A;
    text-align: justify;
}
span#billing_night_delivery_info-description::before{
    border-color: #13294A transparent transparent transparent;;
    left: 50%;
    top: 0;
    margin-top: -4px;
    transform: translateX(-50%) rotate(180deg);
    content: "";
    position: absolute;
    border-width: 4px 6px 0 6px;
    border-style: solid;
    z-index: 100;
    display: block;
}


#billing_night_delivery_info-description strong{
    color:#ffca3b;
}

.woocommerce-invalid input,
.woocommerce-invalid-required-field input,
input.invalid,
input.not-validated {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: #fff !important;
}

.woocommerce-invalid input:focus,
.woocommerce-invalid-required-field input:focus,
input.invalid:focus,
input.not-validated:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.35) !important;
    outline: none !important;
}

/* Initial validation styling for empty required fields */
.ddm-multibuilding-field.woocommerce-invalid,
.ddm-multibuilding-field.woocommerce-invalid-required-field {
    border-radius: 4px;
    background-color: transparent !important;
    padding: 15px !important;
}

.ddm-multibuilding-field.woocommerce-invalid label,
.ddm-multibuilding-field.woocommerce-invalid-required-field label {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Positive validation styling */
.form-row.validated input,
input.validated {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15) !important;
}

.form-row.validated input:focus,
input.validated:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
    outline: none !important;
}

/* Salient Theme Integration */
.woocommerce-checkout .ddm-multibuilding-field {
    clear: both;
    width: 100%;
}

/* Better responsive behavior */
@media (max-width: 768px) {
    .ddm-multibuilding-field {
        margin-bottom: 15px;
    }
    
    .ddm-info-box .woocommerce-input-wrapper {
        padding: 10px;
        font-size: 13px;
    }
}

/* Smooth transitions for better UX */
.form-row {
    transition: all 0.2s ease-in-out;
}

/* Prevent layout shifts during field animations */
.woocommerce-checkout .col2-set {
    min-height: 300px;
}

/* Ensure consistent field heights */
.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row select {
    min-height: 40px;
}

/* Initial validation styling for empty required fields (no error messages) */
.ddm-floor-field.woocommerce-invalid input,
.ddm-entrance-code-field.woocommerce-invalid input,
.ddm-multibuilding-field.woocommerce-invalid input {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
    background-color: #fff !important;
}

.ddm-floor-field.woocommerce-invalid,prze
.ddm-entrance-code-field.woocommerce-invalid {
    /* Subtle field highlighting without being too aggressive */
    border-radius: 4px;
}

/* Remove any default WooCommerce error styling that might show messages */
.ddm-multibuilding-field .woocommerce-error {
    display: none !important;
}

/* Override any WooCommerce validation messages for these specific fields */
.ddm-floor-field .woocommerce-error,
.ddm-entrance-code-field .woocommerce-error {
    display: none !important;
}

/* Override .ddm-info-box styles to match woocommerce-info dark */
.ddm-info-box.dark .woocommerce-input-wrapper {

}

.ddm-info-box.dark .woocommerce-input-wrapper > span {
    color: white !important;
    font-weight: normal !important;
}

.checkout #order_review .order-review tbody tr td {
    padding-left: 10px;
}