/*
 * Supply Solution v2 — Legacy Bridge
 *
 * Retargets high-visibility Blank/Luma/Redwoodcore selectors at design-system
 * tokens so per-store --accent overrides are visible on the *unrefactored*
 * markup. Delete a rule here as its template migrates to ss-*.
 *
 * Load AFTER tokens.css + AFTER parent styles-m.css (both handled by layout XML).
 * Rules of thumb:
 *   - Never touch red (errors), green (success), yellow (warnings).
 *   - Only recolor blue-ish "brand" surfaces.
 *   - Keep !important sparse — used only where Blank inline styles win.
 */

/* ────────────────────────────────────────────────────────────────
   1. BUTTONS — Shopify Polaris flavor
   ──────────────────────────────────────────────────────────────── */

/*
 * Polaris signature: subtle vertical gradient, sharp 8px radius,
 * top-inset highlight + bottom drop-shadow (tactile "sitting on surface"),
 * medium (500) font weight, monochrome secondary (grey — NOT accent).
 */

/* Base geometry — tight, flat, B2B */
.action.primary,
button.action-primary,
.action-primary,
.actions-toolbar > .primary .action,
.actions-toolbar > .secondary .action,
.action.secondary,
.action-secondary,
.action.tocart,
.action.subscribe,
.action.checkout,
.action.continue,
.action.save,
.action.apply,
.action.submit,
.action.update,
.action.action-cancel {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 7px 14px !important;
    min-height: 32px !important;
    border-radius: 0 !important;
    border-width: 1px !important;
    border-style: solid !important;
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 18px !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    user-select: none;
    transition:
        background   .15s ease,
        border-color .15s ease,
        color        .15s ease !important;
}

/*
 * PRIMARY — flat B2B style.
 * Solid accent fill, no outline, no gradient, no shadow. Sharp 6px radius,
 * medium weight text, quiet hover (darken to accent-hover). Tight geometry.
 */
.action.primary,
button.action-primary,
.action-primary,
.actions-toolbar > .primary .action,
.action.tocart,
.action.subscribe,
.action.checkout,
.action.continue,
.action.save,
.action.apply,
.action.submit {
    background: var(--accent) !important;
    background-color: var(--accent) !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition:
        background-color .18s ease,
        transform        .12s ease-out !important;
}
.action.primary svg path,
.action.tocart svg path,
.action.checkout svg path {
    fill: #fff;
}

.action.primary:hover,
button.action-primary:hover,
.action-primary:hover,
.actions-toolbar > .primary .action:hover,
.action.tocart:hover,
.action.subscribe:hover,
.action.checkout:hover,
.action.continue:hover,
.action.save:hover,
.action.apply:hover,
.action.submit:hover {
    background: var(--accent-hover) !important;
    background-color: var(--accent-hover) !important;
    color: #fff !important;
}

.action.primary:active,
button.action-primary:active,
.action-primary:active,
.action.tocart:active,
.action.checkout:active {
    transform: scale(.98);
}

/*
 * PRIMARY icons — injected via ::before + mask-image so the icon fill
 * follows `currentColor` and flips automatically with the text on hover.
 * No template edits needed.
 */
.action.tocart::before,
.action.checkout::before,
.action.subscribe::before,
.action.apply::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    vertical-align: -3px;
    transition: background-color .35s ease;
    flex-shrink: 0;
}

/* Cart-check (uiverse original) — Add to Cart */
.action.tocart::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M11.354 6.354a.5.5 0 0 0-.708-.708L8 8.293 6.854 7.146a.5.5 0 1 0-.708.708l1.5 1.5a.5.5 0 0 0 .708 0l3-3z'/><path d='M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1H.5zm3.915 10L3.102 4h10.796l-1.313 7h-8.17zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M11.354 6.354a.5.5 0 0 0-.708-.708L8 8.293 6.854 7.146a.5.5 0 1 0-.708.708l1.5 1.5a.5.5 0 0 0 .708 0l3-3z'/><path d='M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1H.5zm3.915 10L3.102 4h10.796l-1.313 7h-8.17zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></svg>");
}

