/* ═══════════════════════════════════════════════════════════
   CATEGORY PAGE - HEPSIBURADA STYLE  
   ═══════════════════════════════════════════════════════════ */

/* ── Page Layout ── */
.cp-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.cp-breadcrumb {
    padding: 0.75rem 0;
    margin-bottom: 0;
}
.cp-breadcrumb .breadcrumb-inner {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    font-size: 0.8rem;
    gap: 0.5rem;
}
.cp-breadcrumb .breadcrumb-item {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
}
.cp-breadcrumb .breadcrumb-item:hover { color: #ff6000; }
.cp-breadcrumb .breadcrumb-item.active { color: #111827; font-weight: 600; }
.cp-breadcrumb .breadcrumb-separator { width: 12px; height: 12px; color: #d1d5db; }

.cp-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding-bottom: 3rem;
}

/* ── Sidebar ── */
.cp-sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

.cp-sidebar-inner {
    position: sticky;
    top: 230px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.cp-sidebar-inner::-webkit-scrollbar { width: 4px; }
.cp-sidebar-inner::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

body.has-hidden-header .cp-sidebar-inner {
    top: 20px;
    transition: top 0.4s ease;
}

/* Sidebar Header */
.cp-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}
.cp-sidebar-head h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cp-clear-all {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ff6000;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.cp-clear-all:hover { background: #ffedd5; }

/* Filter Accordion Group */
.cp-filter-group {
    border-bottom: 1px solid #f3f4f6;
}
.cp-filter-group:last-child { border-bottom: none; }

.cp-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.cp-filter-toggle:hover { background: #fafafa; }
.cp-filter-toggle-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cp-filter-badge {
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    background: #ff6000;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}
.cp-filter-chevron {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    transition: transform 0.25s ease;
}
.cp-filter-toggle.collapsed .cp-filter-chevron {
    transform: rotate(-90deg);
}

.cp-filter-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}
.cp-filter-body.open {
    max-height: 600px;
    padding: 0 16px 12px;
}

/* Filter Search */
.cp-filter-search {
    position: relative;
    margin-bottom: 8px;
}
.cp-filter-search input {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.78rem;
    outline: none;
    background: #f9fafb;
    color: #374151;
    transition: border-color 0.2s;
}
.cp-filter-search input:focus {
    border-color: #ff6000;
    background: #fff;
}
.cp-filter-search .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

/* Filter Scroll Area */
.cp-filter-scroll {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.cp-filter-scroll::-webkit-scrollbar { width: 3px; }
.cp-filter-scroll::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }

/* Filter Option (checkbox/radio) */
.cp-filter-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1px;
}
.cp-filter-opt:hover { background: #f3f4f6; }
.cp-filter-opt.active { background: #fff7ed; }
.cp-filter-opt.active .cp-opt-text { color: #ea580c; font-weight: 600; }

.cp-opt-check {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
    background: #fff;
}
.cp-opt-check.radio { border-radius: 50%; }
.cp-filter-opt.active .cp-opt-check {
    border-color: #ff6000;
    background: #ff6000;
}
.cp-filter-opt.active .cp-opt-check::after {
    content: '';
    position: absolute;
    top: 2px; left: 4px;
    width: 5px; height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.cp-filter-opt.active .cp-opt-check.radio::after {
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    border: none;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%,-50%);
}

.cp-opt-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.3;
    flex: 1;
}
.cp-opt-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
}

/* Category Links in Sidebar */
.cp-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 1px;
}
.cp-cat-link:hover { background: #f3f4f6; }
.cp-cat-link:hover .cp-cat-name { color: #ff6000; }
.cp-cat-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.3;
}
.cp-cat-count {
    font-size: 0.6rem;
    font-weight: 700;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}
.cp-cat-link.active { background: #fff7ed; border: 1px solid #fed7aa; }
.cp-cat-link.active .cp-cat-name { color: #ea580c; font-weight: 700; }
.cp-cat-link.active .cp-cat-count { background: #ffedd5; color: #ea580c; }

/* Stock Toggle */
.cp-stock-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
}
.cp-stock-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cp-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    transition: background 0.25s;
    cursor: pointer;
    flex-shrink: 0;
}
.cp-toggle-track.on { background: #ff6000; }
.cp-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cp-toggle-track.on .cp-toggle-knob { transform: translateX(16px); }

/* Price Filter */
.cp-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cp-price-input {
    flex: 1;
    padding: 7px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.78rem;
    outline: none;
    background: #f9fafb;
    color: #374151;
    transition: border-color 0.2s;
    text-align: center;
}
.cp-price-input:focus { border-color: #ff6000; background: #fff; }
.cp-price-dash { color: #d1d5db; font-weight: 700; }
.cp-price-btn {
    background: #ff6000;
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.cp-price-btn:hover { background: #ea580c; }

/* ── Main Content Area ── */
.cp-main {
    flex: 1;
    min-width: 0;
}

/* Title Bar */
.cp-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.cp-title-bar h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}
.cp-result-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}
.cp-result-count strong {
    font-weight: 700;
    color: #111827;
}

/* ── Sort Bar ── */
.cp-sort-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.cp-sort-btn {
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.cp-sort-btn:hover { border-color: #ff6000; color: #ff6000; }
.cp-sort-btn.active {
    background: #ff6000;
    color: #fff;
    border-color: #ff6000;
}

/* ── Active Filter Chips ── */
.cp-chips-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 0;
    min-height: 0;
}
.cp-chips-bar:empty { display: none; }

.cp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    cursor: default;
    animation: chipIn 0.2s ease;
}
@keyframes chipIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.cp-chip-label { color: #9ca3af; font-weight: 500; margin-right: 2px; }
.cp-chip-x {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    transition: all 0.15s;
    margin-left: 2px;
    flex-shrink: 0;
}
.cp-chip-x:hover { background: #ef4444; color: #fff; }

.cp-chips-clear {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.cp-chips-clear:hover { background: #fef2f2; }

/* ── Skeleton Loading ── */
.cp-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.cp-skeleton-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}
.cp-skeleton-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.cp-skeleton-text {
    padding: 12px;
}
.cp-skeleton-line {
    height: 10px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}
.cp-skeleton-line:last-child { width: 60%; margin-bottom: 0; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Product Grid Override ── */
.cp-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.cp-product-grid .product-card {
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.cp-product-grid .product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: #e5e7eb;
}

/* ── Lazy Load ── */
.cp-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    gap: 10px;
}
.cp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top-color: #ff6000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cp-loader-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Empty State ── */
.cp-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    grid-column: 1 / -1;
}
.cp-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #d1d5db;
}
.cp-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}
.cp-empty p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* ── Mobile Sticky Bottom Bar ── */
.cp-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.cp-mobile-bar-inner {
    display: flex;
    gap: 8px;
}
.cp-mobile-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}
.cp-mobile-bar-btn i { width: 16px; height: 16px; }
.cp-mobile-bar-btn:active { background: #f3f4f6; }
.cp-mobile-bar-btn .cp-bar-badge {
    font-size: 0.55rem;
    font-weight: 800;
    background: #ff6000;
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

/* ── Mobile Drawer ── */
.cp-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 19999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.cp-drawer-overlay.open { opacity: 1; visibility: visible; }

.cp-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 340px;
    background: #fff;
    z-index: 20000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15);
}
.cp-drawer.open { transform: translateX(0); }

.cp-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.cp-drawer-head h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.15s;
}
.cp-drawer-close:hover { background: #e5e7eb; }

.cp-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
}

.cp-drawer-footer {
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.cp-drawer-apply {
    flex: 1;
    padding: 10px;
    background: #ff6000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.cp-drawer-reset {
    padding: 10px 16px;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* Sort Bottom Sheet */
.cp-sort-sheet {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
}
.cp-sort-sheet.open { display: block; }
.cp-sort-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}
.cp-sort-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px 32px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cp-sort-sheet.open .cp-sort-sheet-content { transform: translateY(0); }
.cp-sort-sheet-handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 4px;
    margin: 0 auto 14px;
}
.cp-sort-sheet-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
}
.cp-sort-sheet-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.cp-sort-sheet-opt:hover { background: #f9fafb; }
.cp-sort-sheet-opt.active {
    background: #fff7ed;
    font-weight: 700;
    color: #ea580c;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .cp-product-grid, .cp-skeleton-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .cp-sidebar { display: none !important; }
    .cp-mobile-bar { display: block; }
    .cp-layout { gap: 0; }
    .cp-product-grid, .cp-skeleton-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .cp-main { padding-bottom: 70px; }
    .cp-title-bar h1 { font-size: 1.05rem; }
    .cp-sort-bar { display: none; }
}

@media (max-width: 640px) {
    .cp-wrapper { padding: 0 6px; }
    .cp-product-grid, .cp-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .cp-title-bar { padding: 0 4px; }
    .cp-title-bar h1 { font-size: 0.95rem; }
    .cp-chips-bar { padding: 6px 4px; }
    .cp-chip { font-size: 0.7rem; padding: 3px 8px; }
}

/* Admin badge */
.cp-admin-badge {
    font-size: 0.5rem;
    font-weight: 800;
    background: #fef2f2;
    color: #ef4444;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    vertical-align: middle;
}
