/**
 * Alami Theme - Main CSS
 * داروخانه دکتر اعلمی
 */
@import 'core/variables.css';
@import 'core/base.css';
@import 'layout/header.css';
@import 'layout/mobile-sidebar.css';
@import 'layout/mobile-bottom-nav.css';
@import 'layout/footer.css';
@import 'pages/homepage.css';
@import 'pages/inner-pages.css';
@import 'components/product-card.css';

/* Skip Link - دسترسی‌پذیری */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link:focus {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    z-index: 9999;
    background: var(--primary);
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.skip-link:focus:not(:focus-visible) {
    outline: none;
}
.skip-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Visually hidden for screen readers - دسترسی‌پذیری */
.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;
}

/* Hero Slider - تمام صفحه، فلت، بدون گوشه گرد */
.alami-hero-swiper {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
}
.alami-hero-swiper .swiper-slide {
    width: 100%;
}

/* Carousel wrapper — overflow روی لایوت/صفحه کنترل می‌شود */
.alami-carousel-wrap {
    overflow: visible;
    width: 100%;
}

.alami-carousel-wrap .swiper,
.alami-products-carousel-wrap .swiper {
    overflow: visible !important;
}

/* کارت‌های محصول و مقاله یک اندازه */
.alami-products-swiper .swiper-slide,
.alami-new-products-swiper .swiper-slide,
.alami-articles-swiper .swiper-slide,
.alami-categories-swiper .swiper-slide,
.alami-order-steps-swiper .swiper-slide,
.alami-testimonials-swiper .swiper-slide {
    height: auto;
    display: flex;
}
.alami-products-swiper .swiper-slide > *,
.alami-new-products-swiper .swiper-slide > *,
.alami-articles-swiper .swiper-slide > *,
.alami-categories-swiper .swiper-slide > *,
.alami-order-steps-swiper .swiper-slide > *,
.alami-testimonials-swiper .swiper-slide > * {
    width: 100%;
}

/* دکمه‌های کاروسل — هماهنگ با قالب Alami */
.alami-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background-color: var(--card);
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(47, 58, 52, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s;
}
.alami-carousel-btn:hover:not(.swiper-button-disabled) {
    background-color: var(--secondary);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(47, 58, 52, 0.14);
    color: var(--accent);
}
.alami-carousel-btn:active:not(.swiper-button-disabled) {
    transform: translateY(-50%) scale(0.96);
}
.alami-carousel-btn.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}
.alami-carousel-chevron {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.alami-carousel-prev {
    right: -18px;
    left: auto;
}
.alami-carousel-next {
    left: -18px;
    right: auto;
}
/* مخفی در موبایل و تبلت - فقط دسکتاپ */
@media (max-width: 1023px) {
    .alami-carousel-btn {
        display: none !important;
    }
}
.alami-hero-pagination .swiper-pagination-bullet-active {
    background: var(--primary);
}

/* بنرها - چیدمان‌های مختلف */
.alami-banners-masonry {
    column-count: 1;
}
@media (min-width: 768px) {
    .alami-banners-masonry {
        column-count: 2;
        column-gap: 1rem;
    }
    .alami-banners-masonry > * {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
.alami-banners-strip > * {
    aspect-ratio: 1;
    min-height: 100px;
}
.alami-banners-stacked > * {
    aspect-ratio: 21/9;
}

/* دسته‌بندی‌ها — کاروسل موبایل (عرض اسلاید توسط Swiper محاسبه می‌شود) */
.alami-categories-swiper .swiper-slide > a.alami-category-card {
    width: 100%;
}

/* منوی کناری موبایل/تبلت */
#alami-mobile-sidebar.alami-sidebar-open #alami-sidebar-backdrop {
    pointer-events: auto;
}

/* صفحه جزئیات محصول */
.alami-product-gallery [data-gallery-main] {
    touch-action: manipulation;
}
/* گالری تامبنیل - کاروسل Free Mode */
.gallery-thumbs-swiper .swiper-slide {
    width: 64px;
    flex-shrink: 0;
}
.gallery-thumbs-swiper .swiper-slide button {
    width: 64px;
    height: 64px;
}
.variation-value-btn.selected,
.variation-value-btn.border-\[\#C9A962\] {
    border-color: var(--primary) !important;
}
.alami-similar-carousel {
    overflow: visible;
}
.alami-similar-swiper .swiper-slide {
    height: auto;
    display: flex;
}
.alami-similar-swiper .swiper-slide > * {
    width: 100%;
}

/* Toast - صفحه محصول */
.alami-product-toast {
    padding-top: max(1rem, env(safe-area-inset-top, 0));
}

[data-wishlist-toggle].active,
[data-wishlist-toggle].is-active {
    border-color: #e11d48 !important;
    color: #e11d48 !important;
    background-color: rgba(225, 29, 72, 0.08);
}

[data-wishlist-toggle].active svg,
[data-wishlist-toggle].is-active svg {
    fill: currentColor;
}

[data-compare-toggle].active {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background-color: rgba(95, 122, 106, 0.12);
}

/* فرم‌های ورود و ثبت نام - حالت خطا */
input.error {
    border-color: #ef4444 !important;
}
input.error:focus {
    border-color: #ef4444 !important;
    outline-color: #ef4444;
}
label.error {
    color: #ef4444;
}
