/* ========================================
   CATEGORY PAGE STYLES
   ======================================== */

/* Page Layout */
.category-container {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    min-height: calc(100vh - 260px);
    width: 100%;
    overflow-x: hidden;
}

.category-nav-section {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 0;
    margin-bottom: 16px;
}

.category-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-nav-scroll {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.category-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    text-decoration: none;
    color: #333333;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
}

.category-nav-item:hover {
    background: #f5f5f5;
    color: #2576E6;
    transform: translateY(-2px);
}

.category-nav-item.active {
    background: #ebf4ff;
    color: #0f172a;
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.22);
}

.category-nav-item.active .category-nav-icon {
    background: #2563eb;
    color: #ffffff;
    transform: scale(1.1);
}

.category-nav-icon {
    width: 48px;
    height: 48px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #2576E6;
    transition: all 0.3s ease;
}

.category-nav-item:hover .category-nav-icon {
    background: #2576E6;
    color: #ffffff;
    transform: scale(1.1);
}

.category-nav-label {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #333333;
}

@media (max-width: 768px) {
    .category-nav-section {
        padding: 10px 0;
        background: #ffffff;
        border-bottom: 1px solid #e5edf8;
        margin-top: 0;
        margin-bottom: 12px;
    }

    .category-container {
        padding: 0 12px 20px;
    }

    .category-nav-container {
        padding: 0 12px;
        overflow: visible;
    }

    .category-nav-scroll {
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        padding: 8px 2px 10px;
        margin: 0;
        scroll-padding-inline: 2px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .category-nav-item {
        flex: 0 0 76px;
        min-width: 76px;
        padding: 9px 8px;
        gap: 5px;
        border: 1px solid #e9eff8;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 7px 18px rgba(15, 64, 130, 0.05);
        scroll-snap-align: start;
    }


    .category-nav-scroll::-webkit-scrollbar {
        display: none;
    }

    .category-nav-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .category-nav-scroll::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    .category-nav-item {
        flex: 0 0 76px;
        min-width: 76px;
        padding: 9px 8px;
        gap: 6px;
        border: 1px solid #e9eff8;
        border-radius: 16px;
    }

    .category-nav-item:last-child {
        border-right: none;
    }

    .category-nav-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .category-nav-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .category-nav-section {
        padding: 8px 0;
    }

    .category-nav-container {
        padding: 0 10px;
    }

    .category-nav-scroll {
        gap: 9px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        padding: 6px 2px 9px;
        margin-left: 0;
        justify-content: flex-start;
    }

    .category-nav-item {
        flex-basis: 68px;
        min-width: 68px;
        padding: 8px 7px;
        gap: 4px;
        border: 1px solid #e9eff8;
        border-radius: 15px;
    }

    .category-nav-item:last-child {
        border-right: none;
    }

    .category-nav-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .category-nav-label {
        font-size: 10px;
        line-height: 1.15;
    }
}

.category-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.filter-item {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.category-title {
    font-size: 16px;
    font-weight: 800;
    color: #1f2937;
}

.sort-select {
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

/* ========================================
   SIDEBAR / FILTERS
   ======================================== */

.category-sidebar {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid #f0f0f0;
}

.category-sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
    border-bottom: 2px solid #2576E6;
    padding-bottom: 12px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 30px;
}

.category-item {
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.category-item:hover {
    color: #2576E6;
    background: #f5f5f5;
}

.category-item.active {
    color: #2576E6;
    background: #f0f8ff;
    border-left-color: #2576E6;
    font-weight: 600;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.price-slider {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 12px;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #2576E6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-slider::-webkit-slider-thumb:hover {
    background: #1a5bb8;
    transform: scale(1.2);
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #2576E6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.price-slider::-moz-range-thumb:hover {
    background: #1a5bb8;
    transform: scale(1.2);
}

.filter-section p {
    font-size: 13px;
    color: #666;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.category-main {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    min-width: 0;
    overflow-x: hidden;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 18px;
    border: 1px solid #dbe7fb;
    border-radius: 16px;
    padding: 22px 24px;
    background:
        linear-gradient(135deg, rgba(37, 118, 230, 0.12), rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 32px rgba(15, 64, 130, 0.08);
}

.category-name-wrapper {
    max-width: 70%;
}

.category-header h1,
.category-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.08;
    letter-spacing: 0;
    position: relative;
}

.category-header h1::after,
.category-header h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2576E6, #22c55e);
}

.category-subtitle {
    font-size: 15px;
    color: #334155;
    margin: 8px 0 0;
    line-height: 1.5;
    max-width: 720px;
}

.sort-options {
    display: flex;
    gap: 12px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover,
.sort-select:focus {
    border-color: #2576E6;
    color: #2576E6;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 14px rgba(55, 71, 90, 0.08);
    min-width: 0;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: #2563eb;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #134fe5, #23a6f1);
    color: white;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-price {
    font-size: 1.12rem;
    font-weight: 700;
    color: #003089;
}

.product-price-original {
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 0.9rem;
}

.product-discount {
    margin-left: 8px;
    font-size: 0.8rem;
    color: #0d9488;
    font-weight: 700;
}

.no-products {
    padding: 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    text-align: center;
    color: #334155;
    font-weight: 700;
}


.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-link:hover .product-title {
    color: #1a56d8;
}

.product-card:hover {
    border-color: #2576E6;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
}

.product-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

.product-image-secondary {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image {
    display: none;
}

.product-card:hover .product-image-secondary {
    display: block;
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 12px;
}

.product-stars {
    color: #ffc107;
}

.product-review-count {
    color: #666;
    font-size: 11px;
}

.product-price {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}

.product-price-original {
    text-decoration: line-through;
    color: #6b7280;
    font-size: 13px;
    margin-right: 8px;
}

.product-discount {
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    min-width: 0;
}

.product-stars {
    color: #ffc107;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.product-review-count {
    color: #475569;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2px 7px;
    font-weight: 600;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.product-button {
    background: #2576E6;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-decoration: none;
}

.product-button:hover {
    background: #1a5bb8;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: #2576E6;
    color: #ffffff;
    border-color: #2576E6;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .category-container {
        grid-template-columns: 220px 1fr;
        gap: 20px;
        padding: 30px 16px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .category-header h1,
    .category-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .category-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 16px;
    }

    .category-sidebar {
        position: static;
        border: 1px solid #f0f0f0;
        margin-bottom: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
        padding: 18px;
        border-radius: 14px;
    }

    .category-header h1,
    .category-header h2 {
        font-size: 25px;
    }

    .sort-options {
        width: 100%;
        flex-wrap: wrap;
    }

    .sort-select {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .category-sidebar {
        padding: 16px;
    }

    .category-sidebar h3 {
        font-size: 16px;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .category-header h1,
    .category-header h2 {
        font-size: clamp(24px, 8vw, 30px);
        word-break: normal;
    }

    .category-subtitle {
        font-size: 13px;
    }

    .category-main {
        padding: 14px 10px;
    }

    .product-info {
        padding: 10px 10px 8px;
        gap: 6px;
    }

    .product-title {
        font-size: 12px;
        line-height: 1.35;
        min-height: 32px;
        margin-bottom: 2px;
    }

    .product-rating {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 2px;
    }

    .product-stars {
        font-size: 11px;
    }

    .product-review-count {
        flex: 0 1 auto;
        font-size: 10px;
        padding: 3px 7px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .product-price {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 5px;
        font-size: 14px;
        line-height: 1.25;
        margin-bottom: 5px;
    }

    .product-price-original,
    .product-discount {
        font-size: 10px;
        margin: 0;
    }

    .product-discount {
        padding: 3px 7px;
    }

    .product-badge {
        top: 7px;
        left: 7px;
        padding: 2px 7px;
        font-size: 9px;
    }

    .product-button {
        margin-top: auto;
        padding: 10px 10px;
        font-size: 12px;
        border-radius: 9px;
        font-weight: 800;
    }
}
