/*
 * آریاز صنعت — Hero Banner Slider CSS v6.3
 * کلاس‌ها: .ahb (ariaz hero banner)
 * fix v6.3: visibility-based show/hide (نه display:none) → تصویر همیشه لود می‌شه
 */

.ahb {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--az-bg-deep);
    direction: rtl;
    /* min-height لازمه چون همه slides absolute هستند */
    min-height: 352px;
}

/* ══ SLIDE ══ */
.ahb__slide {
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* visibility:hidden نه display:none — تصویر لود می‌شه ولی نمایش داده نمی‌شه */
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    visibility: hidden;
    opacity: 0;
    width: 100%;
    min-height: 352px;
    /* flex برای align-items روی inner */
    display: flex;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), visibility 0s 0.7s;
}
.ahb__slide.is-active {
    position: relative;     /* اسلاید active فضا می‌گیره */
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
    transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), visibility 0s 0s;
    animation: ahb-in 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
.ahb__slide.is-leaving {
    visibility: visible;
    opacity: 0;
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; pointer-events: none;
    animation: ahb-out 0.4s ease both;
}
@keyframes ahb-in  { from{opacity:0} to{opacity:1} }
@keyframes ahb-out { from{opacity:1} to{opacity:0} }

/* ══ BACKGROUND ══ */
.ahb__bg {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; overflow: hidden;
    width: 100%; height: 100%; min-height: inherit; /* Edge fix */
}
.ahb__bg--plain {
    background: linear-gradient(135deg, #EEF4F8 0%, #F4F6F8 100%);
}
[data-theme="dark"] .ahb__bg--plain {
    background: linear-gradient(135deg, #0d1520 0%, #080c10 100%);
}
.ahb__bg--plain::before {
    content: '';
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background-image:
        linear-gradient(rgba(11,79,108,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11,79,108,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
}

.ahb__bg picture {
    display: block;
    width: 100%; height: 100%;
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
}

.ahb__bg-img {
    width: 100%; height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    font-family: 'object-fit: cover';
    object-position: center 25%;
    display: block;
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; /* Edge: بدون این تصویر collapse می‌کنه */
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
    transition: transform 9s ease-out;
}
.ahb__slide.is-active .ahb__bg-img { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); }

.ahb__bg-overlay {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(
        to left,
        rgba(0,0,0,0.50) 0%,
        rgba(0,0,0,0.25) 40%,
        rgba(0,0,0,0.05) 70%,
        transparent 100%
    );
}

/* ══ INNER ══ */
.ahb__inner {
    position: relative; z-index: 2;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 352px;
}

/* ══ CONTENT BOX ══ */
.ahb__content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 26px 26px 22px;
    border-radius: 14px;
    direction: rtl;
    animation: ahb-slide-in 0.7s 0.1s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes ahb-slide-in {
    from { opacity:0; transform: translateX(18px); }
    to   { opacity:1; transform: none; }
}

/* glass — با تصویر */
.ahb__content--glass {
    background: rgba(8, 12, 18, 0.28);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 6px 32px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* plain — بدون تصویر */
.ahb__content--plain {
    background: transparent;
    max-width: 680px;
    padding: 48px 0;
    gap: 16px;
}

/* ══ BADGE ══ */
.ahb__badge {
    display: inline-flex; align-items: center; gap: 8px;
    border-radius: 100px; padding: 4px 12px;
    font-size: 11px; font-weight: 700; width: fit-content;
}
.ahb__content--glass .ahb__badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.88);
}
.ahb__content--plain .ahb__badge {
    background: var(--az-accent-dim);
    border: 1px solid var(--az-border-accent);
    color: var(--az-brand);
}
[data-theme="dark"] .ahb__content--plain .ahb__badge { color: var(--az-accent); }

.ahb__badge-dot {
    width: 6px; height: 6px; flex-shrink: 0;
    background: var(--az-accent); border-radius: 50%;
    box-shadow: 0 0 6px var(--az-accent-glow);
    animation: ahb-pulse 2s ease-in-out infinite;
}
@keyframes ahb-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.75)} }

