/* ============================================================
   Moshina Category Grids Widget Styles (Complete Clean Redesign)
   ============================================================ */

.moshina-cat-grids-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    direction: rtl;
    font-family: inherit;
}

/* Header Section (Title & View All) */
.moshina-cat-grids-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}

.moshina-cat-grids-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.moshina-cat-grids-view-all {
    font-size: 14px;
    font-weight: 700;
    color: var(--moshina-grid-accent, #361601);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.moshina-cat-grids-view-all:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Enforce Single Row Layout - Desktop & Mobile */
.moshina-cat-grids-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    width: 100% !important;
    gap: 12px !important;
    padding: 4px 2px 12px 2px !important;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none !important; /* Reset grid */
}

/* Scrollbar styles */
.moshina-cat-grids-container::-webkit-scrollbar {
    height: 4px;
}
.moshina-cat-grids-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.moshina-cat-grids-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

@media (max-width: 767px) {
    .moshina-cat-grids-title {
        font-size: 18px;
    }

    .moshina-cat-grids-view-all {
        font-size: 13px;
    }
}

/* Single Card Item */
.moshina-cat-grid-card {
    flex: 0 0 95px !important; /* Mobile width */
    width: 95px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.moshina-cat-grid-card:hover {
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .moshina-cat-grids-container {
        gap: 16px !important;
        justify-content: flex-start !important;
    }
    .moshina-cat-grid-card {
        flex: 0 0 130px !important; /* Desktop width */
        width: 130px !important;
    }
}

/* Card Image Wrapper - Strictly Contained */
.moshina-card-img-wrap {
    width: 100%;
    min-width: 0;
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    max-height: 220px;
}

.moshina-card-img-wrap .swiper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.moshina-card-img-wrap .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.moshina-card-img-wrap .swiper-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #f8fafc;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Pre-JS fallback: first slide is visible cleanly */
.moshina-card-img-wrap .swiper:not(.swiper-initialized) .swiper-slide:not(:first-child) {
    display: none !important;
}

.moshina-card-img-wrap .swiper-slide img,
.moshina-card-img-wrap .swiper-slide .moshina-cat-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

/* Golden Bottom Strip */
.moshina-card-golden-strip {
    width: 100%;
    height: 14px;
    background: linear-gradient(135deg, var(--moshina-strip-color, #eab308) 0%, #d97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
    flex-shrink: 0;
}

.moshina-gold-dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
    transition: all 0.25s ease;
}

.moshina-gold-dot.active {
    width: 12px;
    background: #ffffff;
    border-radius: 2px;
}

/* Card Title Below Image */
.moshina-card-title {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.moshina-cat-grid-card:hover .moshina-card-title {
    color: var(--moshina-grid-accent, #361601);
}