/* ---------- Al-Haram homepage ---------- */

/* Restore constrained widths (theme is missing wp-block-library layout CSS) */
.ahe-products > *,
.ahe-factory > *,
.ahe-why > *{max-width:1100px;margin-left:auto;margin-right:auto}
.ahe-about > *,
.ahe-cta > *{max-width:900px;margin-left:auto;margin-right:auto}
.ahe-trust__row{max-width:1100px;margin:0 auto}

/* Hero slider */
.ahe-hero{position:relative;overflow:hidden;isolation:isolate}
.ahe-hero h1{overflow-wrap:break-word}

/* Descendant selectors — theme wraps children, so '>' does not match */
.ahe-hero .ahe-hero__slides,
.ahe-hero .ahe-hero__scrim,
.ahe-hero .ahe-hero__dots{max-width:none!important;width:auto!important;margin-left:0!important;margin-right:0!important}

.ahe-hero .ahe-hero__inner{position:relative!important;z-index:2!important;max-width:900px!important;width:100%;margin-left:auto!important;margin-right:auto!important}

.ahe-hero__slides{position:absolute;inset:0;z-index:0}
.ahe-hero__slide{position:absolute;inset:0;opacity:0;transition:opacity 1.1s ease-in-out}
.ahe-hero__slide.is-active{opacity:1}
.ahe-hero__slide img{width:100%;height:100%;object-fit:cover;object-position:center center;display:block}

.ahe-hero__scrim{position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,rgba(8,26,54,.34) 0%,rgba(8,26,54,.22) 45%,rgba(8,26,54,.46) 100%)}
.ahe-hero__inner h1{text-shadow:0 2px 6px rgba(4,14,32,.85),0 4px 26px rgba(4,14,32,.65)}
.ahe-hero__inner p{text-shadow:0 1px 5px rgba(4,14,32,.9),0 3px 18px rgba(4,14,32,.6)}

