/* Shared primary-action treatment. Loaded last so every storefront section uses
   the same active Spareza blue, weight and interaction. */
:root {
  --action-blue: #4b74b5;
  --action-blue-hover: #3e639b;
  --action-blue-soft: #eef3f8;
  --action-blue-line: #b9cadd;
  --action-soft-bg: #eaf2ff;
  --action-soft-bg-hover: #dfeaff;
  --action-soft-line: #c8dafb;
  --action-soft-text: #245ed4;
}

/* Compatibility is a supporting action inside a product card. It must not
   compete visually with the product name, specifications or Add to cart. */
.sr-fit.sr-fit-action {
  gap: 7px !important;
  width: fit-content !important;
  min-height: 36px !important;
  margin-top: 9px !important;
  padding: 0 12px !important;
  border: 1px solid var(--action-blue-line) !important;
  border-radius: 9px !important;
  background: var(--action-blue-soft) !important;
  color: var(--action-blue-hover) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}
.sr-fit.sr-fit-action:hover {
  border-color: var(--action-blue) !important;
  background: #e3ebf5 !important;
  color: #304f7e !important;
}
.sr-fit.sr-fit-action svg {
  width: 16px !important;
  height: 16px !important;
}

/* Secondary navigation actions in section headers: "All car makes",
   "All brands", "All categories" and equivalent links. */
