/*
 * Mustafa WP — Global Interaction System.
 * Loaded last on every front-end route.
 *
 * Goals:
 * - No hover lift/jump for buttons, links, cards or menu items.
 * - Smooth, restrained feedback through color, background, border and shadow.
 * - Preserve stateful motion such as drawer/modal opening and FAQ chevron rotation.
 * - Respect reduced-motion preferences.
 */

:root {
  --mwp-interaction-fast: 150ms;
  --mwp-interaction-base: 190ms;
  --mwp-interaction-ease: cubic-bezier(.2, .75, .2, 1);
}

/* Core clickable controls: never animate layout or position on hover. */
:where(
  a,
  button,
  [role="button"],
  summary,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  .button,
  .wp-element-button,
  .wc-block-components-button
) {
  transition-timing-function: var(--mwp-interaction-ease);
}

@media (hover: hover) and (pointer: fine) {
  :where(
    a,
    button,
    [role="button"],
    summary,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    .button,
    .wp-element-button,
    .wc-block-components-button
  ):hover {
    transform: none !important;
  }
}

:where(
  a,
  button,
  [role="button"],
  summary,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  .button,
  .wp-element-button,
  .wc-block-components-button
):active {
  transform: none !important;
}

/* Theme buttons: color/shadow feedback only, no vertical displacement. */
.mwp-btn {
  transition:
    background-color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    border-color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    box-shadow var(--mwp-interaction-base) var(--mwp-interaction-ease),
    opacity var(--mwp-interaction-base) var(--mwp-interaction-ease) !important;
}
.mwp-btn:hover,
.mwp-btn:active,
.mwp-btn:focus-visible {
  transform: none !important;
}

/* Header controls/search trigger: keep the surface response, remove motion. */
.mwp-iconbtn,
.mwp-searchtrigger {
  transition:
    color var(--mwp-interaction-fast) var(--mwp-interaction-ease),
    background-color var(--mwp-interaction-fast) var(--mwp-interaction-ease),
    border-color var(--mwp-interaction-fast) var(--mwp-interaction-ease),
    box-shadow var(--mwp-interaction-fast) var(--mwp-interaction-ease) !important;
}
.mwp-iconbtn:hover,
.mwp-iconbtn:active,
.mwp-iconbtn:focus-visible,
.mwp-searchtrigger:hover,
.mwp-searchtrigger:focus-visible {
  transform: none !important;
}
.mwp-iconbtn:hover svg,
.mwp-iconbtn:focus-visible svg {
  transform: none !important;
}

/* Navigation/search/footer/drawer links should respond without sliding sideways. */
.mwp-search-results a:hover,
.mwp-search-results a.is-active,
.mwp-footer__nav-col a:hover,
.mwp-footer__nav-col a:focus-visible,
.mwp-footer .mwp-footer__quick a:hover,
.mwp-footer .mwp-footer__quick a:focus-visible,
.mwp-drawer__panel a:hover,
.mwp-drawer__panel a:focus-visible {
  transform: none !important;
}

/* Presentational clickable cards. Their existing border/shadow hover states stay;
 * only the positional lift is removed. */
:where(
  .mwp-card,
  .mwp-topic,
  .mwp-svc-card,
  .mwp-ai-card,
  .mwp-cmp-card,
  .mwp-tool-card,
  .mwp-home-service,
  .mwp-home-hero__module,
  .mwp-home-latest-card,
  .mwp-store-product,
  .mwp-services-path,
  .mwp-service-card,
  .mwp-problem-card,
  .mwp-design-path,
  .mwp-design-related-card,
  .mwp-fix-symptom,
  .mwp-fix-related-card,
  .mwp-about-capability,
  .mwp-portfolio-case,
  .mwp-blog-category-card,
  .mwp-seo-pillar,
  .mwp-seo-related-card
) {
  transition-timing-function: var(--mwp-interaction-ease) !important;
}

@media (hover: hover) and (pointer: fine) {
  :where(
    .mwp-card,
    .mwp-topic,
    .mwp-svc-card,
    .mwp-ai-card,
    .mwp-cmp-card,
    .mwp-tool-card,
    .mwp-home-service,
    .mwp-home-hero__module,
    .mwp-home-latest-card,
    .mwp-store-product,
    .mwp-services-path,
    .mwp-service-card,
    .mwp-problem-card,
    .mwp-design-path,
    .mwp-design-related-card,
    .mwp-fix-symptom,
    .mwp-fix-related-card,
    .mwp-about-capability,
    .mwp-portfolio-case,
    .mwp-blog-category-card,
    .mwp-seo-pillar,
    .mwp-seo-related-card,
    .woocommerce ul.products li.product,
    .wc-block-grid__product,
    .wc-block-product
  ):hover {
    transform: none !important;
  }
}

