/* General Wrapper */
.rekfi-delivery-block-wrapper {
    margin: 0.625rem 1px 1.25rem 1px;
    background: #fff;
    box-shadow: 0 0 .15em rgba(0, 0, 0, .3);
    padding: .625rem;
    border-radius: 4px;
    /* Added for harmony */
}

/* Section Title */
/* Section Title */
.rekfi-delivery-section-title {
    font-size: 1em;
    /* Smaller */
    font-weight: bold;
    margin-bottom: 0.4em;
    /* Closer to fields */
}

/* Location Selector Layout */
/* Location Selector Layout */
.rekfi-delivery-location-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    /* Denser */
    margin-bottom: 0.5em;
    /* Denser */
}

.rekfi-delivery-location-selector .select2-container {
    width: 100% !important;
}

/* Native Select Styling (Mobile) */
.rekfi-delivery-location-selector select {
    width: 100%;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 16px;
    /* Prevents iOS zoom */
    background-color: #fff;
    color: #555;
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* Hide native select when Select2 is active (it usually does this automatically, but just in case) */
.rekfi-delivery-location-selector select.select2-hidden-accessible {
    /* Select2 handles this, but we ensure our custom styles don't interfere */
    height: 1px;
    width: 1px;
    padding: 0;
    border: 0;
}

.select2-container .select2-selection--single {
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 12px;
    color: #555;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
}

/* Delivery Card */
.rekfi-delivery-message-container {
    padding: 0;
    border: none;
    background: none;
    margin-top: 1em;
    /* Prevent CLS by enforcing a reasonable minimum */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.rekfi-delivery-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-grow: 1;
    height: 100%;
    box-sizing: border-box;
}

/* Icon Styles */
.rekfi-delivery-card-icon {
    flex-shrink: 0;
    font-size: 24px;
    /* Adjust as needed for font icons */
    color: #555;
}

.rekfi-delivery-card-icon img.rekfi-delivery-icon {
    width: 32px;
    height: 32px;
}

.rekfi-delivery-card.rekfi-icon-right {
    flex-direction: row-reverse;
}

/* Card Content */
.rekfi-delivery-card-content {
    flex-grow: 1;
}

.rekfi-delivery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.rekfi-delivery-card-heading {
    font-size: 1em;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.rekfi-delivery-card-details {
    font-size: 0.9em;
    font-weight: normal;
    text-decoration: none;
    color: #0073aa;
    flex-shrink: 0;
    margin-left: 16px;
    cursor: pointer;
}

.rekfi-delivery-card-body p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: #555;
}

.rekfi-delivery-cost-line {
    margin-top: 4px;
}

.rekfi-countdown {
    font-weight: bold;
}

/* Loading State */
.afrsw-delivery-loading .rekfi-delivery-card-content {
    opacity: 0.7;
}

/* Popup Styles */
.rekfi-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.rekfi-popup-wrapper {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: rekfiFadeIn 0.3s ease-out;
    position: relative;
}

.rekfi-popup-content {
    display: flex;
    flex-direction: column;
}

.rekfi-popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rekfi-popup-header h3 {
    margin: 0;
    font-size: 1.25em;
    color: #333;
    font-weight: 600;
}

.rekfi-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.rekfi-popup-close:hover {
    color: #333;
}

.rekfi-popup-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.rekfi-popup-section {
    margin-bottom: 20px;
}

.rekfi-popup-section:last-child {
    margin-bottom: 0;
}

.rekfi-popup-section h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #444;
}

.rekfi-popup-section p {
    margin: 0;
    font-size: 1em;
    line-height: 1.6;
    color: #666;
}

@keyframes rekfiFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Message (Compact Special) */
.rekfi-modern-message {
    font-size: 0.85em;
    line-height: 1.4;
    padding: 4px 8px;
    background-color: #f0fdf4;
    /* Light green background */
    border: 1px solid #dcfce7;
    border-radius: 4px;
    color: #166534;
    /* Dark green text */
    margin-top: 5px;
    display: inline-block;
}

.rekfi-modern-message.wdde-status-outofstock {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.rekfi-modern-message.wdde-status-onbackorder {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}


/* WDDE Cart Grouping: layout helper row must NEVER create spacing (mobile-safe) */
tr.wdde-layout-helper,
tr.wdde-layout-helper td,
tr.wdde-layout-helper th {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    overflow: hidden !important;
}

