/**
 * layout-critical.css
 * Above-the-fold shell for every page — loaded as a blocking stylesheet.
 *
 * Hero split styles live ONLY in visual-redesign.css (single source of truth).
 * This file must NOT duplicate hero layout rules.
 *
 * Load order in _Layout:
 *   1) cairo-fonts.css  2) fa-fonts.css  3) this file
 *   4) async heavy CSS  5) visual-redesign.css (last, beats bundle)
 */

/* Prevent legacy bundle hero height from clipping split hero on any viewport */
.hero-banner.hero-split {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

html,
body {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.6;
  font-family: 'Cairo', 'Cairo-fallback', 'Segoe UI', Tahoma, Arial, sans-serif;
  color: #333;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
}

* {
  font-family: 'Cairo', 'Cairo-fallback', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

.fa,
.fas,
.far,
.fab,
.fal,
.fad,
.fat,
[class*="fa-"] {
  font-family: 'Font Awesome 6 Free', 'FontAwesome' !important;
}

.fab,
.fa-brands {
  font-family: 'Font Awesome 6 Brands', 'FontAwesome' !important;
}

/* Reserve icon space before FA glyphs arrive (reduces CLS) */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
[class*="fa-"]:not(.fab-btn) {
  display: inline-block;
  min-width: 1em;
  text-align: center;
  line-height: 1;
}

img {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

main,
main[role="main"] {
  min-height: calc(100vh - 200px);
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: hidden;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.container {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container,
.content,
.wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ========== Header shell ========== */
.main-nav {
  display: none !important;
}

.main-header {
  display: block !important;
  min-height: 72px;
}

header.hero {
  display: block !important;
  position: relative;
}

header.hero .navbar {
  display: flex !important;
}

@media (min-width: 993px) {
  .menu-toggle {
    display: none !important;
  }

  .header-nav {
    display: flex !important;
  }

  .mobile-search-toggle {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .header-nav {
    display: none !important;
  }

  .header-search-desktop {
    display: none !important;
  }

  .mobile-search-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* ========== Product card skeleton (below hero, still early) ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.product-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-content {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
}

.product-description {
  color: #666;
  line-height: 1.6;
}

.btn-primary {
  background: #B45309 !important;
  background-image: none !important;
  color: #fff;
}

/* ========== Floating contact / FAB ========== */
.fixed-buttons {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999999;
  animation: none !important;
  opacity: 1 !important;
  transition: none !important;
}

.fixed-buttons .fab-btn {
  animation: none !important;
  opacity: 1 !important;
}

.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-call {
  background: #B45309;
}

.btn-whatsapp {
  background: #25D366;
}

.contact-float-icons {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 9999;
}

.contact-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.contact-icon.phone {
  background: linear-gradient(135deg, #B45309 0%, #92400E 100%);
}

.contact-icon.whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.contact-icon:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ========== Footer shell ========== */
footer.main-footer {
  background: #292524;
  color: white;
  text-align: center;
  padding: 30px 0;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== Accessibility ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Small-screen overflow guard ========== */
@media (max-width: 480px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }

  .hero-section,
  .product-grid,
  .article-grid,
  .swiper-container,
  .swiper-wrapper,
  .swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Reinforce hero image fill inside the visual frame */
  .hero-banner.hero-split .hero-visual-frame .hero-slide-visual img,
  .hero-banner.hero-split .hero-visual-stack img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  .hero-banner.hero-split {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .product-type-hero-gallery .img-item img,
  .article-type-hero-gallery .img-item img,
  .img-select .img-item img,
  .img-thumb-figure img,
  .img-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
  }

  .product-type-image-wrapper .product-type-main-image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
  }
}
