/* ==========================================================================
   US airfreight inquiry notice (cart + product page)

   Aligned to the shop design system (flat, square corners, brand orange
   #eb611d, body text #666). Renders as a full-width notice bar: badge on the
   left, message in the middle, solid brand button on the right. Used by both
   the cart and the product page via the shared alert template.
   ========================================================================== */

.kmeral-usa-alert {
    --usa-accent: #eb611d;      /* @primary (brand orange) */
    --usa-accent-dark: #c84d0f; /* hover */
    --usa-accent-deep: #a83e0a; /* AA-safe orange for the small uppercase kicker */
    --usa-ink: #212934;
    --usa-ink-soft: #666666;    /* @mainTextColor */

    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 1.15rem 1.4rem;
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid var(--usa-accent);
    /* square corners on purpose — matches the shop's buttons and boxes */
}

/* Product page: JS toggles this to hide the banner for the current variant /
   price without removing it from the DOM. */
.kmeral-usa-alert--hidden {
    display: none !important;
}

/* flat, solid brand badge (no gradient / glow, to sit with the flat theme) */
.kmeral-usa-alert__badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--usa-accent);
    color: #fff;
    font-size: 18px;
}

.kmeral-usa-alert__body {
    flex: 1 1 auto;
    min-width: 0;
}

.kmeral-usa-alert__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--usa-accent-deep);
}

.kmeral-usa-alert__flag {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.kmeral-usa-alert__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--usa-ink);
}

.kmeral-usa-alert__text {
    margin: 0;
    max-width: 68ch;
    font-size: 14px;
    line-height: 1.5;
    color: var(--usa-ink-soft);
}

/* secondary hint: opens the settings popup on the shipping-country tab */
.kmeral-usa-alert__switch-line {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--usa-ink-soft);
}

.kmeral-usa-alert__switch {
    color: var(--usa-accent-deep);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.kmeral-usa-alert__switch:hover,
.kmeral-usa-alert__switch:focus-visible {
    color: var(--usa-accent-dark);
    text-decoration: underline;
    outline: none;
}

/* CTA: solid brand button, square corners (native shop button shape).
   Label stays white in EVERY state, incl. :visited, so the contrast never
   drops once the contact page has been opened. */
.kmeral-usa-alert__cta,
.kmeral-usa-alert__cta:link,
.kmeral-usa-alert__cta:visited,
.kmeral-usa-alert__cta:hover,
.kmeral-usa-alert__cta:focus,
.kmeral-usa-alert__cta:active {
    color: #fff;
    text-decoration: none;
}

.kmeral-usa-alert__cta {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0.85rem 1.75rem;
    background: var(--usa-accent);
    border: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: background-color 0.18s ease;
}

.kmeral-usa-alert__cta:hover,
.kmeral-usa-alert__cta:focus-visible {
    background: var(--usa-accent-dark);
    outline: none;
}

.kmeral-usa-alert__cta-icon {
    transition: transform 0.18s ease;
}

.kmeral-usa-alert__cta:hover .kmeral-usa-alert__cta-icon,
.kmeral-usa-alert__cta:focus-visible .kmeral-usa-alert__cta-icon {
    transform: translateX(3px);
}

/* ---- Product page: span the full buybox width, above the two columns ----
   The buybox is a flex row (usps | priceinfo). Only allow it to wrap WHEN a
   VISIBLE alert is present, so the alert (first child, full basis) can sit on
   its own line across the whole box. The :not(--hidden) guard means a
   JS-hidden banner does not force the wrap (which would stack the columns). */
.catalog-product-view .product-info-buybox:has(> .kmeral-usa-alert:not(.kmeral-usa-alert--hidden)) {
    flex-wrap: wrap;
}

.product-info-buybox > .kmeral-usa-alert {
    flex: 0 0 100%;
    order: -1;
    margin: 0 0 1.5rem;
}

/* Keep the price/cart column on the right even when the banner wraps the buybox
   onto a new line (with justify-content: space-between a lone priceinfo would
   otherwise slide left - most visible on simple products without an options
   column on the left). */
.catalog-product-view .product-info-buybox-priceinfo {
    margin-left: auto;
}

/* ---- Responsive: stack on narrow screens, button becomes full width ---- */
@media (max-width: 640px) {
    .kmeral-usa-alert {
        flex-wrap: wrap;
        gap: 0.85rem 1rem;
        padding: 1rem 1.1rem;
    }
    .kmeral-usa-alert__body {
        flex: 1 1 60%;
    }
    .kmeral-usa-alert__cta {
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: center;
    }
}

/* ---- Reduced motion: no hover movement ---- */
@media (prefers-reduced-motion: reduce) {
    .kmeral-usa-alert__cta,
    .kmeral-usa-alert__cta-icon {
        transition: none;
    }
    .kmeral-usa-alert__cta:hover .kmeral-usa-alert__cta-icon,
    .kmeral-usa-alert__cta:focus-visible .kmeral-usa-alert__cta-icon {
        transform: none;
    }
}