.ahe-hero__dots{position:absolute;bottom:18px;left:0;right:0;z-index:3;display:flex;justify-content:center;gap:10px}
.ahe-hero__dot{width:9px;height:9px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.45);box-shadow:0 1px 4px rgba(0,0,0,.4);cursor:pointer;transition:background .3s}
.ahe-hero__dot.is-active{background:#fff}
@media (prefers-reduced-motion:reduce){.ahe-hero__slide{transition:none}}

/* Trust bar */
.ahe-trust__row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:20px}
.ahe-trust__item{display:flex;align-items:center;gap:10px;flex:1 1 200px;justify-content:center;color:#12376b;font-size:clamp(14px,2.6vw,15px);font-weight:600;line-height:1.35}
.ahe-trust__item svg{flex:0 0 auto;width:26px;height:26px;stroke:#1c6fd4;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* Product search section */
.ahe-search{background:#fff;padding:clamp(40px,8vw,60px) 20px;border-bottom:1px solid #e4ecf6}
.ahe-search__inner{max-width:760px;margin:0 auto;text-align:center}
.ahe-search__heading{color:#12376b;margin:0 0 8px;font-size:clamp(22px,5vw,30px);line-height:1.25;font-weight:700}
.ahe-search__subtext{color:#3c4a5e;margin:0 0 26px;font-size:clamp(15px,3.2vw,17px);line-height:1.7}
.ahe-search__form{display:flex;gap:8px;background:#fff;border:1px solid #cfdcec;border-radius:6px;padding:6px;box-shadow:0 1px 3px rgba(18,55,107,.08)}
.ahe-search__form:focus-within{border-color:#1c6fd4;box-shadow:0 0 0 3px rgba(28,111,212,.14)}
.ahe-search__field{flex:1 1 auto;border:0;background:transparent;padding:13px 14px;font-size:16px;color:#1e2a3a;min-width:0;font-family:inherit}
.ahe-search__field:focus{outline:0}
.ahe-search__field::placeholder{color:#8a99ad}
.ahe-search__submit{flex:0 0 auto;background:#1c6fd4;color:#fff;border:0;border-radius:4px;padding:13px 30px;font-size:16px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .18s ease}
.ahe-search__submit:hover,.ahe-search__submit:focus{background:#17529e}
.ahe-search__links{margin-top:18px;font-size:clamp(14px,3vw,15px);color:#3c4a5e;line-height:2.1}
.ahe-search__links-label{opacity:.75;margin-right:4px}
.ahe-search__links a{color:#1c6fd4;text-decoration:none;margin:0 7px;white-space:nowrap}
.ahe-search__links a:hover{text-decoration:underline}
.ahe-search__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Customisation section */
.ahe-custom{background:#fff;padding:clamp(48px,9vw,72px) 20px;border-top:1px solid #e4ecf6}
.ahe-custom__inner{max-width:1100px;margin:0 auto}
.ahe-custom__heading{color:#12376b;margin:0 0 12px;text-align:center;font-size:clamp(24px,5.5vw,34px);line-height:1.25;font-weight:700}
.ahe-custom__sub{color:#3c4a5e;margin:0 0 40px;text-align:center;font-size:clamp(15px,3.2vw,17px);line-height:1.7}
.ahe-custom__rowlabel{display:flex;align-items:center;gap:14px;color:#12376b;font-size:clamp(16px,3.4vw,19px);font-weight:600;margin:0 0 14px}
.ahe-custom__rowlabel::after{content:"";flex:1 1 auto;height:1px;background:#dbe6f3}
.ahe-custom__row{display:grid;gap:14px;margin-bottom:34px}
.ahe-custom__row:last-of-type{margin-bottom:0}
.ahe-custom__row--base,
.ahe-custom__row--logo,
.ahe-custom__row--pack{grid-template-columns:repeat(5,1fr)}
.ahe-custom__row--edge{grid-template-columns:repeat(8,1fr)}
.ahe-custom__tile{position:relative;display:block;aspect-ratio:1/1;border-radius:4px;overflow:hidden;background:#e8eff8 var(--img,none) center/cover no-repeat}
.ahe-custom__tile--label::before{content:"";position:absolute;inset:0;background:rgba(8,26,54,.34)}
.ahe-custom__tile--label span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:6px;color:#fff;font-size:clamp(12px,2.2vw,15px);font-weight:600;letter-spacing:.5px;text-transform:uppercase;text-align:center;text-shadow:0 1px 4px rgba(4,14,32,.8);line-height:1.3}
.ahe-custom__cap{display:block;margin-top:7px;text-align:center;color:#3c4a5e;font-size:clamp(11px,2.2vw,13px);line-height:1.4}
.ahe-custom__note{margin:34px 0 0;text-align:center;color:#3c4a5e;font-size:clamp(14px,3vw,16px);line-height:1.7}
.ahe-custom__note a{color:#1c6fd4}

/* Buttons: force flex row */
.ahe-hero .wp-block-buttons,
.ahe-cta .wp-block-buttons{display:flex!important;flex-wrap:wrap;justify-content:center;gap:16px;align-items:center}
.ahe-hero .wp-block-button,
.ahe-cta .wp-block-button{display:inline-block;margin:0}
.ahe-hero .wp-block-button__link,
.ahe-cta .wp-block-button__link{display:inline-block;text-decoration:none}

/* Columns: force grid */
.ahe-products .wp-block-columns{display:grid!important;grid-template-columns:repeat(4,1fr);gap:28px}
.ahe-factory .wp-block-columns{display:grid!important;grid-template-columns:repeat(3,1fr);gap:28px}
.ahe-why .wp-block-columns{display:grid!important;grid-template-columns:repeat(3,1fr);gap:32px}
.ahe-products .wp-block-column,
.ahe-factory .wp-block-column,
.ahe-why .wp-block-column{flex-basis:auto!important;margin:0!important;min-width:0}

/* Image ratios */
.ahe-products .wp-block-image img{width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;display:block}
.ahe-factory .wp-block-image img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;display:block}
.ahe-products .wp-block-image,.ahe-factory .wp-block-image{margin:0}

/* Map — constrained, not full-bleed */
.wp-block-gmap-gmap-block{max-width:900px;margin:clamp(40px,8vw,64px) auto;padding:0 20px}
.wp-block-gmap-gmap-block .embd-map{width:100%;height:300px;border:0;display:block;border-radius:6px}

/* Responsive */
@media (max-width:900px){
.ahe-why .wp-block-columns{grid-template-columns:1fr;gap:24px}
.ahe-custom__row--edge{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:781px){
.ahe-products .wp-block-columns,
.ahe-factory .wp-block-columns{grid-template-columns:1fr 1fr;gap:22px}
.ahe-trust__item{flex:1 1 45%;justify-content:flex-start}
}
@media (max-width:600px){
.ahe-hero .wp-block-buttons,.ahe-cta .wp-block-buttons{flex-direction:column;width:100%;gap:12px}
.ahe-hero .wp-block-button,.ahe-cta .wp-block-button{width:100%}
.ahe-hero .wp-block-button__link,.ahe-cta .wp-block-button__link{display:block;width:100%;text-align:center}
.ahe-hero__dots{bottom:12px}
.wp-block-gmap-gmap-block .embd-map{height:220px}
.ahe-trust__item{flex:1 1 100%}
.ahe-search__form{flex-direction:column;padding:8px}
.ahe-search__submit{width:100%}
.ahe-custom__row{gap:10px;margin-bottom:28px}
.ahe-custom__row--base,
.ahe-custom__row--logo,
.ahe-custom__row--pack,
.ahe-custom__row--edge{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:480px){
.ahe-factory .wp-block-columns{grid-template-columns:1fr}
}
