/* KEYFRAMES FOR ANIMATION */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#wed-estimated-delivery-container {
    font-family: inherit;
    padding: 20px 25px; /* Increased horizontal padding */
    border-radius: 12px; /* More rounded corners */
    margin-top: 25px; /* Slightly more margin */
    text-align: center;
    line-height: 1.5;
    overflow: hidden; /* Important for border animation/shadows */
    position: relative;
    z-index: 1; /* Ensure shadow/border layers correctly */

    /* Custom CSS variables passed from PHP */
    background: var(--wed-bg-color); /* Fallback */
    color: var(--wed-text-color);
    font-size: 1.1em;
    font-weight: 500;

    /* Enhanced Box Shadow for a lifted effect */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
    
    /* Subtle animation on load */
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

/* GRADIENT OVERLAY for background */
#wed-estimated-delivery-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* Behind content */
    border-radius: 12px;
    background: linear-gradient(135deg, 
                var(--wed-bg-color) 0%, 
                color-mix(in srgb, var(--wed-bg-color) 85%, #fff) 100%); /* Subtle lighter tint */
    /* If --wed-bg-color is very dark, you might mix with black: color-mix(in srgb, var(--wed-bg-color) 85%, #000) */
    opacity: 0.95; /* Slight transparency for texture */
}

/* Outer Border effect (optional, if main box-shadow is not enough) */
#wed-estimated-delivery-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2; /* Even further behind */
    border: 2px solid color-mix(in srgb, var(--wed-bg-color) 50%, var(--wed-var-color)); /* Border using both colors */
    border-radius: 12px;
    opacity: 0.6;
}

/* Inner content alignment */
#wed-estimated-delivery-container .wed-inner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px; /* Space between icon and text */
}

/* ICON STYLES */
#wed-estimated-delivery-container .wed-icon {
    display: flex; /* For vertical alignment of SVG */
    align-items: center;
    color: var(--wed-var-color); /* Icon color matches variable text */
    margin-right: 5px; /* Space between icon and message */
    font-size: 1.5em; /* Make icon a bit larger if it's text-based */
}

#wed-estimated-delivery-container .wed-icon svg {
    width: 28px; /* Larger SVG icon */
    height: 28px;
    stroke: var(--wed-var-color); /* SVG stroke color */
    fill: none; /* No fill for stroke icon */
}

/* MESSAGE TEXT STYLES */
#wed-estimated-delivery-container .wed-message {
    font-family: inherit;
    min-height: 20px;
    display: block; /* Ensure text behaves as a block */
    flex-grow: 1; /* Allow message to take available space */
    font-size: 1em; /* Base font size, variables will be larger */
}

/* VARIABLE TEXT STYLES */
#wed-estimated-delivery-container .wed-countdown,
#wed-estimated-delivery-container .wed-delivery-date,
#wed-estimated-delivery-container .wed-countdown-placeholder,
#wed-estimated-delivery-container .wed-delivery-date-placeholder {
    font-family: inherit;
    font-weight: 800; /* Extra bold */
    color: var(--wed-var-color) !important; /* Force variable color */
    font-size: 1.2em; /* Larger font size for variables */
    letter-spacing: 0.5px; /* Slightly spaced letters */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15); /* More prominent text shadow */
    transition: color 0.3s ease; /* Smooth transition if color changes */
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    #wed-estimated-delivery-container {
        padding: 15px 20px;
        font-size: 1em;
    }
    #wed-estimated-delivery-container .wed-inner-content {
        flex-direction: column; /* Stack icon and text */
        gap: 8px;
    }
    #wed-estimated-delivery-container .wed-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }
    #wed-estimated-delivery-container .wed-icon svg {
        width: 24px;
        height: 24px;
    }
    #wed-estimated-delivery-container .wed-message {
        font-size: 0.95em;
    }
    #wed-estimated-delivery-container .wed-countdown,
    #wed-estimated-delivery-container .wed-delivery-date,
    #wed-estimated-delivery-container .wed-countdown-placeholder,
    #wed-estimated-delivery-container .wed-delivery-date-placeholder {
        font-size: 1.1em;
    }
}

/* ---------------------------------------------------------
   MEJORA 4: ESTILOS DE URGENCIA Y FOMO (Menos de 2 horas)
   --------------------------------------------------------- */
#wed-estimated-delivery-container.wed-urgent {
    border-color: #ff4d4d !important;
    box-shadow: 0 8px 25px rgba(255, 77, 77, 0.28), 0 3px 6px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.4s ease;
}

#wed-estimated-delivery-container.wed-urgent .wed-icon svg {
    stroke: #ff4d4d !important;
    animation: wedPulseIcon 1.5s infinite ease-in-out;
}

#wed-estimated-delivery-container.wed-urgent .wed-countdown {
    color: #ff4d4d !important;
    font-weight: 900 !important;
    letter-spacing: 0.8px;
    animation: wedPulseText 1.5s infinite ease-in-out;
}

@keyframes wedPulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

@keyframes wedPulseText {
    0% { opacity: 1; }
    50% { opacity: 0.75; }
    100% { opacity: 1; }
}