/* Inspira Woo Add-ons — Sticky Cart Bar (frontend) */

.iwa-sticky-atc {
    --iwa-paper: #FFFFFF;
    --iwa-ink: #14130F;
    --iwa-muted: #6B6862;
    --iwa-rule: #E5E0D6;
    --iwa-accent: #C8472B;
    --iwa-accent-hover: #B33D24;
    --iwa-success: #2E7D5B;
    --iwa-shadow: 0 -4px 24px rgba(20,19,15,.10);

    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--iwa-paper);
    box-shadow: var(--iwa-shadow);
    border-top: 1px solid var(--iwa-rule);
    transform: translateY(110%);
    opacity: 0;
    transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .32s ease-out;
    will-change: transform, opacity;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.iwa-sticky-atc.is-visible { transform: translateY(0); opacity: 1; }

.iwa-sticky-atc--top {
    bottom: auto; top: 0;
    border-top: 0; border-bottom: 1px solid var(--iwa-rule);
    box-shadow: 0 4px 24px rgba(20,19,15,.10);
    transform: translateY(-110%);
}
.iwa-sticky-atc--top.is-visible { transform: translateY(0); opacity: 1; }

@media (min-width: 769px) {
    .iwa-sticky-atc--mobile-only { display: none; }
}

.iwa-sticky-atc-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 12px 18px;
    display: flex; align-items: center; gap: 18px;
}
.iwa-sticky-atc-product {
    flex: 1; display: flex; align-items: center; gap: 14px;
    min-width: 0;
}
.iwa-sticky-atc-image {
    position: relative;
    flex-shrink: 0; width: 64px; height: 64px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #E5E0D6;
    background: #f4f0e8;
}
.iwa-sticky-atc-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.iwa-sticky-atc-cat-badge {
    position: absolute;
    left: 4px; bottom: 4px;
    z-index: 2;
    display: inline-block;
    max-width: calc(100% - 8px);
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 1.4;
    color: #FFFFFF;
    background: rgba(20, 19, 15, .78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}
.iwa-sticky-atc-details { flex: 1; min-width: 0; }
.iwa-sticky-atc-title {
    margin: 0 0 3px;
    font-size: 14px; font-weight: 600;
    color: var(--iwa-ink); line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.iwa-sticky-atc-price-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--iwa-ink);
    flex-wrap: wrap;
}
.iwa-sticky-atc-price ins,
.iwa-sticky-atc-price del,
.iwa-sticky-atc-price .amount {
    text-decoration: none; background: transparent;
}
.iwa-sticky-atc-price del {
    color: var(--iwa-muted);
    text-decoration: line-through;
    margin-right: 6px;
}
.iwa-sticky-atc-sep {
    color: var(--iwa-muted);
    font-weight: 300;
    opacity: .6;
}
.iwa-sticky-atc-sku {
    display: inline-flex; align-items: baseline; gap: 4px;
    font-size: 12px;
    color: var(--iwa-muted);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.iwa-sticky-atc-sku-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--iwa-muted);
    opacity: .85;
}
.iwa-sticky-atc-sku-value {
    color: var(--iwa-ink);
}
.iwa-sticky-atc-status {
    color: var(--iwa-success); font-weight: 600; font-size: 13px;
}
.iwa-sticky-atc-status-sep { color: var(--iwa-muted); margin: 0 2px; }

.iwa-sticky-atc-actions { flex-shrink: 0; }
.iwa-sticky-atc-button-container {
    position: relative; display: flex; align-items: center; gap: 8px;
}
.iwa-sticky-atc-btn {
    display: inline-block;
    position: relative;
    padding: 11px 22px;
    background: var(--iwa-sticky-btn-bg, var(--iwa-accent));
    color: var(--iwa-sticky-btn-text, #fff);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px; font-weight: 600; line-height: 1.2;
    cursor: pointer;
    transition: background-color .14s ease, opacity .14s ease, filter .14s ease;
    text-align: center; white-space: nowrap;
    border: 1px solid var(--iwa-sticky-btn-bg, var(--iwa-accent));
}
.iwa-sticky-atc-btn:hover,
.iwa-sticky-atc-btn:focus {
    background: var(--iwa-sticky-btn-bg, var(--iwa-accent-hover));
    border-color: var(--iwa-sticky-btn-bg, var(--iwa-accent-hover));
    color: var(--iwa-sticky-btn-text, #fff);
    filter: brightness(.92);
}
.iwa-sticky-atc-btn--variation {
    background: transparent;
    color: var(--iwa-sticky-btn-bg, var(--iwa-accent));
}
.iwa-sticky-atc-btn--variation:hover,
.iwa-sticky-atc-btn--variation:focus {
    background: var(--iwa-sticky-btn-bg, var(--iwa-accent));
    color: var(--iwa-sticky-btn-text, #fff);
    filter: none;
}
.iwa-sticky-atc-btn--view-cart {
    background: var(--iwa-success); border-color: var(--iwa-success); color: #fff;
}
.iwa-sticky-atc-btn--view-cart:hover,
.iwa-sticky-atc-btn--view-cart:focus {
    background: #246b4d; border-color: #246b4d; color: #fff; filter: none;
}

/* v0.3.26 — Count badge on the View Cart sticky button. Matches the
   loop marker's badge aesthetic for visual consistency across surfaces.
   Only rendered when qty > 1 (single-unit case stays clean). */
.iwa-sticky-atc-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 6px;
    background: #FFFFFF;
    color: var(--iwa-success);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.iwa-sticky-atc-btn--view-cart:hover .iwa-sticky-atc-btn-count,
.iwa-sticky-atc-btn--view-cart:focus .iwa-sticky-atc-btn-count {
    color: #246b4d;
}

/* Loader baked INTO the button — ::before pseudo-element. When the bar
 * has .is-loading, the active button (add or variation) shows a spinner
 * centered on top, button text fades out via color:transparent. */
.iwa-sticky-atc.is-loading .iwa-sticky-atc-btn--add,
.iwa-sticky-atc.is-loading .iwa-sticky-atc-btn--variation {
    color: transparent !important;
    pointer-events: none;
}
.iwa-sticky-atc.is-loading .iwa-sticky-atc-btn--add::before,
.iwa-sticky-atc.is-loading .iwa-sticky-atc-btn--variation::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: var(--iwa-sticky-btn-text, #fff);
    border-radius: 50%;
    animation: iwa-sticky-atc-spin .65s linear infinite;
}
/* Variation button is transparent — needs darker spinner contrast. */
.iwa-sticky-atc.is-loading .iwa-sticky-atc-btn--variation::before {
    border-color: rgba(0, 0, 0, .15);
    border-top-color: var(--iwa-sticky-btn-bg, var(--iwa-accent));
}
@keyframes iwa-sticky-atc-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 640px) {
    /* Stack text on top, button full-width below. */
    .iwa-sticky-atc-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px; gap: 10px;
    }
    .iwa-sticky-atc-product {
        width: 100%;
    }
    .iwa-sticky-atc-actions {
        width: 100%;
    }
    .iwa-sticky-atc-button-container {
        width: 100%;
    }
    .iwa-sticky-atc-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
    .iwa-sticky-atc-image { width: 52px; height: 52px; border-radius: 8px; }
    .iwa-sticky-atc-cat-badge { font-size: 8px; padding: 1px 5px; left: 3px; bottom: 3px; }
    .iwa-sticky-atc-title { font-size: 13px; }
    .iwa-sticky-atc-price-row { font-size: 13px; gap: 6px; }
    .iwa-sticky-atc-sku { font-size: 11px; }
    .iwa-sticky-atc-sku-label { font-size: 9px; }
}
