/**
 * Envio24 Order Form - SEKCJA 5 (Oferty)
 *
 * @version 1.3.1
 * @package envio24-core/assets/css/order-form/
 *
 * ZMIANY 1.3.1 (PL):
 * - Zmieniono styl Placeholder A (Stan początkowy) na styl Warning (taki sam jak brak ofert).
 *   Usunięto styl "dashed border" i niebieską ikonę "i".
 * - Dodano sekcję 7 (Loaders & Warnings) z animacją spinnera i stylem komunikatu.
 *   Dzięki temu zarówno stan "brak danych" jak i "brak ofert" wyglądają spójnie (żółty box).
 */

/* ========================================
 * 1. REGULATORY
 * ===================================== */
.e24-offers-grid {
    --e24-offer-fs-price: 38px;
    --e24-offer-fs-service: 13px;
    --e24-offer-fs-details: 12px;
    --e24-offer-fs-small: 12px;

    --e24-offer-logo-mt: 5px;
    --e24-offer-price-mt: 5px;
    --e24-offer-line-mt: 5px;
    --e24-offer-row-gap: 1px;

    --e24-offer-top-border: 12px;
    --e24-offer-side-border: 2px;
    --e24-offer-sel-border: 4px;
    --e24-offer-white-ring: 2px;
    --e24-offer-radius: 10px;

    --e24-offer-logo-w: 100px;
    --e24-offer-logo-stroke: 2px;
    --e24-offer-logo-shadow: rgba(0, 0, 0, 0.15);

    --e24-offer-sh-normal: 0 4px 12px rgba(0, 0, 0, 0.08);
    --e24-offer-sh-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --e24-offer-sh-selected: 0 12px 28px color-mix(in srgb, var(--e24-orange) 25%, transparent);

    --e24-offer-bg-normal: #FFFFFF;
    --e24-offer-bg-others: #F8F8F8;
    --e24-offer-quiet-opacity: 0.6;
    --e24-offer-quiet-grayscale: 0.3;
    --e24-offer-empty-opacity: 0.8;

    --e24-offer-card-w: 200px;
    --e24-offer-card-min-h: 340px;
    --e24-offer-grid-gap: 15px;
}

/* ========================================
 * 2. STAN A: PLACEHOLDER (Teraz styl Warning)
 * ===================================== */
