/*!
 * Engoory Wolt — checkout styles, 3.0.5
 *
 * Token contract
 * --------------
 * Every value reads an Engoory Checkout token first and falls back to the same neutral default
 * that Engoory Checkout ships. With both plugins active, Wolt inherits the merchant's chosen
 * palette, radius and motion automatically; running alone under WoodMart or classic WooCommerce
 * it renders in the identical house neutral. This is the same contract Engoory Georgian Post
 * uses, so the two carriers are indistinguishable in one rate list.
 *
 * Scoping contract
 * ----------------
 * Only Wolt's own elements are styled. Rate-row geometry, radio controls and spacing stay owned
 * by WooCommerce, WoodMart, Engoory Checkout or CheckoutWC. There are no !important
 * declarations outside the documented third-party overrides at the end of this file.
 */

.ewolt-label-inline,
.ewolt-tip-popover,
.ewolt-schedule {
    --w-surface: var(--ec-surface, #ffffff);
    --w-raised: var(--ec-page, #f7f7f5);
    --w-text: var(--ec-text, #141414);
    --w-muted: var(--ec-muted, #6e6e6e);
    --w-border: var(--ec-border, #e6e6e2);
    --w-accent: var(--ec-accent, #111111);
    --w-accent-text: var(--ec-accent-text, #ffffff);
    --w-positive: var(--ec-positive, #0f7b4f);
    --w-positive-soft: var(--ec-positive-soft, #e9f6ef);
    --w-positive-border: var(--ec-positive-border, #cbe7d8);
    --w-radius: var(--ec-input-radius, 10px);
    --w-radius-lg: var(--ec-radius, 14px);
    --w-ring: var(--ec-ring, rgba(17, 17, 17, .16));
    --w-shadow: var(--ec-shadow, 0 1px 2px rgba(15, 15, 15, .04), 0 12px 32px -12px rgba(15, 15, 15, .14));
    --w-fs-sm: var(--ec-fs-sm, 13px);
    --w-fs-xs: var(--ec-fs-xs, 11.5px);
    --w-dur: var(--ec-duration, .16s);
    --w-ease: var(--ec-ease, cubic-bezier(.2, .6, .2, 1));
}

/* ==========================================================================
   1. Rate row
   ==========================================================================
   A wrapping flex row rather than a nowrap inline group: at sidebar width the badges drop to a
   second line instead of pushing the price out of the card. Typeface is inherited so the method
   never looks pasted in from another product.
   ========================================================================== */

.ewolt-label-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
    max-width: 100%;
    color: inherit;
    font: inherit;
    line-height: inherit;
    vertical-align: middle;
}

.ewolt-label-brand {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.ewolt-label-title {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font: inherit;
    font-weight: 600;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
}

.ewolt-logo-mark {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: 17px;
    max-width: 54px;
    margin: 0;
    object-fit: contain;
}

.ewolt-icon { display: block; flex: 0 0 auto; }

.ewolt-label-price,
.ewolt-label-price .woocommerce-Price-amount {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: inherit;
    font: inherit;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ewolt-label-price.is-free { gap: 8px; flex-wrap: wrap; white-space: normal; }

/* Free state: one rate, the shopper's usual price struck through and a quiet status capsule —
   never a duplicate shipping option or an oversized promotional treatment. */
.ewolt-price-original,
.ewolt-price-original .woocommerce-Price-amount {
    color: var(--w-muted);
    font: inherit;
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-thickness: 1.2px;
}

.ewolt-free-badge,
.ewolt-eta-badge,
.ewolt-slot-badge {
    display: inline-flex;
    flex: 0 0 auto;
    box-sizing: border-box;
    align-items: center;
    gap: 5px;
    min-height: 27px;
    padding: 0 11px;
    border-radius: 999px;
    font-family: inherit;
    font-size: var(--w-fs-xs);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.005em;
    white-space: nowrap;
}

.ewolt-free-badge {
    border: 1px solid var(--w-positive-border);
    background: var(--w-positive-soft);
    color: var(--w-positive);
}

.ewolt-eta-badge,
.ewolt-slot-badge {
    border: 1px solid var(--w-border);
    background: var(--w-surface);
    color: var(--w-text);
}

.ewolt-eta-badge .ewolt-icon,
.ewolt-slot-badge .ewolt-icon { color: var(--w-muted); }

/* A scheduled window is prose, not a figure; let it wrap in a narrow column. */
.ewolt-slot-badge { max-width: 100%; white-space: normal; text-align: left; }

/* ==========================================================================
   2. Details trigger and popover
   ========================================================================== */

.ewolt-help-tip {
    display: inline-flex;
    flex: 0 0 26px;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0 -4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ec-muted, #6e6e6e);
    cursor: help;
    outline: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color var(--ec-duration, .16s) var(--ec-ease, cubic-bezier(.2, .6, .2, 1)),
        background-color var(--ec-duration, .16s) var(--ec-ease, cubic-bezier(.2, .6, .2, 1));
    vertical-align: middle;
}

.ewolt-help-tip:hover,
.ewolt-help-tip:focus-visible,
.ewolt-help-tip.is-open {
    background: var(--ec-accent-soft, rgba(17, 17, 17, .055));
    color: var(--ec-text, #141414);
}

.ewolt-help-tip:focus-visible { box-shadow: 0 0 0 3px var(--ec-ring, rgba(17, 17, 17, .16)); }

/* Rendered at body level and fixed to the viewport, so no checkout row overflow rule in
   WoodMart, Engoory Checkout or CheckoutWC can clip it. */
.ewolt-tip-popover {
    --ewolt-tip-arrow-x: calc(100% - 26px);
    position: fixed;
    z-index: 2147483000;
    box-sizing: border-box;
    inline-size: min(288px, calc(100vw - 24px));
    padding: 13px 14px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-lg);
    background: var(--w-surface);
    box-shadow: var(--w-shadow);
    color: var(--w-muted);
    font-family: inherit;
    white-space: normal;
    opacity: 0;
    transform: translateY(-3px) scale(.985);
    transform-origin: top right;
    transition: opacity var(--w-dur) var(--w-ease), transform var(--w-dur) var(--w-ease);
}

.ewolt-tip-popover.is-open { opacity: 1; transform: translateY(0) scale(1); }

.ewolt-tip-popover[data-placement="top"] {
    transform: translateY(3px) scale(.985);
    transform-origin: bottom right;
}

.ewolt-tip-popover[data-placement="top"].is-open { transform: translateY(0) scale(1); }

.ewolt-tip-popover__title {
    color: var(--w-text);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -.012em;
    line-height: 1.32;
}

.ewolt-tip-popover__body,
.ewolt-tip-popover__emphasis,
.ewolt-tip-popover__note {
    font-size: var(--w-fs-sm);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.ewolt-tip-popover__body { margin-top: 5px; }
.ewolt-tip-popover__emphasis { margin-top: 6px; color: var(--w-text); font-weight: 600; }

.ewolt-tip-popover__note {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--w-border);
}

.ewolt-tip-popover__arrow {
    position: absolute;
    top: -6px;
    left: var(--ewolt-tip-arrow-x);
    box-sizing: border-box;
    width: 11px;
    height: 11px;
    border-top: 1px solid var(--w-border);
    border-left: 1px solid var(--w-border);
    background: var(--w-surface);
    transform: translateX(-50%) rotate(45deg);
}

.ewolt-tip-popover[data-placement="top"] .ewolt-tip-popover__arrow {
    top: auto;
    bottom: -6px;
    border: 0;
    border-right: 1px solid var(--w-border);
    border-bottom: 1px solid var(--w-border);
}

/* ==========================================================================
   3. Delivery window picker
   ==========================================================================
   Design notes.

   The chosen window is already stated in the rate row's own pill, so repeating it inside the
   panel was redundant — two identical sentences stacked on top of each other, which is what
   made the block feel cluttered. The panel therefore shows only what the rate row cannot: the
   choice itself.

   That choice is two horizontal strips — days, then times — in the pattern every delivery app
   uses, because picking a slot is a scanning task. Nothing is hidden behind a disclosure, the
   resting height is fixed at two rows however many windows exist, and no chip has to ellipse
   itself. A soft fade on the trailing edge signals that a strip scrolls.

   Host themes leak in aggressively here. Engoory Checkout's Native and Minimal presets set
   `white-space: nowrap` on shipping labels and their own padding, radius and background on
   buttons, at a specificity our single class names lost to. Every rule below is therefore
   anchored on `.ewolt-schedule` to win on specificity rather than on !important.
   ========================================================================== */

.ewolt-schedule {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 2px;
    font-family: inherit;
    container-type: inline-size;
    container-name: ewoltsched;
}

.ewolt-schedule:empty { display: none; }

/* The picker belongs to the Wolt row; it stays closed until Wolt is the selected method. */
.ewolt-schedule:not(.is-active) { display: none; }

/* Undo inherited typography from the host label rather than trusting our own rules to win. */
.ewolt-schedule,
.ewolt-schedule * {
    min-width: 0;
    letter-spacing: normal;
    text-transform: none;
    white-space: normal;
    overflow-wrap: break-word;
}

.ewolt-schedule .ewolt-schedule__inner {
    box-sizing: border-box;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-lg);
    background: var(--w-surface);
}

/* Supporting information, not a headline. The rate row already carries the commitment. */
.ewolt-schedule .ewolt-schedule__notice {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    max-width: 100%;
    margin: 0 0 11px;
    color: var(--w-muted);
    font-size: var(--w-fs-xs);
    font-weight: 500;
    line-height: 1.45;
}

.ewolt-schedule .ewolt-schedule__notice .ewolt-icon { margin-top: 1px; flex: 0 0 auto; }
.ewolt-schedule .ewolt-schedule__notice span { flex: 1 1 auto; }

.ewolt-schedule .ewolt-schedule__legend {
    display: block;
    margin: 0 0 7px;
    color: var(--w-muted);
    font-size: var(--w-fs-xs);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ewolt-schedule .ewolt-schedule__modes {
    display: flex;
    gap: 2px;
    margin-bottom: 11px;
    padding: 3px;
    border: 1px solid var(--w-border);
    border-radius: 999px;
    background: var(--w-raised);
}

/* Reset every control this panel owns before styling it. */
.ewolt-schedule button {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    height: auto;
    margin: 0;
    font-family: inherit;
    font-style: normal;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.ewolt-schedule .ewolt-schedule__mode {
    flex: 1 1 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--w-muted);
    font-size: var(--w-fs-sm);
    font-weight: 600;
    line-height: 1.2;
    transition: background-color var(--w-dur) var(--w-ease), color var(--w-dur) var(--w-ease);
}

.ewolt-schedule .ewolt-schedule__mode[aria-pressed="true"] {
    background: var(--w-surface);
    color: var(--w-text);
    box-shadow: 0 1px 2px rgba(15, 15, 15, .1);
}

/* Both strips behave identically: one row, snap scrolling, faded trailing edge. */
.ewolt-schedule .ewolt-schedule__strip {
    display: flex;
    gap: 6px;
    max-width: 100%;
    margin: 0;
    padding: 1px 1px 3px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
}

.ewolt-schedule .ewolt-schedule__strip::-webkit-scrollbar { display: none; }
.ewolt-schedule .ewolt-schedule__days { margin-bottom: 7px; }

.ewolt-schedule .ewolt-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    background: var(--w-surface);
    color: var(--w-text);
    font-size: var(--w-fs-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: border-color var(--w-dur) var(--w-ease), background-color var(--w-dur) var(--w-ease),
        color var(--w-dur) var(--w-ease);
}

/* Days read as words and need breathing room; times are numerals and pack tighter. */
.ewolt-schedule .ewolt-chip--day { padding-inline: 14px; }
.ewolt-schedule .ewolt-chip--slot { padding-inline: 11px; }

.ewolt-schedule .ewolt-chip:hover { border-color: var(--w-accent); }
.ewolt-schedule .ewolt-chip:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--w-ring); }

.ewolt-schedule .ewolt-chip[aria-pressed="true"],
.ewolt-schedule .ewolt-chip[aria-selected="true"] {
    border-color: var(--w-accent);
    background: var(--w-accent);
    color: var(--w-accent-text);
}

.ewolt-schedule.is-busy { opacity: .58; pointer-events: none; }
.ewolt-schedule .ewolt-schedule__empty { margin: 0; color: var(--w-muted); font-size: var(--w-fs-sm); }

/* Wide column: no need to fade or snap when everything already fits. */
@container ewoltsched (min-width: 560px) {
    .ewolt-schedule .ewolt-schedule__inner { padding: 15px; }
    .ewolt-schedule .ewolt-schedule__notice { font-size: var(--w-fs-sm); }
    .ewolt-schedule .ewolt-schedule__strip { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .ewolt-schedule .ewolt-schedule__modes { display: inline-flex; }
    .ewolt-schedule .ewolt-schedule__mode { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .ewolt-schedule .ewolt-schedule__strip { scroll-behavior: auto; }
}

/* ==========================================================================
   4. Third-party overrides
   ==========================================================================
   Each rule defeats a specific vendor declaration. CheckoutWC sets the rate label to
   `display: block`, which collapses the flex row; WoodMart sets `white-space: nowrap` on
   shipping labels, which forces horizontal overflow on phones. Nothing else uses !important.
   ========================================================================== */

.checkoutwc input.shipping_method[value^="engoory_wolt"] + label,
main.checkoutwc input.shipping_method[value^="engoory_wolt"] + label {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
}

.woodmart-checkout-shipping input.shipping_method[value^="engoory_wolt"] + label,
.wd-checkout-shipping input.shipping_method[value^="engoory_wolt"] + label,
.engoory-checkout-active input.shipping_method[value^="engoory_wolt"] + label {
    white-space: normal !important;
}

/* Engoory Checkout's Native and Minimal presets lay the rate row out as a flex line. A flex
   child will not shrink below its content unless min-width is cleared, which is what let the
   closure notice push straight past the card edge. */
.engoory-checkout-active .ewolt-schedule,
.engoory-checkout-active .ewolt-label-inline {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* WoodMart renders shipping rates as a table row; the picker needs the full width beneath it
   rather than the label cell it is nested in. */
.woocommerce-shipping-methods .ewolt-schedule,
.wd-shipping-methods .ewolt-schedule {
    width: 100%;
}

/* Fallback for engines without container queries: viewport width is a coarse proxy, but a
   checkout sidebar on a phone is always narrow, so the two agree where it matters most. */
@supports not (container-type: inline-size) {
    @media (max-width: 620px) {
        .ewolt-schedule__slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 196px; }
        .ewolt-chip { min-height: 34px; font-size: 12px; }
    }
}

@media (max-width: 480px) {
    .ewolt-logo-mark { height: 15px; max-width: 48px; }
    .ewolt-free-badge,
    .ewolt-eta-badge,
    .ewolt-slot-badge { min-height: 22px; padding-inline: 8px; }
    .ewolt-tip-popover { inline-size: calc(100vw - 20px); }
    .ewolt-schedule__inner { padding: 12px; }
    .ewolt-chip { min-height: 38px; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .ewolt-help-tip,
    .ewolt-tip-popover,
    .ewolt-chip,
    .ewolt-schedule__mode { transition: none; }
}

/* Accessible controls and failure feedback for both checkout surfaces. */
.ewolt-schedule__error { color: #9b1c1c; font-size: 13px; margin: 8px 0 0; }
.ewolt-schedule__error:empty { display: none; }
.ewolt-native-label { display: grid; gap: 8px; font-weight: 600; }
.ewolt-native-label select { width: 100%; min-height: 44px; padding: 8px; font: inherit; color: inherit; background: #fff; border: 1px solid #8b969c; border-radius: 6px; }
.ewolt-schedule button:focus-visible, .ewolt-native-label select:focus-visible { outline: 3px solid #006b80; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ewolt-schedule *, .ewolt-tip { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.ewolt-schedule .ewolt-chip, .ewolt-schedule .ewolt-schedule__mode { min-height: 44px; }
.ewolt-schedule .ewolt-chip:focus-visible { outline: 3px solid #006b80; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ewolt-tip-popover { animation: none !important; transition: none !important; } }
