/**
 * Almathaq storefront repair layer.
 * Loaded after the active theme so the rules below can safely normalize
 * logo geometry and WooCommerce layouts without editing theme files.
 */

body.almathaq-site-fixes-active {
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   One logo, one geometry
   -------------------------------------------------------------------------- */

body.almathaq-site-fixes-active .site-header {
  height: auto !important;
  min-height: 82px !important;
}

body.almathaq-site-fixes-active .site-header .site-header__inner {
  height: auto !important;
  min-height: 82px !important;
  padding-block: 5px !important;
  align-items: center !important;
}

body.almathaq-site-fixes-active .site-header .site-branding {
  width: 138px !important;
  min-width: 138px !important;
  max-width: 138px !important;
  min-height: 72px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: visible !important;
}

body.almathaq-site-fixes-active .site-header .brand,
body.almathaq-site-fixes-active .site-header .custom-logo-link,
body.almathaq-site-fixes-active .site-header .almathaq-fixed-logo-link {
  width: 132px !important;
  height: 72px !important;
  max-width: 132px !important;
  max-height: 72px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

body.almathaq-site-fixes-active .site-header .brand img,
body.almathaq-site-fixes-active .site-header img.custom-logo,
body.almathaq-site-fixes-active .site-header img.almathaq-fixed-logo {
  width: 117px !important;
  height: 72px !important;
  max-width: 117px !important;
  max-height: 72px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Full-colour logo remains legible in the dark footer without a blank tile. */
body.almathaq-site-fixes-active .site-footer .footer-brand .brand,
body.almathaq-site-fixes-active .site-footer .footer-brand .custom-logo-link,
body.almathaq-site-fixes-active .site-footer .footer-brand .almathaq-fixed-logo-link {
  width: 176px !important;
  height: 112px !important;
  max-width: 176px !important;
  margin: 0 0 18px !important;
  padding: 10px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(231, 201, 167, .72) !important;
  border-radius: 15px !important;
  background: #fff9f2 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12) !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

body.almathaq-site-fixes-active .site-footer .footer-brand .brand img,
body.almathaq-site-fixes-active .site-footer .footer-brand img.custom-logo,
body.almathaq-site-fixes-active .site-footer .footer-brand img.almathaq-fixed-logo {
  width: 145px !important;
  height: 90px !important;
  max-width: 145px !important;
  max-height: 90px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Guard against an uploaded image injecting intrinsic white/black backgrounds. */
body.almathaq-site-fixes-active img.almathaq-fixed-logo {
  color-scheme: only light;
}

/* --------------------------------------------------------------------------
   WooCommerce product/archive layout stability
   -------------------------------------------------------------------------- */

body.almathaq-site-fixes-active.woocommerce-page .wc-main,
body.almathaq-site-fixes-active.woocommerce-page main.site-main,
body.almathaq-site-fixes-active.woocommerce-page #primary {
  min-height: 58vh;
}

body.almathaq-site-fixes-active.woocommerce-page .wc-main {
  padding-block: clamp(34px, 5vw, 68px) !important;
}

body.almathaq-site-fixes-active.single-product .woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

body.almathaq-site-fixes-active.single-product div.product {
  width: 100%;
  align-items: start;
  gap: clamp(28px, 5vw, 68px) !important;
}

body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery,
body.almathaq-site-fixes-active.single-product div.product .summary,
body.almathaq-site-fixes-active.single-product div.product .woocommerce-tabs,
body.almathaq-site-fixes-active.single-product div.product .related,
body.almathaq-site-fixes-active.single-product div.product .upsells {
  min-width: 0;
  max-width: 100%;
}

body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery {
  margin-bottom: 0 !important;
}

body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery__wrapper,
body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery__image,
body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery__image a {
  border-radius: 22px;
  overflow: hidden;
}

body.almathaq-site-fixes-active.single-product div.product .woocommerce-product-gallery__image img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #fffdfa;
}

body.almathaq-site-fixes-active.single-product div.product .summary {
  margin: 0 !important;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid #e8d8c8;
  border-radius: 22px;
  background: #fffdfa;
  box-shadow: 0 16px 42px rgba(58, 33, 27, .07);
}

body.almathaq-site-fixes-active.single-product div.product .product_title {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: clamp(1.75rem, 3.2vw, 3rem);
  overflow-wrap: anywhere;
}

body.almathaq-site-fixes-active.single-product div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

body.almathaq-site-fixes-active.single-product div.product form.cart::before,
body.almathaq-site-fixes-active.single-product div.product form.cart::after {
  display: none;
}

body.almathaq-site-fixes-active.single-product div.product form.cart .quantity .qty {
  min-height: 48px;
  border: 1px solid #e0cdbb;
  border-radius: 12px;
  background: #fff9f2;
}

body.almathaq-site-fixes-active.single-product div.product form.cart .single_add_to_cart_button {
  flex: 1 1 190px;
  min-height: 48px;
}

body.almathaq-site-fixes-active.woocommerce-page ul.products {
  width: 100%;
  clear: both;
}

body.almathaq-site-fixes-active.woocommerce-page ul.products li.product {
  min-width: 0;
  overflow: hidden;
}

body.almathaq-site-fixes-active.woocommerce-page ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  background: #fffdfa;
}

body.almathaq-site-fixes-active.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
  overflow-wrap: anywhere;
}

body.almathaq-site-fixes-active.woocommerce-page ul.products li.product .button,
body.almathaq-site-fixes-active.woocommerce-page ul.products li.product .added_to_cart {
  width: 100%;
}

body.almathaq-site-fixes-active .woocommerce-error,
body.almathaq-site-fixes-active .woocommerce-info,
body.almathaq-site-fixes-active .woocommerce-message {
  border-radius: 14px;
  border-top-width: 0;
  box-shadow: 0 10px 28px rgba(58, 33, 27, .06);
}

/* Stop third-party widgets from stretching the footer columns. */
body.almathaq-site-fixes-active .site-footer,
body.almathaq-site-fixes-active .site-footer__grid,
body.almathaq-site-fixes-active .site-footer__grid > * {
  min-width: 0;
}

@media (max-width: 1100px) {
  body.almathaq-site-fixes-active .site-header .site-branding {
    justify-content: center !important;
  }
}

@media (max-width: 782px) {
  body.almathaq-site-fixes-active .site-header,
  body.almathaq-site-fixes-active .site-header .site-header__inner {
    min-height: 70px !important;
  }

  body.almathaq-site-fixes-active .site-header .site-branding {
    width: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
    min-height: 60px !important;
  }

  body.almathaq-site-fixes-active .site-header .brand,
  body.almathaq-site-fixes-active .site-header .custom-logo-link,
  body.almathaq-site-fixes-active .site-header .almathaq-fixed-logo-link {
    width: 108px !important;
    height: 60px !important;
    max-width: 108px !important;
    max-height: 60px !important;
  }

  body.almathaq-site-fixes-active .site-header .brand img,
  body.almathaq-site-fixes-active .site-header img.custom-logo,
  body.almathaq-site-fixes-active .site-header img.almathaq-fixed-logo {
    width: 97px !important;
    height: 60px !important;
    max-width: 97px !important;
    max-height: 60px !important;
  }

  body.almathaq-site-fixes-active.single-product div.product .summary {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  body.almathaq-site-fixes-active .site-header .site-header__inner {
    gap: 6px !important;
  }

  body.almathaq-site-fixes-active .site-header .site-branding {
    width: 94px !important;
    min-width: 94px !important;
    max-width: 94px !important;
    min-height: 54px !important;
  }

  body.almathaq-site-fixes-active .site-header .brand,
  body.almathaq-site-fixes-active .site-header .custom-logo-link,
  body.almathaq-site-fixes-active .site-header .almathaq-fixed-logo-link {
    width: 92px !important;
    height: 54px !important;
    max-width: 92px !important;
    max-height: 54px !important;
  }

  body.almathaq-site-fixes-active .site-header .brand img,
  body.almathaq-site-fixes-active .site-header img.custom-logo,
  body.almathaq-site-fixes-active .site-header img.almathaq-fixed-logo {
    width: 88px !important;
    height: 54px !important;
    max-width: 88px !important;
    max-height: 54px !important;
  }

  body.almathaq-site-fixes-active .site-footer .footer-brand .brand,
  body.almathaq-site-fixes-active .site-footer .footer-brand .custom-logo-link,
  body.almathaq-site-fixes-active .site-footer .footer-brand .almathaq-fixed-logo-link {
    width: 156px !important;
    height: 100px !important;
  }

  body.almathaq-site-fixes-active .site-footer .footer-brand .brand img,
  body.almathaq-site-fixes-active .site-footer .footer-brand img.custom-logo,
  body.almathaq-site-fixes-active .site-footer .footer-brand img.almathaq-fixed-logo {
    width: 130px !important;
    height: 80px !important;
  }

  body.almathaq-site-fixes-active.single-product div.product form.cart,
  body.almathaq-site-fixes-active.single-product div.product form.cart .single_add_to_cart_button {
    width: 100%;
  }
}

