/*
 * آریاز صنعت — Mobile Action Bar
 * گلس‌مورفیسم حرفه‌ای — فقط موبایل و تبلت (max-width: 1024px)
 * 5 آیتم: ورود/داشبورد | دسته‌بندی‌ها | چت (مرکز) | ارتباط | دارک‌مود
 */

/* ══════════════════════════════════════════════════════
   ACTION BAR — نوار اصلی
══════════════════════════════════════════════════════ */
.az-action-bar {
    display: none;
    position: fixed;
    bottom: 5px;
    left: 8px;
    right: 8px;
    z-index: 9980;
    border-radius: 22px;
    direction: rtl;

    /* Glass morphism */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(28px) saturate(1.9);
    -webkit-backdrop-filter: blur(28px) saturate(1.9);
    border: 1px solid rgba(255, 255, 255, 0.60);
    box-shadow:
        0 8px 32px rgba(11, 79, 108, 0.13),
        0 2px 8px rgba(0, 0, 0, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .az-action-bar {
    background: rgba(22, 29, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.50),
        0 2px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.az-action-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 7px 4px;
}

/* ── هر آیتم ── */
.az-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 16px;
    color: var(--az-text-sec);
    font-family: var(--az-font, 'Vazirmatn', Tahoma, sans-serif);
    font-size: 10px;
    font-weight: 700;
    transition:
        background 0.22s cubic-bezier(0.16,1,0.3,1),
        color 0.22s ease,
        transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    position: relative;
}

.az-action-btn:hover,
.az-action-btn:focus-visible {
    background: rgba(11, 79, 108, 0.07);
    color: var(--az-brand);
    outline: none;
}

[data-theme="dark"] .az-action-btn:hover {
    background: rgba(56, 189, 248, 0.10);
    color: var(--az-brand);
}

.az-action-btn:active {
    transform: scale(0.90);
    transition-duration: 0.08s;
}

.az-action-btn.is-active {
    color: var(--az-brand);
}

/* آیکون wrapper */
.az-action-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.az-action-btn:hover .az-action-btn__icon,
.az-action-btn.is-active .az-action-btn__icon {
    transform: translateY(-1px);
}

/* ── آیتم مرکز (چت) ── */
.az-action-btn--center .az-action-btn__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--az-brand);
    color: #fff;
    box-shadow:
        0 4px 16px rgba(11,79,108,0.35),
        0 1px 4px rgba(11,79,108,0.20);
    margin-top: -12px;
    transition:
        transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
        box-shadow 0.22s ease;
}

[data-theme="dark"] .az-action-btn--center .az-action-btn__icon {
    background: var(--az-brand);
    box-shadow: 0 4px 16px rgba(56,189,248,0.28);
}

.az-action-btn--center:hover .az-action-btn__icon,
.az-action-btn--center.is-active .az-action-btn__icon {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 8px 22px rgba(11,79,108,0.42),
        0 2px 6px rgba(11,79,108,0.25);
}

.az-action-btn--center {
    color: var(--az-brand);
}

/* badge */
.az-action-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--az-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--az-bg-panel);
    line-height: 1;
    animation: az-badge-pulse 2.5s ease-in-out infinite;
}

@keyframes az-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,159,28,0.4); }
    50%       { box-shadow: 0 0 0 4px rgba(255,159,28,0); }
}

/* لیبل */
.az-action-btn__label {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 54px;
    line-height: 1;
    letter-spacing: 0.1px;
}

/* ── آیکون‌های دارک/لایت مود ── */
.az-theme-icon-light { display: flex; }
.az-theme-icon-dark  { display: none;  }

[data-theme="dark"] .az-theme-icon-light { display: none;  }
[data-theme="dark"] .az-theme-icon-dark  { display: flex; }

/* ══════════════════════════════════════════════════════
   SHEETS — کانتینر مشترک
══════════════════════════════════════════════════════ */
.az-bar-sheet {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
}

.az-bar-sheet__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.30s ease;
}

