/* ============================================================
   CATEGORY DETAIL STYLES (Page 14)
   ============================================================ */

.m-category-detail-page {
    background: #FFFFFF;
    min-height: 100vh;
    padding-bottom: 90px; /* Space for bottom nav */
}

/* TOP BAR */
.m-cat-top-bar {
    height: 52px;
    background: white;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #F3F4F6;
}

.m-cat-top-bar .left-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-cat-top-bar .back-btn {
    color: #111827;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.m-cat-top-bar .back-btn svg {
    width: 22px;
    height: 22px;
}

.m-cat-top-bar .title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.m-cat-top-bar .cart-btn {
    color: #374151;
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.m-cat-top-bar .cart-btn svg {
    width: 22px;
    height: 22px;
}

.m-cat-top-bar .cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #7C3AED;
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid white;
}

/* HERO BANNER */
.m-cat-hero {
    margin-top: 52px;
    height: 160px;
    position: relative;
    overflow: hidden;
    background-color: #7C3AED; /* Fallback */
    background-size: cover;
    background-position: center;
}

.m-cat-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(88,28,135,0.8) 0%, transparent 60%);
}

.m-cat-hero .hero-content {
    position: absolute;
    left: 16px;
    bottom: 16px;
}

.m-cat-hero .hero-title {
    font-size: 22px;
    font-weight: 900;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.m-cat-hero .hero-count {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

/* SUBCATEGORIES SECTION */
.m-subcats-section {
    padding-bottom: 16px;
}

.m-subcats-section .subcats-heading {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    padding: 16px 16px 8px;
    margin: 0;
}

.m-subcats-section .subcats-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.m-subcats-section .subcats-scroll::-webkit-scrollbar {
    display: none;
}

.subcat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 72px;
    cursor: pointer;
    text-decoration: none;
}

.subcat-chip .img-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #EDE9FE;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F3FF;
}

.subcat-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcat-chip .fallback-img {
    font-size: 24px;
    font-weight: 800;
    color: #7C3AED;
}

.subcat-chip .name {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.subcat-chip.active .img-wrapper {
    border-color: #7C3AED;
}
.subcat-chip.active .name {
    color: #7C3AED;
}

/* FILTER + SORT BAR */
.m-filter-bar {
    position: sticky;
    top: 52px; /* right below top bar */
    z-index: 90;
    background: white;
    padding: 10px 16px;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.m-filter-bar .results-count {
    font-size: 13px;
    color: #6B7280;
}

.m-filter-bar .actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 6px 12px;
    background: white;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.btn-action svg {
    width: 14px;
    height: 14px;
    color: #374151;
}

/* PRODUCTS GRID */
.m-products-grid {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.m-product-card {
    background: white;
    border-radius: 14px;
    border: 1.5px solid #F3F4F6;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    position: relative;
}

.m-product-card .img-container {
    position: relative;
    width: 100%;
    height: 110px;
    background: #F9FAFB;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-product-card .img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.m-product-card .wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0;
}

.m-product-card .wishlist-btn svg {
    width: 16px;
    height: 16px;
    color: #9CA3AF;
}

.m-product-card .discount-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #EF4444;
    color: white;
    font-size: 9px;
    font-weight: 800;
    border-radius: 4px;
    padding: 2px 5px;
}

.m-product-card .prod-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    margin-top: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 33px; /* fix height for 2 lines */
}

.m-product-card .price-row {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-product-card .sale-price {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.m-product-card .regular-price {
    font-size: 11px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.m-product-card .add-to-cart-btn {
    width: 100%;
    height: 34px;
    margin-top: 8px;
    background: #7C3AED;
    color: white;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 700;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: #6B7280;
    font-size: 14px;
}

/* PAGINATION */
.m-pagination-wrapper { padding: 16px; }
.btn-load-more {
    width: 100%; height: 48px; border-radius: 12px;
    border: 2px solid #7C3AED; color: #7C3AED;
    background: transparent; font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* SORT BOTTOM SHEET */
.m-bottom-sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.m-bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }

.m-bottom-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: white; border-radius: 20px 20px 0 0;
    z-index: 1000; transform: translateY(100%); transition: transform 0.3s;
    padding: 20px 16px; box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}
.m-bottom-sheet.active { transform: translateY(0); }

.m-bottom-sheet .sheet-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.m-bottom-sheet .sheet-header h3 { font-size: 18px; font-weight: 800; color: #111827; margin: 0; }
.m-bottom-sheet .sheet-header .close-btn { background: none; border: none; font-size: 18px; color: #6B7280; padding: 0; }

.m-bottom-sheet .sheet-options { display: flex; flex-direction: column; }
.m-bottom-sheet .sort-option {
    padding: 14px 0; border-bottom: 1px solid #F3F4F6;
    font-size: 14px; color: #374151; text-decoration: none; display: block;
}
.m-bottom-sheet .sort-option:last-child { border-bottom: none; }
.m-bottom-sheet .sort-option.active { color: #7C3AED; font-weight: 700; }