/* Homepage/store controls that previously lifted on hover. */
.mwp-hero__search button:hover,
.mwp-carousel-btn:hover,
.mwp-carousel-btn:focus-visible,
.mwp-carousel-btn:active {
  transform: none !important;
}

/* Keep image feedback extremely restrained. It adds depth without moving the
 * clickable card itself or causing perceived layout jump. */
@media (hover: hover) and (pointer: fine) {
  .mwp-home-featured:hover .mwp-home-featured__media img,
  .mwp-store-product:hover .mwp-store-product__image img,
  .mwp-services-proof-card:hover .mwp-services-proof-card__media img {
    transform: scale(1.012) !important;
  }
}

/* WooCommerce controls inherit the same calm interaction language. */
.woocommerce :where(
  button.button,
  a.button,
  input.button,
  .single_add_to_cart_button,
  .mwp-buy-now-button,
  .mwp-qty-btn
),
.wc-block-components-button {
  transition:
    background-color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    border-color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    color var(--mwp-interaction-base) var(--mwp-interaction-ease),
    box-shadow var(--mwp-interaction-base) var(--mwp-interaction-ease),
    opacity var(--mwp-interaction-base) var(--mwp-interaction-ease) !important;
}

.woocommerce :where(
  button.button,
  a.button,
  input.button,
  .single_add_to_cart_button,
  .mwp-buy-now-button,
  .mwp-qty-btn
):hover,
.woocommerce :where(
  button.button,
  a.button,
  input.button,
  .single_add_to_cart_button,
  .mwp-buy-now-button,
  .mwp-qty-btn
):active,
.wc-block-components-button:hover,
.wc-block-components-button:active {
  transform: none !important;
}

/* Do not animate disabled controls. */
:where(button, input, .button, .wc-block-components-button):disabled,
:where(button, input, .button, .wc-block-components-button)[aria-disabled="true"],
:where(button, input, .button, .wc-block-components-button).disabled {
  transition: none !important;
  transform: none !important;
}

/* Stateful motion intentionally remains elsewhere:
 * - mobile drawer panel open/close
 * - search modal open/close
 * - desktop dropdown reveal
 * - FAQ/accordion chevron rotation
 * These communicate state rather than hover decoration. */

@media (prefers-reduced-motion: reduce) {
  :where(
    a,
    button,
    [role="button"],
    summary,
    input,
    select,
    textarea,
    .button,
    .wp-element-button,
    .wc-block-components-button,
    .mwp-card,
    .mwp-topic,
    .mwp-svc-card,
    .mwp-ai-card,
    .mwp-cmp-card,
    .mwp-tool-card,
    .mwp-home-service,
    .mwp-home-hero__module,
    .mwp-home-latest-card,
    .mwp-store-product,
    .mwp-services-path,
    .mwp-service-card,
    .mwp-problem-card,
    .mwp-design-path,
    .mwp-design-related-card,
    .mwp-fix-symptom,
    .mwp-fix-related-card,
    .mwp-about-capability,
    .mwp-portfolio-case,
    .mwp-blog-category-card,
    .mwp-seo-pillar,
    .mwp-seo-related-card,
    .woocommerce ul.products li.product,
    .wc-block-grid__product,
    .wc-block-product
  ) {
    transition: none !important;
  }

  .mwp-home-featured .mwp-home-featured__media img,
  .mwp-store-product .mwp-store-product__image img,
  .mwp-services-proof-card .mwp-services-proof-card__media img {
    transform: none !important;
  }
}

/* Header logo mode isolation.
 * Only one logo may participate in layout at a time. This prevents the dark
 * logo attachment from leaking into the light header, especially on mobile.
 */
.mwp-header .mwp-brand--custom {
  position: relative;
}

.mwp-header .mwp-brand__image--light {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  pointer-events: auto !important;
}

.mwp-header .mwp-brand__image--dark {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

:root[data-theme="dark"] .mwp-header .mwp-brand__image--light {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

:root[data-theme="dark"] .mwp-header .mwp-brand__image--dark {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  pointer-events: auto !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .mwp-header .mwp-brand__image--light {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
  }

  :root:not([data-theme]) .mwp-header .mwp-brand__image--dark {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    pointer-events: auto !important;
  }
}
