/* categories.css - Modern category styling without carousel */

.categories-wrapper {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Grid Layout - Modern Responsive Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 70px));
    gap: 3rem;
    justify-content: center;
    padding: 1rem 0;
    display: flex;
    justify-content: start;
    align-items: center;
}

/* Category Card Styles */
.category-card {
    text-decoration: none;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    text-decoration: none;
}

.category-card-inner {
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover .category-card-inner {
    /* border-color: #dee2e6; */
    /* box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.15); */
}

/* Image Wrapper */
.category-image-wrapper {
    position: relative;
    display: inline-block;
    /* margin-bottom: 0.75rem; */
}

.category-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-card:hover .category-img {
    transform: scale(1.05);
}

/* Category Badge (like "آزمایشی", "وایرال") */
.category-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #5626d9;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Category Name */
.category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3748;
    display: block;
    line-height: 1.3;
    max-width: 100px;
    margin: 0 auto;
    word-break: break-word;
}

.category-card:hover .category-name {
    color: #5626d9;
}

/* All Categories Special Button */
.all-categories-trigger {
    cursor: pointer;
}


/* Modal Styles */
.modal-content {
    border-radius: 1.25rem;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #edf2f7;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 1.25rem 1.25rem 0 0;
}

.modal-title {
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    margin: auto 0;
}

.modal-title i {
    color: #5626d9;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* All Categories Grid inside Modal */
.all-categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.modal-category-item {
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
}

.modal-category-item:hover {
    text-decoration: none;
    transform: translateY(-3px);
}

.modal-category-inner {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    height: 100%;
}

.modal-category-item:hover .modal-category-inner {
    border-color: #5626d9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modal-category-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.modal-category-name {
    font-size: 0.813rem;
    font-weight: 500;
    color: #2d3748;
    display: block;
}

.modal-category-item:hover .modal-category-name {
    color: #5626d9;
}

.modal-category-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: #5626d9;
    color: white;
    margin-top: 0.25rem;
    display: inline-block;
}

.category-img {
    transform: scale(1);
    transition: transform 0.3s ease;
}

.category-card:hover .category-img {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 105px));
        gap: 1rem;
    }

    .category-img {
        width: 80px;
        height: 80px;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .category-card-inner {
        padding: 1rem 0.5rem;
    }

    .all-categories-list {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 0.75rem;
    }

    .modal-category-img {
        width: 48px;
        height: 48px;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 95px));
        gap: 0.75rem;
    }

    .category-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.45rem;
        top: -6px;
        right: -6px;
    }
}

/* Custom Scrollbar for Modal */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.category-card:nth-child(1) {
    animation-delay: 0.05s;
}

.category-card:nth-child(2) {
    animation-delay: 0.1s;
}

.category-card:nth-child(3) {
    animation-delay: 0.15s;
}

.category-card:nth-child(4) {
    animation-delay: 0.2s;
}

.category-card:nth-child(5) {
    animation-delay: 0.25s;
}

.category-card:nth-child(6) {
    animation-delay: 0.3s;
}

.category-card:nth-child(7) {
    animation-delay: 0.35s;
}

.category-card:nth-child(8) {
    animation-delay: 0.4s;
}

.category-card:nth-child(9) {
    animation-delay: 0.45s;
}

.category-card:nth-child(10) {
    animation-delay: 0.5s;
}


.categories-carousel {
    position: relative;
    padding: 0 45px;
}

.categories-carousel .owl-nav button.owl-prev,
.categories-carousel .owl-nav button.owl-next {
    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    width: 40px;
    height: 40px;

    border-radius: 50% !important;

    background: #fff !important;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);

    color: #333 !important;

    font-size: 16px !important;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;
}

.categories-carousel .owl-nav button.owl-prev {
    right: 0;
}

.categories-carousel .owl-nav button.owl-next {
    left: 0;
}

.categories-carousel .owl-nav button:hover {
    transform: translateY(-50%) scale(1.08);
}

.categories-carousel .owl-nav button span {
    display: none;
}

.category-carousel-item {
    width: 100%;
    height: 100%;
}

.category-carousel-item .category-card {
    width: 100%;
}