.e24-offer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    
    /* Styl Warning (spójny z brakiem ofert) */
    background-color: var(--e24-warn-bg, #FFF8E1);
    border: 1px solid var(--e24-warn-border, #FFC94A);
    color: var(--e24-warn-text, #8A6D1A);
    
    padding: 20px 30px;
    border-radius: 8px;
    max-width: 700px;
    margin: 30px auto;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.e24-placeholder-icon {
    /* Ukrywamy starą ikonę "i", jeśli jest w HTML */
    display: none;
}

.e24-placeholder-main {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
}

.e24-placeholder-sub {
    font-size: 14px;
    opacity: 0.9;
}

/* ========================================
 * 3. STAN B: ALERT BAR (Pasek info)
 * ===================================== */
.e24-offer-alert {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #FFF3CD;
    border-width: 1px;
    border-style: solid;
    border-color: #FFDF7E;
    color: #7A5B00;
    padding: 14px 18px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}
.e24-offer-alert__main { font-size: 16px; font-weight: 700; line-height: 1.2; }
.e24-offer-alert__sub { font-size: 13px; font-weight: 600; line-height: 1.2; opacity: 0.9; margin-top: 4px; }
.e24-offer-alert { font-size: 14px; font-weight: 700; }

/* ========================================
 * 3.1 Toast na kaflu
 * ===================================== */
.e24-offer-toast {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 10px;
    z-index: 5;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: #FFF3CD;
    border: 1px solid #FFDF7E;
    color: #7A5B00;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* ========================================
 * 4. KAFLE (GRID & STATES)
 * ===================================== */
.e24-offers-grid {
    display: grid;
    grid-template-columns: repeat(5, var(--e24-offer-card-w));
    grid-auto-rows: 1fr;
    justify-content: center;
    gap: var(--e24-offer-grid-gap);
    width: 100%;
}

@media (max-width: 1200px) {
    .e24-offers-grid { grid-template-columns: repeat(3, var(--e24-offer-card-w)); }
}

.e24-offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
    background-color: var(--e24-offer-bg-normal);
    box-sizing: border-box;
    cursor: pointer;
    border: var(--e24-offer-side-border) solid var(--e24-orange);
    border-top-width: var(--e24-offer-top-border);
    border-radius: var(--e24-offer-radius);
    transition: all 0.2s ease;
    box-shadow: 0 0 0 var(--e24-offer-white-ring) #FFFFFF, var(--e24-offer-sh-normal);
}

.e24-offers-grid.is-flat .e24-offer-card { box-shadow: none; }
.e24-offers-grid.is-flat .e24-offer-card:hover { background-color: #FAFAFA; }

.e24-offer-card.is-selected {
    z-index: 10;
    transform: scale(1.04);
    border-width: var(--e24-offer-sel-border);
    border-top-width: var(--e24-offer-top-border);
    margin: -2px;
    box-shadow: 0 0 0 var(--e24-offer-white-ring) #FFFFFF, var(--e24-offer-sh-selected);
    background-color: #FFFFFF !important;
    opacity: 1 !important;
    filter: none !important;
}

@media (min-width: 769px) {
    .e24-offer-card:not(.is-selected):hover {
        transform: scale(1.02);
        background-color: #FFFFFF !important;
        box-shadow: 0 0 0 var(--e24-offer-white-ring) #FFFFFF, var(--e24-offer-sh-hover) !important;
        opacity: 1 !important;
        filter: none !important;
    }
}

.e24-offers-grid.has-selection .e24-offer-card:not(.is-selected) {
    background-color: var(--e24-offer-bg-others);
    box-shadow: none;
    transform: scale(1.0);
    opacity: var(--e24-offer-quiet-opacity);
    filter: grayscale(var(--e24-offer-quiet-grayscale));
}

/* ZAWARTOŚĆ KARTY */
.e24-offer-card__header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 65px;
    margin-top: var(--e24-offer-logo-mt);
}
.e24-offer-card__logo-img {
    display: block;
    max-width: var(--e24-offer-logo-w);
    height: auto;
    filter: drop-shadow(0 0 var(--e24-offer-logo-stroke) #FFF) drop-shadow(0 3px 5px var(--e24-offer-logo-shadow));
}
.e24-offer-card__main { text-align: center; margin-top: var(--e24-offer-price-mt); margin-bottom: 8px; }
.e24-offer-price { font-size: var(--e24-offer-fs-price); font-weight: 700; color: #444444; line-height: 1; }
.e24-offer-price-label { display: block; margin-top: 5px; font-size: 10px; color: #888888; font-weight: 600; }
.e24-offer-separator { height: 1px; width: 100%; margin-top: var(--e24-offer-line-mt); margin-bottom: 8px; background-color: var(--e24-green); opacity: 0.5; }
.e24-offer-service-name { margin-bottom: var(--e24-offer-row-gap); font-size: var(--e24-offer-fs-service); font-weight: 700; }

.e24-breakdown-row { display: flex; justify-content: space-between; margin-bottom: var(--e24-offer-row-gap); font-size: var(--e24-offer-fs-details); color: #555555; gap: 8px; flex-wrap: nowrap; }
.e24-bd-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e24-bd-value { flex: 0 0 auto; white-space: nowrap; font-weight: 700; }

.e24-surcharges-title { margin-top: 2px; margin-bottom: var(--e24-offer-row-gap); font-size: var(--e24-offer-fs-details); font-weight: 700; color: var(--e24-green); }
.e24-surcharge-item { position: relative; display: flex; justify-content: space-between; padding-left: 14px; margin-bottom: 1px; font-size: var(--e24-offer-fs-small); }
.e24-surcharge-item::before { content: "•"; position: absolute; left: 4px; color: #999999; }
.e24-surcharge-item.is-empty { opacity: var(--e24-offer-empty-opacity); color: #999999; }
.e24-breakdown-vat { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 4px; border-top: 1px dotted #DDDDDD; font-size: var(--e24-offer-fs-small); font-weight: 600; color: #777777; }

/* ========================================
 * 5. WIDOK MOBILNY (UKŁAD POZIOMY)
 * ===================================== */
@media (max-width: 768px) {
    .e24-offers-grid { display: flex; flex-direction: column; gap: 20px; }
    .e24-offer-card { flex-direction: row; flex-wrap: wrap; width: 100%; min-height: auto; padding: 10px 15px; border-top-width: var(--e24-offer-side-border); border-left-width: var(--e24-offer-top-border); transform: none !important; margin: 0 !important; }
    .e24-offer-card__header { justify-content: flex-start; width: 40%; margin-top: 0; }
    .e24-offer-card__logo-img { max-width: 80px; margin-left: 0; }
    .e24-offer-card__main { width: 60%; margin-top: 0; text-align: right; }
    .e24-offer-price { font-size: 26px; }
    .e24-offer-card__details { display: none; width: 100%; margin-top: 15px; }
    .e24-offer-card.is-selected { background-color: var(--e24-offer-bg-selected-mob); opacity: 1 !important; filter: none !important; }
    .e24-offer-card.is-selected .e24-offer-card__details { display: block; animation: e24SlideDown 0.3s ease-out; }
    .e24-offers-grid.has-selection .e24-offer-card:not(.is-selected) { background-color: var(--e24-offer-bg-others); opacity: var(--e24-offer-quiet-opacity); filter: grayscale(var(--e24-offer-quiet-grayscale)); box-shadow: none; }
}

@keyframes e24SlideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
 * 7. LOADERS & WARNINGS
 * ===================================== */
.e24-offer-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    text-align: center;
}

.e24-spinner-icon {
    width: 64px;
    height: 64px;
    display: block;
    animation: e24-spin 2s linear infinite;
    fill: var(--e24-orange);
}

@keyframes e24-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Komunikat brak ofert (Warning Style) */
.e24-offer-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background-color: var(--e24-warn-bg, #FFF8E1);
    border: 1px solid var(--e24-warn-border, #FFC94A);
    color: var(--e24-warn-text, #8A6D1A);
    border-radius: 8px;
    max-width: 600px;
    margin: 30px auto;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}