/* Lock — Proceed to Checkout (trust cue) */
.action.checkout::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/></svg>");
}

/* Bell — Subscribe */
.action.subscribe::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z'/></svg>");
}

/*
 * Kill Blank/Luma font-icon ::before glyphs on secondary/utility buttons.
 * These render at 32px in an icons-blank-theme font and look out of place.
 * If we want icons on these buttons, we add them explicitly above.
 */
.cart-container .form-cart .action.update::before,
.abs-shopping-cart-items .action.update::before,
.block-cart-failed .action.update::before,
.action.clear::before,
.action.continue::before,
.cart-container .cart.actions .action.continue::before {
    content: none !important;
    display: none !important;
}

/* Tag — Apply (coupon) */
.action.apply::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2 1a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l4.586-4.586a1 1 0 0 0 0-1.414l-7-7A1 1 0 0 0 6.586 1H2zm4 3.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2 1a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l4.586-4.586a1 1 0 0 0 0-1.414l-7-7A1 1 0 0 0 6.586 1H2zm4 3.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z'/></svg>");
}

/*
 * SECONDARY — Polaris uses NEUTRAL grey, not accent-tinted.
 * White surface, 1px medium-grey border, dark text, subtle bottom drop.
 */
.action.secondary,
.action-secondary,
.actions-toolbar > .secondary .action,
.action.update,
.action.action-cancel {
    background: #fff !important;
    border-color: #babec3 !important;
    color: #202223 !important;
    box-shadow:
        inset 0 -1px 0 rgba(0, 0, 0, .05),
        0 1px 0 rgba(0, 0, 0, .05) !important;
}
.action.secondary:hover,
.action-secondary:hover,
.actions-toolbar > .secondary .action:hover,
.action.update:hover,
.action.action-cancel:hover {
    background: #f6f6f7 !important;
    border-color: #8c9196 !important;
    color: #202223 !important;
    box-shadow:
        inset 0 -1px 0 rgba(0, 0, 0, .05),
        0 1px 0 rgba(0, 0, 0, .06) !important;
}
.action.secondary:active,
.action-secondary:active {
    background: #f1f2f3 !important;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, .10) !important;
}

/* Focus-visible ring — a11y, keyboard nav only (Polaris uses 2px gap + 2px ring) */
.action.primary:focus-visible,
button.action-primary:focus-visible,
.action-primary:focus-visible,
.action.tocart:focus-visible,
.action.checkout:focus-visible,
.action.secondary:focus-visible,
.action-secondary:focus-visible {
    outline: none !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        inset 0 -1px 0 rgba(0, 0, 0, .10),
        0 0 0 2px #fff,
        0 0 0 4px var(--accent) !important;
}

