/* ============================================
   Category Section - Bogura Bazar Theme
   Version: 1.3.0 (Banner Center Cover)
============================================ */

.category-section {
    margin: 10px 0 20px;
}

.category-container {
    display: grid;
    gap: 20px;
}

.category-item {
    list-style: none;
}

.category-card {
    display: block;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========== ব্যানার ইমেজ - সেন্টার কভার ========== */
.category-banner {
    position: relative;
    height: 130px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e8f5e9);
}

.category-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;  /* ✅ সেন্টার পয়েন্টে */
    transition: transform 0.5s ease;
    display: block;
}

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

.category-banner-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #00A65A;
    font-size: 40px;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 166, 90, 0.2), rgba(0, 141, 76, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-overlay {
    opacity: 1;
}

/* ========== ক্যাটাগরি আইকন ও তথ্য ========== */
.category-info {
    padding: 18px 14px 14px;
    text-align: center;
    position: relative;
}

/* ✅ আইকন র‍্যাপার */
.category-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #f0f7f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -40px auto 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #00A65A;
    position: relative;
    z-index: 10;
    overflow: hidden;
    flex-shrink: 0;
}

.category-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;  /* ✅ সেন্টার পয়েন্টে */
    display: block;
    border-radius: 50%;
}

.category-icon-wrapper i {
    font-size: 36px;
    color: #00A65A;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e2e;
    margin: 12px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 5;
    line-height: 1.3;
}

.product-count {
    font-size: 11px;
    color: #6c757d;
    position: relative;
    z-index: 5;
}

/* ============================================
   রেসপন্সিভ
============================================ */

/* ========== লার্জ ডেস্কটপ (1200px+) ========== */
@media (min-width: 1200px) {
    .category-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========== ডেস্কটপ (992px - 1199px) ========== */
@media (min-width: 992px) and (max-width: 1199px) {
    .category-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== ট্যাবলেট (768px - 991px) ========== */
@media (min-width: 768px) and (max-width: 991px) {
    .category-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    .category-banner {
        height: 110px;
    }
    .category-icon-wrapper {
        width: 70px;
        height: 70px;
        margin-top: -35px;
    }
    .category-icon-wrapper i {
        font-size: 30px;
    }
    .category-name {
        font-size: 13px;
    }
    .category-info {
        padding: 16px 12px 12px;
    }
}

/* ========== ছোট ট্যাবলেট (576px - 767px) ========== */
@media (min-width: 576px) and (max-width: 767px) {
    .category-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .category-banner {
        height: 105px;
    }
    .category-icon-wrapper {
        width: 70px;
        height: 70px;
        margin-top: -35px;
    }
    .category-icon-wrapper i {
        font-size: 30px;
    }
    .category-name {
        font-size: 14px;
    }
    .product-count {
        font-size: 12px;
    }
    .category-info {
        padding: 18px 12px 14px;
    }
}

/* ========== মোবাইল (480px - 575px) ========== */
@media (max-width: 575px) {
    .category-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .category-banner {
        height: 110px;
    }
    .category-banner-img {
        object-fit: cover;
        object-position: center;
    }
    .category-icon-wrapper {
        width: 72px;
        height: 72px;
        margin-top: -36px;
        border-width: 2.5px;
    }
    .category-icon-wrapper i {
        font-size: 32px;
    }
    .category-icon-wrapper img {
        object-fit: cover;
        object-position: center;
    }
    .category-name {
        font-size: 14px;
        margin: 12px 0 6px;
    }
    .product-count {
        font-size: 12px;
    }
    .category-info {
        padding: 20px 12px 14px;
    }
}

/* ========== ছোট মোবাইল (400px - 479px) ========== */
@media (min-width: 400px) and (max-width: 479px) {
    .category-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .category-banner {
        height: 100px;
    }
    .category-banner-img {
        object-fit: cover;
        object-position: center;
    }
    .category-icon-wrapper {
        width: 68px;
        height: 68px;
        margin-top: -34px;
        border-width: 2.5px;
    }
    .category-icon-wrapper i {
        font-size: 30px;
    }
    .category-icon-wrapper img {
        object-fit: cover;
        object-position: center;
    }
    .category-name {
        font-size: 14px;
        margin: 10px 0 5px;
    }
    .product-count {
        font-size: 12px;
    }
    .category-info {
        padding: 18px 12px 12px;
    }
}

/* ========== ছোট মোবাইল (380px - 399px) ========== */
@media (min-width: 380px) and (max-width: 399px) {
    .category-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .category-banner {
        height: 90px;
    }
    .category-banner-img {
        object-fit: cover;
        object-position: center;
    }
    .category-icon-wrapper {
        width: 62px;
        height: 62px;
        margin-top: -31px;
        border-width: 2px;
    }
    .category-icon-wrapper i {
        font-size: 26px;
    }
    .category-icon-wrapper img {
        object-fit: cover;
        object-position: center;
    }
    .category-name {
        font-size: 13px;
        margin: 10px 0 5px;
    }
    .product-count {
        font-size: 11px;
    }
    .category-info {
        padding: 16px 10px 12px;
    }
}

/* ========== অতি ছোট মোবাইল (380px পর্যন্ত) ========== */
@media (max-width: 379px) {
    .category-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .category-banner {
        height: 80px;
    }
    .category-banner-img {
        object-fit: cover;
        object-position: center;
    }
    .category-icon-wrapper {
        width: 56px;
        height: 56px;
        margin-top: -28px;
        border-width: 2px;
    }
    .category-icon-wrapper i {
        font-size: 24px;
    }
    .category-icon-wrapper img {
        object-fit: cover;
        object-position: center;
    }
    .category-name {
        font-size: 12px;
        margin: 8px 0 4px;
    }
    .product-count {
        font-size: 10px;
    }
    .category-info {
        padding: 14px 8px 10px;
    }
}

/* ============================================
   টাচ ডিভাইস অপটিমাইজেশন
============================================ */
@media (hover: none) and (pointer: coarse) {
    .category-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    .category-card:hover .category-banner-img {
        transform: none;
    }
    .category-card:hover .category-overlay {
        opacity: 0;
    }
}