.az-bar-sheet__panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 24px 24px 0 0;
    background: var(--az-bg-panel);
    border-top: 2px solid var(--az-accent);
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(105%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    direction: rtl;
    will-change: transform;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.az-bar-sheet__panel::-webkit-scrollbar { display: none; }

[data-theme="dark"] .az-bar-sheet__panel {
    box-shadow: 0 -12px 48px rgba(0,0,0,0.55);
}

.az-bar-sheet.is-open {
    pointer-events: auto;
}

.az-bar-sheet.is-open .az-bar-sheet__overlay {
    opacity: 1;
}

.az-bar-sheet.is-open .az-bar-sheet__panel {
    transform: translateY(0);
}

/* handle */
.az-sheet-handle {
    width: 38px;
    height: 4px;
    background: var(--az-border);
    border-radius: 2px;
    margin: 10px auto 0;
}

/* هدر شیت */
.az-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--az-border);
    position: sticky;
    top: 0;
    background: var(--az-bg-panel);
    z-index: 2;
}

.az-sheet-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--az-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.az-sheet-title svg { color: var(--az-brand); flex-shrink: 0; }

.az-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--az-border);
    background: transparent;
    color: var(--az-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.20s ease;
    flex-shrink: 0;
}

.az-sheet-close:hover {
    background: rgba(220,38,38,0.07);
    border-color: rgba(220,38,38,0.3);
    color: #dc2626;
    transform: rotate(90deg);
}

/* ══════════════════════════════════════════════════════
   SHEET: دسته‌بندی‌ها
══════════════════════════════════════════════════════ */
.az-cats-search {
    padding: 12px 16px;
    position: sticky;
    top: 55px;
    background: var(--az-bg-panel);
    z-index: 1;
    border-bottom: 1px solid var(--az-border);
}

.az-cats-search__input {
    width: 100%;
    background: var(--az-bg-deep);
    border: 1.5px solid var(--az-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: var(--az-font, 'Vazirmatn', Tahoma, sans-serif);
    color: var(--az-text);
    direction: rtl;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.az-cats-search__input:focus {
    border-color: var(--az-brand);
    box-shadow: 0 0 0 3px rgba(11,79,108,0.08);
}

.az-cats-search__input::placeholder { color: var(--az-text-muted); }

.az-cats-list { padding: 8px 0 8px; }

/* ردیف دسته */
.az-cat-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 20px;
    color: var(--az-text);
    text-decoration: none;
    transition: background 0.14s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--az-font, 'Vazirmatn', Tahoma, sans-serif);
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
}

.az-cat-row:hover { background: var(--az-bg-deep); }
.az-cat-row:active { background: rgba(11,79,108,0.05); }
.az-cat-row:focus-visible { outline: 2px solid var(--az-brand); outline-offset: -2px; }

/* آیکون دسته */
.az-cat-row__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--az-bg-deep);
    border: 1px solid var(--az-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--az-brand);
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.az-cat-row:hover .az-cat-row__icon { transform: scale(1.07); }

.az-cat-row__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.az-cat-row__body { flex: 1; min-width: 0; text-align: right; }

.az-cat-row__name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--az-text);
    line-height: 1.3;
    margin-bottom: 2px;
}

.az-cat-row__count {
    font-size: 11px;
    color: var(--az-text-muted);
    font-weight: 500;
}

.az-cat-row__arrow {
    color: var(--az-text-muted);
    flex-shrink: 0;
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.22s cubic-bezier(0.16,1,0.3,1);
}

.az-cat-row:hover .az-cat-row__arrow { opacity: 0.85; transform: translateX(-3px); }

.az-cat-row--expandable[aria-expanded="true"] .az-cat-row__arrow {
    transform: rotate(180deg);
    opacity: 0.85;
}

/* زیردسته‌ها */
.az-cat-children {
    display: none;
    padding: 2px 20px 6px 20px;
    flex-direction: column;
    gap: 2px;
    border-right: 2px solid var(--az-border);
    margin-right: 32px;
    margin-left: 20px;
}

