/* Arabic storefront only. The locale is verified in layout.jinja via session.lang. */
@import url('https://fonts.googleapis.com/css2?family=Lalezar&family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

html[lang="ar"] body,
html[lang="ar"] body * {
  font-family: "Noto Kufi Arabic", sans-serif !important;
}

/* Preserve the theme icon font inside the Arabic storefront. The broad body
   rule above otherwise replaces icomoon with the Arabic text font. */
html[lang="ar"] [class^="icon-"],
html[lang="ar"] [class*=" icon-"] {
  font-family: "icomoon" !important;
}

/* Keep the existing heading/body separation: Lalezar is only for prominent titles. */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .h1,
html[lang="ar"] .h2,
html[lang="ar"] .h3,
html[lang="ar"] .h4,
html[lang="ar"] .h5,
html[lang="ar"] .h6,
html[lang="ar"] .section-title,
html[lang="ar"] .heading-block.h1,
html[lang="ar"] .products-title-section h1,
html[lang="ar"] .products-title-section h2,
html[lang="ar"] .products-title-section h3,
html[lang="ar"] .blog-title h1,
html[lang="ar"] .product-tile__title,
html[lang="ar"] .mega-menu__item-title {
  font-family: "Lalezar", sans-serif !important;
}

/* Requested Arabic-only headings that use the body font rather than Lalezar. */
html[lang="ar"] .announcement-bar .announcement-bar__message,
html[lang="ar"] .announcement-bar .announcement-text,
html[lang="ar"] .primary-footer .footer-navigation .section-title,
html[lang="ar"] .primary-footer .socials > span,
html[lang="ar"] .faqs-title,
html[lang="ar"] .blog-title h1.contest-giveaway-title {
  font-family: "Noto Kufi Arabic", sans-serif !important;
}

/* Allow the Arabic announcement to grow with wrapped text on small screens. */
@media (max-width: 767px) {
  html[lang="ar"] .announcement-bar {
    height: auto !important;
    min-height: 43px;
  }

  html[lang="ar"] .announcement-bar > .container {
    height: auto !important;
    min-height: 43px;
    align-items: center;
  }

  html[lang="ar"] .announcement-bar > .container > a {
    display: block;
    width: 100%;
  }

  html[lang="ar"] .announcement-bar .announcement-bar__message {
    width: 100%;
    margin: 0;
    padding: 6px 15px;
    line-height: 1.8;
    text-align: center;
    white-space: normal;
    overflow: visible;
  }
}

/* Main-menu dropdown items only; preserve the existing menu dimensions and behavior. */
html[lang="ar"] #primary-top-nav .sub-menu,
html[lang="ar"] #primary-top-nav .sub-menu .nav-link,
html[lang="ar"] #primary-top-nav .sub-menu .menu-item {
  text-align: right;
}

/* Category titles remain in the existing card, but overlay the image at bottom-right. */
html[lang="ar"] .categories-mega-menu-section .mega-menu__item {
  position: relative;
  overflow: hidden;
}

html[lang="ar"] .categories-mega-menu-section .mega-menu__item-title {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  width: calc(100% - 32px);
  margin: 0;
  color: #fff;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

html[lang="ar"] .categories-mega-menu-section .article__grid-image {
  display: block;
}

/* Current storefront category carousel cards use the existing category-item markup. */
html[lang="ar"] .home-categories-section .category-item,
html[lang="ar"] .category-page-slider .category-item,
html[lang="ar"] .categories-slider .category-item {
  position: relative;
  overflow: hidden;
}

html[lang="ar"] .home-categories-section .category-item h3,
html[lang="ar"] .category-page-slider .category-item h3,
html[lang="ar"] .categories-slider .category-item h3 {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: calc(100% - 24px);
  margin: 0;
  color: #fff;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* Footer selectors match footer-content.jinja exactly. Keep the existing
   columns and responsive flow; change only Arabic typography/alignment. */
html[lang="ar"] .primary-footer__lower .footer-navigation > .col-md-4,
html[lang="ar"] .primary-footer__lower .footer-navigation .section-title,
html[lang="ar"] .primary-footer__lower .footer-navigation ul,
html[lang="ar"] .primary-footer__lower .footer-navigation li,
html[lang="ar"] .primary-footer__lower .footer-navigation a,
html[lang="ar"] .primary-footer__lower .socials,
html[lang="ar"] .primary-footer__lower .socials > span {
  text-align: right !important;
}

html[lang="ar"] .primary-footer__lower .footer-navigation .section-title,
html[lang="ar"] .primary-footer__lower .footer-navigation a,
html[lang="ar"] .primary-footer__lower .socials > span {
  font-family: "Noto Kufi Arabic", sans-serif !important;
}

/* Keep the existing footer columns; align the copyright to the logical right
   edge and give the existing social icons the spacing shown in the reference. */
html[lang="ar"] .primary-footer__lower .row.mt-5 > .col-md-8 > span {
  display: block;
  text-align: right !important;
  width: 100%;
}

html[lang="ar"] .primary-footer .socials .social-icons li:not(:last-of-type) {
  margin-right: 4px !important;
}

/* Use the existing expand_more1 icon and preserve its open/closed state. */
html[lang="ar"] .faqs-title .accordion-icon {
  display: inline-block;
  margin-inline-start: 0.35em;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

html[lang="ar"] .faqs-title[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

@media (max-width: 767px) {
  html[lang="ar"] .categories-mega-menu-section .mega-menu__item-title {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }

  html[lang="ar"] .home-categories-section .category-item h3,
  html[lang="ar"] .category-page-slider .category-item h3,
  html[lang="ar"] .categories-slider .category-item h3 {
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
  }
}
