/* ═══════════════════════════════════════════════════════════
   AHMED PAPER DECORATIONS
   Category Page - Complete Clean & Responsive Design
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   BASE RESET - Prevent Overflow Everywhere
   ═══════════════════════════════════════════════════════════ */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER (Shop All Products Banner)
   ═══════════════════════════════════════════════════════════ */
.page-header {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 50%, #000 100%);
    color: #fff;
    padding: 50px 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.page-header-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #A3A3A3;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.page-breadcrumb a {
    color: #D4AF37;
    text-decoration: none;
}

.page-breadcrumb i {
    font-size: 10px;
    color: #525252;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

.page-title span {
    color: #D4AF37;
    font-style: italic;
}

.page-subtitle {
    font-size: 15px;
    color: #D4D4D4;
    margin: 0 auto;
    max-width: 600px;
    line-height: 1.5;
    word-wrap: break-word;
}

.page-products-count {
    display: inline-block;
    margin-top: 18px;
    padding: 8px 20px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid #D4AF37;
    border-radius: 50px;
    color: #D4AF37;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   CATEGORY PAGE MAIN WRAPPER
   ═══════════════════════════════════════════════════════════ */
.category-page {
    padding: 40px 0;
    background: #FAFAFA;
    min-height: 500px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.category-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR (Categories Filter)
   ═══════════════════════════════════════════════════════════ */
.category-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    min-width: 0;
}

.sidebar-close-mobile {
    display: none;
    padding: 15px;
    background: #000;
    color: #D4AF37;
    margin: -25px -25px 20px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
}

.sidebar-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F3F3F3;
}

.sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin: 0 0 15px;
    padding-left: 15px;
    position: relative;
}

.sidebar-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #D4AF37, #E5C158);
    border-radius: 2px;
}

.sidebar-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-categories li {
    margin-bottom: 4px;
}

.sidebar-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 13px;
    color: #404040;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    gap: 8px;
}

.sidebar-categories a:hover,
.sidebar-categories a.is-active {
    background: linear-gradient(135deg, #D4AF37, #E5C158);
    color: #000;
    padding-left: 18px;
    font-weight: 600;
}

.sidebar-categories .count {
    background: #F3F3F3;
    color: #737373;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sidebar-categories a:hover .count,
.sidebar-categories a.is-active .count {
    background: #000;
    color: #D4AF37;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════ */
.category-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   TOOLBAR (Filter + Sort)
   ═══════════════════════════════════════════════════════════ */
.category-toolbar {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    min-width: 0;
}

.toolbar-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #D4AF37, #E5C158);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.toolbar-results {
    font-size: 13px;
    color: #525252;
    min-width: 0;
    word-wrap: break-word;
}

.toolbar-results strong {
    color: #000;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.toolbar-sort {
    padding: 10px 15px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #404040;
    cursor: pointer;
    outline: none;
    min-width: 170px;
    max-width: 100%;
}

.toolbar-sort:focus {
    border-color: #D4AF37;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCTS GRID
   ═══════════════════════════════════════════════════════════ */
.category-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   NO PRODUCTS STATE
   ═══════════════════════════════════════════════════════════ */
.no-products {
    background: #fff;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.no-products h3 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: #000;
    margin: 0 0 10px;
}

.no-products p {
    color: #737373;
    margin: 0 0 25px;
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */
.category-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #E5E5E5;
    color: #404040;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: linear-gradient(135deg, #D4AF37, #E5C158);
    color: #000;
    border-color: #D4AF37;
    transform: translateY(-2px);
}

.pagination-btn.is-active {
    background: linear-gradient(135deg, #D4AF37, #E5C158);
    color: #000;
    border-color: #D4AF37;
    font-weight: 700;
}

.pagination-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (Mobile)
   ═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - LAPTOP (1200px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
    .category-page-container {
        grid-template-columns: 240px 1fr;
        gap: 25px;
    }

    .category-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-title {
        font-size: 36px;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - TABLET (992px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .category-page {
        padding: 30px 0;
    }

    .category-page-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 20px;
    }

    .page-header {
        padding: 35px 0;
    }

    .page-header-content {
        padding: 0 15px;
    }

    .page-title {
        font-size: 30px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    /* Sidebar becomes drawer on mobile */
    .category-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        z-index: 999;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 0 25px 25px;
    }

    .category-sidebar.is-active {
        left: 0;
    }

    .sidebar-close-mobile {
        display: block;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .sidebar-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    .toolbar-filter-btn {
        display: inline-flex;
    }

    .category-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE (768px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .category-page {
        padding: 20px 0;
    }

    .category-page-container {
        padding: 0 12px;
        gap: 15px;
    }

    .page-header {
        padding: 25px 0;
    }

    .page-header-content {
        padding: 0 15px;
    }

    .page-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .page-subtitle {
        font-size: 13px;
        padding: 0 10px;
    }

    .page-products-count {
        font-size: 11px;
        padding: 6px 16px;
        margin-top: 12px;
        letter-spacing: 0.5px;
    }

    .page-breadcrumb {
        font-size: 12px;
        margin-bottom: 12px;
    }

    /* Toolbar mobile - stacked layout */
    .category-toolbar {
        padding: 12px;
        gap: 10px;
        margin-bottom: 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        width: 100%;
        gap: 10px;
        justify-content: space-between;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .toolbar-results {
        font-size: 12px;
        flex: 1;
        min-width: 0;
    }

    .toolbar-sort {
        width: 100%;
        min-width: 0;
        padding: 9px 12px;
        font-size: 12px;
    }

    /* Products grid mobile */
    .category-products-grid {
        gap: 12px;
    }

    /* Pagination mobile */
    .category-pagination {
        gap: 5px;
        margin-top: 25px;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 12px;
    }

    /* Sidebar mobile padding fix */
    .category-sidebar {
        padding: 0 20px 20px;
    }

    .sidebar-close-mobile {
        margin: 0 -20px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - SMALL MOBILE (576px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 575px) {
    .category-page-container {
        padding: 0 10px;
    }

    .page-header {
        padding: 22px 0;
    }

    .page-title {
        font-size: 22px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .page-products-count {
        font-size: 10px;
        padding: 5px 14px;
    }

    .category-toolbar {
        padding: 10px;
    }

    .toolbar-results {
        font-size: 11px;
    }

    .category-products-grid {
        gap: 10px;
    }

    .pagination-btn {
        min-width: 34px;
        height: 34px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - EXTRA SMALL (400px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 11px;
    }

    .page-header {
        padding: 20px 0;
    }

    .category-page-container {
        padding: 0 8px;
    }

    .category-products-grid {
        gap: 8px;
    }

    .toolbar-results {
        font-size: 10px;
    }

    .toolbar-filter-btn {
        padding: 7px 12px;
        font-size: 11px;
    }

    .toolbar-sort {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════
   VERY SMALL (359px and below) - Still 2 columns
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 359px) {
    .category-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .page-title {
        font-size: 18px;
    }

    .category-page-container {
        padding: 0 6px;
    }
}