.az-cat-children.is-open {
    display: flex;
    animation: az-children-in 0.22s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes az-children-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.az-subcat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--az-text-sec);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.14s, color 0.14s;
    -webkit-tap-highlight-color: transparent;
}

.az-subcat-row:hover {
    background: var(--az-accent-dim);
    color: var(--az-brand);
}

.az-subcat-row::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--az-border);
    flex-shrink: 0;
    transition: background 0.14s, transform 0.2s;
}

.az-subcat-row:hover::before {
    background: var(--az-accent);
    transform: scale(1.4);
}

.az-cat-divider {
    height: 1px;
    background: var(--az-border);
    margin: 3px 20px;
    opacity: 0.5;
}

/* ══════════════════════════════════════════════════════
   SHEET: ارتباط با ما
══════════════════════════════════════════════════════ */
.az-contact-body { padding: 4px 0 8px; }

.az-contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    text-decoration: none;
    color: var(--az-text);
    transition: background 0.14s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--az-font, 'Vazirmatn', Tahoma, sans-serif);
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
}

.az-contact-item:hover { background: var(--az-bg-deep); }

.az-contact-item__ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.az-contact-item:hover .az-contact-item__ico { transform: scale(1.08); }

.az-contact-item__ico--phone  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.az-contact-item__ico--office { background: linear-gradient(135deg, var(--az-brand), #0a3d56); }
.az-contact-item__ico--tel    { background: linear-gradient(135deg, #0088cc, #006699); }
.az-contact-item__ico--whats  { background: linear-gradient(135deg, #25d366, #128c7e); }
.az-contact-item__ico--ita    { background: linear-gradient(135deg, #7e3ff2, #5b21b6); }
.az-contact-item__ico--map    { background: linear-gradient(135deg, var(--az-accent), #d97706); }
.az-contact-item__ico--addr   { background: linear-gradient(135deg, #64748b, #475569); }

.az-contact-item__body { flex: 1; min-width: 0; text-align: right; }

.az-contact-item__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--az-text);
    margin-bottom: 2px;
}

.az-contact-item__value {
    display: block;
    font-size: 12px;
    color: var(--az-text-muted);
    direction: ltr;
    text-align: right;
    unicode-bidi: plaintext;
}

.az-contact-item__arrow {
    color: var(--az-text-muted);
    opacity: 0.30;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.az-contact-item:hover .az-contact-item__arrow {
    opacity: 0.75;
    transform: translateX(-3px);
}

.az-contact-divider {
    height: 1px;
    background: var(--az-border);
    margin: 2px 20px;
    opacity: 0.55;
}

/* آدرس */
.az-contact-address {
    margin: 8px 16px 12px;
    padding: 14px 16px;
    background: var(--az-bg-deep);
    border: 1px solid var(--az-border);
    border-radius: 14px;
}

.az-contact-address__label {
    font-size: 10px;
    font-weight: 700;
    color: var(--az-text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.az-contact-address__label::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--az-accent);
    border-radius: 2px;
    display: inline-block;
}

.az-contact-address__text {
    font-size: 13px;
    color: var(--az-text-sec);
    line-height: 1.75;
    margin: 0;
}

/* نقشه مینیمال */
.az-mini-map {
    margin: 0 16px 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--az-border);
    position: relative;
    height: 168px;
    background: var(--az-bg-deep);
}

.az-mini-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    filter: grayscale(0.25) contrast(0.95);
    transition: filter 0.3s;
}

.az-mini-map:hover iframe { filter: grayscale(0) contrast(1); }

[data-theme="dark"] .az-mini-map iframe {
    filter: grayscale(0.6) invert(0.88) hue-rotate(180deg) contrast(0.9);
}

/* ══════════════════════════════════════════════════════
   نمایش — فقط موبایل و تبلت
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .az-action-bar { display: block; }

    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 5px));
    }

    .ariaz-theme-toggle { display: none !important; }

    .az-chat-bubble { display: none !important; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .az-action-bar {
        bottom: calc(5px + env(safe-area-inset-bottom));
    }
}