/* ══ TITLE ══ */
.ahb__title {
    font-size: clamp(17px, 1.8vw, 26px);
    font-weight: 900; line-height: 1.45; margin: 0;
}
.ahb__content--glass .ahb__title { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.ahb__content--plain .ahb__title { color: var(--az-text); }
[data-theme="dark"] .ahb__content--plain .ahb__title { color: #E2E8F0; }

/* هایلایت + خط زیر animated */
.ahb__title .hl { position: relative; display: inline; }
.ahb__content--glass .ahb__title .hl { color: var(--az-accent); }
.ahb__content--plain .ahb__title .hl { color: var(--az-brand); }
[data-theme="dark"] .ahb__content--plain .ahb__title .hl { color: var(--az-accent); }

.ahb__title .hl::after {
    content: '';
    position: absolute; bottom: -2px; right: 0;
    height: 2px; width: 0; border-radius: 1px;
    transition: width 0.8s 0.45s cubic-bezier(0.16,1,0.3,1);
}
.ahb__content--glass .ahb__title .hl::after {
    background: linear-gradient(90deg, var(--az-accent), transparent);
}
.ahb__content--plain .ahb__title .hl::after {
    background: linear-gradient(90deg, var(--az-brand), transparent);
}
[data-theme="dark"] .ahb__content--plain .ahb__title .hl::after {
    background: linear-gradient(90deg, var(--az-accent), transparent);
}
.ahb__slide.is-active .ahb__title .hl::after { width: 100%; }

/* ══ SUBTITLE ══ */
.ahb__subtitle {
    font-size: 12px; font-weight: 600; margin: 0; line-height: 1.6;
}
.ahb__content--glass .ahb__subtitle { color: rgba(255,255,255,0.80); }
.ahb__content--plain .ahb__subtitle { color: var(--az-text-sec); font-size: 15px; }

/* ══ DESC ══ */
.ahb__desc { font-size: 11px; margin: 0; line-height: 1.7; }
.ahb__content--glass .ahb__desc { color: rgba(255,255,255,0.60); }
.ahb__content--plain .ahb__desc { color: var(--az-text-sec); font-size: 14px; }

/* ══ BUTTONS ══ */
.ahb__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ahb__btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--az-font, 'Vazirmatn', sans-serif);
    font-size: 12px; font-weight: 800;
    padding: 8px 16px; border-radius: 8px;
    border: none; cursor: pointer; text-decoration: none;
    transition: transform 0.22s, box-shadow 0.22s; white-space: nowrap;
}
.ahb__btn:hover { transform: translateY(-2px); }