/* Disabled — Polaris is very muted */
.action.primary[disabled],
.action.primary.disabled,
button.action-primary[disabled],
.action-primary[disabled],
.action.tocart[disabled],
.action.checkout[disabled] {
    background: #e4e5e7 !important;
    border-color: #e4e5e7 !important;
    color: #8c9196 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 1;
}
.action.secondary[disabled],
.action-secondary[disabled],
.action.update[disabled],
.action.action-cancel[disabled] {
    background: #fafbfb !important;
    border-color: #e4e5e7 !important;
    color: #8c9196 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* PLAIN — small text-only "actions" (Edit / View / Update in cart / etc.) */
.action.action-edit,
.action.action-view,
.action.action-update,
.action.viewcart,
.action.share,
.action.compare,
.action.action-hide-popup {
    color: var(--accent) !important;
    font-weight: 500 !important;
    background: none !important;
    border: none !important;
    padding: 4px 6px !important;
    box-shadow: none !important;
    transition: color .15s ease, background .15s ease !important;
}
.action.action-edit:hover,
.action.action-view:hover,
.action.action-update:hover,
.action.viewcart:hover {
    color: var(--accent-hover) !important;
    text-decoration: underline;
    background: var(--accent-soft, rgba(59, 130, 246, .06)) !important;
    border-radius: 0 !important;
}

/* ────────────────────────────────────────────────────────────────
   2. TEXT LINKS
   ──────────────────────────────────────────────────────────────── */

a,
.alink {
    color: var(--accent);
}
a:hover,
a:focus,
.alink:hover {
    color: var(--accent-hover);
}
/* Preserve chrome / neutral surfaces */
.page-header a,
.page-footer a,
.minicart-wrapper a,
.nav-sections a,
.breadcrumbs a,
.product-item a,
.action a,
.modal-header a {
    color: inherit;
}
.page-header a:hover,
.page-footer a:hover,
.breadcrumbs a:hover,
.product-item a:hover {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   3. FORMS
   ──────────────────────────────────────────────────────────────── */

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus,
.input-text:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
    outline: none;
}
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

/* Field help / hint links */
.field .note a,
.control .note a,
.field-tooltip-action {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   4. HEADER + SEARCH + MINICART
   ──────────────────────────────────────────────────────────────── */

.page-header {
    border-bottom-color: var(--border, #e2e8f0);
}
/* Search: focused input + submit button */
.block-search input:focus,
.block-search .input-text:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.block-search .action.search:not(:disabled) {
    color: var(--accent);
}
.block-search .action.search:hover {
    color: var(--accent-hover);
}

/* Minicart badge / counter */
.minicart-wrapper .action.showcart .counter.qty,
.minicart-wrapper .action.showcart .counter-number {
    background: var(--accent) !important;
    color: #fff !important;
}
/* Minicart open state */
.minicart-wrapper.active .action.showcart {
    color: var(--accent);
}
.minicart-items .product-item-name a {
    color: var(--text-primary, #0f172a);
}
.minicart-items .product-item-name a:hover {
    color: var(--accent);
}

/* Language / store switcher */
.switcher-dropdown a:hover {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   5. NAV / MEGA MENU
   ──────────────────────────────────────────────────────────────── */

.nav-sections .navigation .level0.active > .level-top,
.nav-sections .navigation .level0.has-active > .level-top {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}
.nav-sections .navigation a:hover {
    color: var(--accent);
}

/* MegaMenu (Redwoodcore_MegaMenu) */
.rwc-megamenu .level0.active > a,
.rwc-megamenu .level0:hover > a,
.rwc-megamenu-panel .megamenu-col a:hover,
.rwc-megamenu-panel .featured-link:hover,
.rwc-megamenu-panel h4 a:hover {
    color: var(--accent) !important;
}
.rwc-megamenu-panel .cta,
.rwc-megamenu-panel .action.button {
    background: var(--accent);
    color: #fff;
}
.rwc-megamenu-panel .cta:hover {
    background: var(--accent-hover);
}

/* ────────────────────────────────────────────────────────────────
   6. BREADCRUMBS + PAGINATION + TOOLBAR
   ──────────────────────────────────────────────────────────────── */

.breadcrumbs a {
    color: var(--muted, #64748b);
}
.breadcrumbs a:hover {
    color: var(--accent);
}

.pages .item.current strong,
.pages .item.current .page {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.pages a.page:hover,
.pages .action:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Toolbar sort/view/limiter */
.toolbar .modes .modes-mode.active,
.toolbar .modes .modes-mode:hover,
.toolbar .sorter-action:hover,
.toolbar .limiter-options:focus {
    color: var(--accent);
    border-color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   7. PRODUCT LISTING (PLP) + PRODUCT CARDS
   ──────────────────────────────────────────────────────────────── */

.product-item .price {
    color: var(--text-primary, #0f172a);
}
.product-item .old-price .price {
    color: var(--muted, #64748b);
}
.product-item-name a:hover,
.product-item .product-item-link:hover {
    color: var(--accent);
}
.product-item .action.tocompare,
.product-item .action.towishlist {
    color: var(--muted, #64748b);
}
.product-item .action.tocompare:hover,
.product-item .action.towishlist:hover {
    color: var(--accent);
}

/* "Sale" / "New" / "Hot" badges — only if they use default blue */
.product-item .badge-sale,
.product-item .product-badge.badge-blue {
    background: var(--accent);
    color: #fff;
}

/* Wishlist active */
.product-item .action.towishlist.added,
.action.towishlist[aria-pressed="true"] {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   8. PRODUCT DETAIL (PDP)
   ──────────────────────────────────────────────────────────────── */

.product-info-main .price-final_price .price,
.product-info-price .price-final_price .price {
    color: var(--text-primary, #0f172a);
}
/* Tabs */
.product.data.items > .item.title.active > .switch,
.product.data.items > .item.title > .switch:hover,
.data.switch.active {
    color: var(--accent) !important;
    border-bottom-color: var(--accent) !important;
}
/* Swatch selected */
.swatch-attribute .swatch-option.selected,
.swatch-option.color.selected,
.swatch-option.image.selected,
.swatch-option.text.selected {
    border-color: var(--accent) !important;
    outline: 2px solid var(--accent-soft);
}
/* Configurable options label active */
.super-attribute-select:focus,
.product-options-wrapper .active .field.choice {
    border-color: var(--accent);
}
/* Add-to links (add to wishlist / compare on PDP) */
.product-social-links a:hover,
.product-addto-links a:hover {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   9. CART + CHECKOUT
   ──────────────────────────────────────────────────────────────── */

/* Qty stepper */
.cart.table-wrapper .qty .input-text:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.cart .action-edit,
.cart .action-delete,
.cart .action-towishlist {
    color: var(--muted, #64748b);
}
.cart .action-edit:hover,
.cart .action-towishlist:hover {
    color: var(--accent);
}
.cart-summary .checkout-methods-items .action.primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}
/* Coupon block "Apply" */
.cart-container .discount .action.apply {
    background: var(--accent);
    border-color: var(--accent);
}

/* Checkout progress bar */
.opc-progress-bar-item._active > span:before,
.opc-progress-bar-item._active > span:after {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}
.opc-progress-bar-item._active > span {
    color: var(--accent);
}
/* Selected shipping/payment method */
.opc-block-shipping-information .action-edit,
.checkout-payment-method .payment-method._active .payment-method-title {
    color: var(--accent);
}
.checkout-payment-method .payment-method._active .payment-method-title label {
    color: var(--text-primary, #0f172a);
}

/* ────────────────────────────────────────────────────────────────
   10. ACCOUNT / SIDEBAR NAV
   ──────────────────────────────────────────────────────────────── */

.account .sidebar-main .item.current a,
.account .sidebar-main .item.current strong,
.account-nav .item.current strong,
.account-nav .item.current a {
    border-left: 3px solid var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.account-nav a:hover {
    color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────
   11. MODALS + MESSAGES + TOOLTIPS
   ──────────────────────────────────────────────────────────────── */

.modal-popup .modal-header .action-close,
.modal-slide .modal-header .action-close {
    color: var(--muted, #64748b);
}
.modal-popup .modal-header .action-close:hover {
    color: var(--accent);
}
.modal-popup .action-primary,
.modal-slide .action-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.message.info {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-hover);
}

.field-tooltip .field-tooltip-content {
    border-color: var(--accent-border);
}

/* ────────────────────────────────────────────────────────────────
   12. FOOTER
   ──────────────────────────────────────────────────────────────── */

.page-footer .footer-columns a:hover,
.page-footer .newsletter .action.subscribe {
    color: var(--accent);
}
.page-footer .newsletter .action.subscribe {
    background: var(--accent);
    color: #fff;
}
.page-footer .newsletter .action.subscribe:hover {
    background: var(--accent-hover);
}
