/**
 * Estilos de la tienda en la vitrina (plugin E-commerce; los publica PluginAssetPublisher y llegan al <head> del tema
 * por `storefrontStylesheets` solo con la tienda activa, porque la navegación suave no aplica @stack('styles')):
 * spinner de «Añadir al carrito», página del carrito, cupón, opciones de envío del checkout y buscador avanzado.
 */
.iw-cart-btn--busy {
    cursor: wait;
    opacity: 0.92;
    pointer-events: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}

.iw-cart-btn__busy-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.iw-cart-btn__spinner {
    flex-shrink: 0;
    display: block;
    animation: iw-cart-spin 0.65s linear infinite;
    vertical-align: middle;
}

@keyframes iw-cart-spin {
    to {
        transform: rotate(360deg);
    }
}

.cart-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
}
.cart-layout__main { min-width: 0; flex: 1 1 auto; }
.cart-layout__aside { width: 100%; flex-shrink: 0; }
@media (min-width: 640px) {
    .cart-layout {
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 2rem;
    }
    .cart-layout__main { flex: 1 1 0%; min-width: 0; }
    .cart-layout__aside {
        flex: 0 0 20rem;
        width: 20rem;
        max-width: min(20rem, 100%);
    }
}
@media (min-width: 1024px) {
    .cart-layout__aside {
        flex-basis: 22rem;
        width: 22rem;
        max-width: min(22rem, 100%);
    }
}
@media (min-width: 640px) {
    .cart-summary-sticky { position: sticky; top: 5.5rem; }
}
[data-iw-cart-page][aria-busy="true"] {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/**
 * Cupón carrito/checkout: campo + botón en la misma fila.
 */
.iw-sf-coupon-form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
}

.iw-sf-coupon-form__input.iw-sf-input {
    flex: 1 1 0% !important;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0 !important;
    max-width: none;
    height: 2.75rem;
    min-height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
}

.iw-sf-coupon-form__submit.iw-brand-btn--outline {
    box-sizing: border-box;
    flex: 0 0 auto !important;
    width: auto !important;
    height: 2.75rem;
    min-height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Opciones de envío del checkout de la tienda. */
.checkout-shipping-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    border: 1px solid rgba(163, 163, 163, 0.5);
    border-radius: 0.75rem;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    transition: border-color .15s ease;
}
.checkout-shipping-option:hover { border-color: #737373; }
.checkout-shipping-option:has(:checked) {
    border-color: #171717;
    box-shadow: 0 0 0 1px #171717;
}
.checkout-shipping-option input { margin-top: 0.2rem; flex-shrink: 0; }

/**
 * Buscador avanzado (`<x-ecommerce.advanced-search-widget>`): títulos de sección, estado en reposo y esqueleto de
 * carga. Antes cada instancia del widget pintaba este bloque en un <style> en línea (~4,9 KB por instancia; un tema con
 * el buscador en la cabecera y en el panel del celular mandaba ~9,8 KB por página); ahora sale una vez en esta hoja, que
 * el navegador guarda.
 */
.iw-widget-ec-search-advanced {
    color: #171717;
}
.iw-ec-search-dd__section-label {
    padding: 0.5rem 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #737373;
}
.iw-ec-search-panel--dropdown .iw-ec-search-dd__section-label {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.iw-ec-search-panel--inline .iw-ec-search-dd__section:first-child .iw-ec-search-dd__section-label {
    padding-top: 0;
}
.iw-widget-ec-search-advanced--modal .iw-ec-search-dd__section-label {
    padding-top: 0.125rem;
    padding-bottom: 0.25rem;
}
.iw-widget-ec-search-advanced--modal .iw-ec-search-form {
    gap: 0.5rem;
}
.iw-widget-ec-search-advanced--modal .iw-ec-search-panel--modal {
    border-top: 1px solid rgba(229, 229, 229, 0.9);
    padding-top: 0.75rem;
}
.iw-widget-ec-search-advanced--modal .iw-ec-search-panel--inline .iw-ec-search-panel__inner {
    margin-left: -0.125rem;
    margin-right: -0.125rem;
}
.iw-widget-ec-search-advanced--modal .iw-ec-list-card {
    padding-left: 0.125rem;
    padding-right: 0.125rem;
}
.iw-widget-ec-search-advanced--modal.iw-widget-ec-search-advanced--inline {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.iw-ec-search-idle {
    display: flex;
    min-height: 100%;
    flex: 1;
    padding: 0.125rem 0 0.25rem;
}
.iw-ec-search-idle__panel {
    display: flex;
    width: 100%;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    border: 1px dashed #d4d4d4;
    border-radius: 0.75rem;
    background: #fafafa;
    padding: 2.25rem 1.25rem 2.5rem;
    text-align: center;
}
.iw-ec-search-idle__icon {
    display: flex;
    height: 2.75rem;
    width: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #737373;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.iw-ec-search-idle__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: #171717;
}
.iw-ec-search-idle__hint {
    margin: 0;
    max-width: 19rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #737373;
}
.iw-ec-search-skeleton {
    padding: 0.125rem 0 0.25rem;
}
.iw-ec-search-skeleton__section-label {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a3a3a3;
}
.iw-ec-search-skeleton__section + .iw-ec-search-skeleton__section {
    margin-top: 0.875rem;
    padding-top: 0.125rem;
}
.iw-ec-search-skeleton__row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.125rem;
}
.iw-ec-search-skeleton__row + .iw-ec-search-skeleton__row {
    border-top: 1px solid rgba(229, 229, 229, 0.75);
}
.iw-ec-search-skeleton__lines {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.4375rem;
}
.iw-ec-search-skeleton__bone {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
    background: #e5e5e5;
}
.iw-ec-search-skeleton__bone::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 42%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0.45) 58%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-120%);
    animation: iw-ec-search-sweep 1.25s ease-in-out infinite;
}
@keyframes iw-ec-search-sweep {
    100% { transform: translateX(120%); }
}
.iw-ec-search-skeleton__thumb--cat {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}
.iw-ec-search-skeleton__thumb--item {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}
.iw-ec-search-skeleton__line {
    display: block;
    height: 0.625rem;
}
.iw-ec-search-skeleton__line--wide { width: 78%; }
.iw-ec-search-skeleton__line--mid { width: 54%; }
.iw-ec-search-skeleton__line--short { width: 32%; }
.iw-ec-search-dd__empty,
.iw-ec-search-dd__loading {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    color: #737373;
    text-align: center;
}