.ahb__btn--primary {
    background: var(--az-accent); color: #fff;
    box-shadow: 0 4px 14px var(--az-accent-glow);
}
.ahb__btn--primary:hover { box-shadow: 0 6px 22px var(--az-accent-glow); color: #fff; }
[data-theme="dark"] .ahb__btn--primary { color: #000; }

/* ══ DIVIDER ══ */
.ahb__divider {
    width: 100%; height: 1px; border: none; margin: 0;
    background: rgba(255,255,255,0.10);
}
.ahb__content--plain .ahb__divider { background: var(--az-border); }

/* ══ TRUST ══ */
.ahb__trust { display: flex; gap: 12px; flex-wrap: wrap; }
.ahb__trust-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600;
}
.ahb__content--glass .ahb__trust-item { color: rgba(255,255,255,0.60); }
.ahb__content--glass .ahb__trust-item svg { color: var(--az-accent); opacity: 0.8; }
.ahb__content--plain .ahb__trust-item { color: var(--az-text-muted); }
.ahb__content--plain .ahb__trust-item svg { color: var(--az-accent); }

/* ══ DOTS ══ */
.ahb__dots {
    position: absolute; bottom: 12px; right: 50%;
    transform: translateX(50%);
    display: flex; gap: 6px; z-index: 10;
}
.ahb__dot {
    width: 6px; height: 6px; border-radius: 50%; border: none; padding: 0;
    background: rgba(255,255,255,0.35); cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.ahb__dot.is-active {
    background: var(--az-accent); width: 20px; border-radius: 3px;
    box-shadow: 0 0 6px var(--az-accent-glow);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
    .ahb          { min-height: 308px; }
    .ahb__slide   { min-height: 308px; }
    .ahb__inner   { min-height: 308px; padding: 0 28px; }
    .ahb__content { max-width: 340px; padding: 22px 20px 18px; gap: 8px; }
}

@media (max-width: 768px) {
    .ahb          { min-height: 286px; }
    .ahb__slide { min-height: 286px; }

    /* موبایل: تصویر به‌جای برش از چپ/راست، فشرده می‌شود تا کل بنر دیده شود */
    .ahb__bg-img {
        -o-object-fit: fill;
        object-fit: fill;
        object-position: center center;
    }

    .ahb__inner {
        min-height: 286px;
        padding: 0 14px 36px;
        align-items: flex-end;
        justify-content: flex-start;
    }

    /* باکس حداکثر 52% — تصویر از سمت چپ دیده می‌شه */
    .ahb__content {
        max-width: 52%;
        min-width: 200px;
        padding: 14px 14px 12px;
        gap: 7px;
        border-radius: 12px;
    }

    .ahb__content--glass {
        background: rgba(8, 12, 18, 0.38);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    /* overlay موبایل — از پایین تاریک */
    .ahb__bg-overlay {
        background: linear-gradient(
            to top,
            rgba(0,0,0,0.60) 0%,
            rgba(0,0,0,0.15) 50%,
            rgba(0,0,0,0.00) 100%
        );
    }

    .ahb__title    { font-size: clamp(14px, 3.5vw, 18px); }
    .ahb__subtitle { font-size: 11px; }
    .ahb__desc     { display: none; }
    .ahb__trust    { gap: 8px; }
    .ahb__trust-item { font-size: 9px; }
    .ahb__trust-item svg { width: 10px; height: 10px; }
    .ahb__btn      { font-size: 11px; padding: 7px 12px; }
    .ahb__divider  { display: none; }
}

@media (max-width: 480px) {
    .ahb          { min-height: 264px; }
    .ahb__slide { min-height: 264px; }
    .ahb__inner { min-height: 264px; }
    .ahb__content { max-width: 58%; min-width: 160px; }
}

/* ══ VARIED TRANSITIONS v7.0 ══ */
/* t-slide: ورود از سمت راست (RTL) */
.ahb__slide.is-active.t-slide   { animation: ahb-rtl-enter 0.72s cubic-bezier(0.16,1,0.3,1) both; }
.ahb__slide.is-leaving.t-slide  { animation: ahb-rtl-leave 0.45s ease both; }
@keyframes ahb-rtl-enter { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform:none; } }
@keyframes ahb-rtl-leave { from { opacity:1; } to { opacity:0; transform: translateX(-22px); } }

/* t-zoom-out: زوم خروج */
.ahb__slide.is-active.t-zoom-out  { animation: ahb-zoom-enter 0.70s cubic-bezier(0.16,1,0.3,1) both; }
.ahb__slide.is-leaving.t-zoom-out { animation: ahb-zoom-leave 0.40s ease both; }
@keyframes ahb-zoom-enter { from { opacity:0; transform: scale(1.07); } to { opacity:1; transform:scale(1); } }
@keyframes ahb-zoom-leave { from { opacity:1; } to { opacity:0; transform: scale(0.93); } }

/* t-blur: بلور فید */
.ahb__slide.is-active.t-blur  { animation: ahb-blur-enter 0.65s ease both; }
.ahb__slide.is-leaving.t-blur { animation: ahb-blur-leave 0.40s ease both; }
@keyframes ahb-blur-enter { from { opacity:0; filter:blur(10px) saturate(0.5); } to { opacity:1; filter:blur(0) saturate(1); } }
@keyframes ahb-blur-leave { from { opacity:1; filter:blur(0); } to { opacity:0; filter:blur(6px); } }