main
  :is(
    .section-head,
    .catalog-section-heading,
    .category-section-head,
    .brands-section-head,
    .cm-section-head,
    .cmo-section-head,
    .vmp-section-head,
    .fluids-section-head
  )
  > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid var(--action-soft-line) !important;
  border-radius: 10px !important;
  background: var(--action-soft-bg) !important;
  color: var(--action-soft-text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

main
  :is(
    .section-head,
    .catalog-section-heading,
    .category-section-head,
    .brands-section-head,
    .cm-section-head,
    .cmo-section-head,
    .vmp-section-head,
    .fluids-section-head
  )
  > a:hover {
  border-color: #a9c4f5 !important;
  background: var(--action-soft-bg-hover) !important;
  color: #1d4fc2 !important;
  text-decoration: none !important;
}

/* Secondary VIN/help links use the same soft action treatment wherever an
   older template renders them as plain text. Primary VIN CTAs stay primary. */
main
  a[href*="/vin-check"]:not(.vin-assistance-primary):not(
    .sr-vehicle-empty-primary
  ),
main
  a[href*="/vin-request"]:not(.vin-assistance-primary):not(
    .sr-vehicle-empty-primary
  ) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid var(--action-soft-line) !important;
  border-radius: 10px !important;
  background: var(--action-soft-bg) !important;
  color: var(--action-soft-text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

main
  a[href*="/vin-check"]:not(.vin-assistance-primary):not(
    .sr-vehicle-empty-primary
  ):hover,
main
  a[href*="/vin-request"]:not(.vin-assistance-primary):not(
    .sr-vehicle-empty-primary
  ):hover {
  border-color: #a9c4f5 !important;
  background: var(--action-soft-bg-hover) !important;
  color: #1d4fc2 !important;
}

/* Legacy text CTAs that perform the same secondary action. */
main
  :is(
    .seo-block-grid article,
    .brands-seo-copy,
    .faq-nav aside,
    .shipping-nav-help,
    .policy-route-grid article
  )
  a,
main a.seo-all-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid var(--action-soft-line) !important;
  border-radius: 10px !important;
  background: var(--action-soft-bg) !important;
  color: var(--action-soft-text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

main
  :is(
    .seo-block-grid article,
    .brands-seo-copy,
    .faq-nav aside,
    .shipping-nav-help,
    .policy-route-grid article
  )
  a:hover,
main a.seo-all-link:hover {
  border-color: #a9c4f5 !important;
  background: var(--action-soft-bg-hover) !important;
  color: #1d4fc2 !important;
  text-decoration: none !important;
}

/* Primary actions */
.btn-primary,
.store-search .hdr-search-btn,
.active-vehicle-actions a,
.side-form-btn:not(:disabled),
.hero-search-btn,
.add-btn,
.vehicle-select-btn,
.vc-submit,
.vc-modal-submit,
.req-submit,
.garage-add,
.garage-empty button,
.garage-card-actions .garage-primary,
.account-primary-button,
.account-record-footer a,
.cart-checkout-button,
.cart-primary-link,
.cart-mobile-checkout button,
.checkout-pay-button,
#checkout-vat-check:not(:disabled),
.sr-cart,
.sr-offer-cart,
.sr-filter-done,
.sr-mobile-car,
.sr-filter-overlay .sr-filter-done,
.sr-vehicle-empty-primary,
.sr-help a,
.vc-empty-actions .vc-empty-primary,
.tdp-buy-button {
  border-color: var(--action-blue) !important;
  background: var(--action-blue) !important;
  color: #fff !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: 0 4px 12px rgba(50, 79, 121, 0.13) !important;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease !important;
}

/* Older catalogue and product templates use their own action class names. */
.atc-btn,
.mob-atc-btn,
.related-card-btn,
.wr-submit-btn,
.vehicle-empty-btn,
.add-cart-btn,
.btn-primary-md,
.fdf-apply,
.offer-add,
.side-vehicle-btn,
.category-selected-primary,
.cv-btn,
.vrb-change {
  border-color: var(--action-blue) !important;
  background: var(--action-blue) !important;
  color: #fff !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: 0 4px 12px rgba(50, 79, 121, 0.13) !important;
}

.btn-primary:hover,
.store-search .hdr-search-btn:hover,
.active-vehicle-actions a:hover,
.side-form-btn:not(:disabled):hover,
.hero-search-btn:hover,
.add-btn:hover,
.vehicle-select-btn:hover,
.vc-submit:hover,
.vc-modal-submit:hover,
.req-submit:hover,
.garage-add:hover,
.garage-empty button:hover,
.garage-card-actions .garage-primary:hover,
.account-primary-button:hover,
.account-record-footer a:hover,
.cart-checkout-button:hover,
.cart-primary-link:hover,
.cart-mobile-checkout button:hover,
.checkout-pay-button:hover,
#checkout-vat-check:not(:disabled):hover,
.sr-cart:hover,
.sr-offer-cart:hover,
.sr-filter-done:hover,
.sr-vehicle-empty-primary:hover,
.sr-help a:hover,
.vc-empty-actions .vc-empty-primary:hover,
.tdp-buy-button:hover {
  border-color: var(--action-blue-hover) !important;
  background: var(--action-blue-hover) !important;
  box-shadow: 0 5px 14px rgba(50, 79, 121, 0.17) !important;
}

/* One compact cart action across search, OEM, vehicle-category and product
   pages. The translated action remains available as an accessible label and
   native hover tooltip. */
.catalog-cart-icon-button {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-color: var(--action-blue) !important;
  background: var(--action-blue) !important;
  color: #fff !important;
  overflow: visible !important;
  line-height: 1 !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 12px rgba(50, 79, 121, 0.16) !important;
}
.catalog-cart-icon-button:hover,
.catalog-cart-icon-button:focus-visible {
  border-color: var(--action-blue-hover) !important;
  background: var(--action-blue-hover) !important;
  color: #fff !important;
}
.catalog-cart-width-label {
  visibility: hidden;
  white-space: nowrap;
}
.catalog-cart-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-50%, -50%);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.catalog-cart-icon-button:hover .catalog-cart-icon {
  transform: translate(-50%, calc(-50% - 1px)) scale(1.04);
}
.catalog-cart-icon-button.catalog-cart-is-added .catalog-cart-icon {
  opacity: 0;
}
.catalog-cart-icon-button.catalog-cart-is-added::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "✓";
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.atc-btn:hover,
.mob-atc-btn:hover,
.related-card-btn:hover,
.wr-submit-btn:hover,
.vehicle-empty-btn:hover,
.add-cart-btn:hover,
.btn-primary-md:hover,
.fdf-apply:hover,
.offer-add:hover,
.side-vehicle-btn:hover,
.category-selected-primary:hover,
.cv-btn:hover,
.vrb-change:hover {
  border-color: var(--action-blue-hover) !important;
  background: var(--action-blue-hover) !important;
}

/* Selected controls should belong to the same palette without looking like CTAs. */
.checkout-steps .is-active b,
.checkout-check input:checked + span,
.account-record.is-open .account-expand,
.vct-category-tile.active .vct-tile-arrow,
.account-calendar-days button.selected,
.page-btn.active,
.sr-pagination .is-current {
  border-color: var(--action-blue) !important;
  background: var(--action-blue) !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(75, 116, 181, 0.22);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .store-search .hdr-search-btn,
  .side-form-btn,
  .cart-checkout-button,
  .checkout-pay-button,
  #checkout-vat-check,
  .tdp-buy-button {
    transition: none !important;
  }
}

/* Long translated brand CTAs must wrap inside the mobile content gutter. */
@media (max-width: 760px) {
  main .brands-section-head > a,
  main .brands-seo-copy a {
    box-sizing: border-box !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 10px 12px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
  }
}
