/* ===============================
   PROFESSIONAL CATEGORY PAGE V2
   With Sidebar Filters + Quick View
   =============================== */

:root {
    --new-black: #000000;
    --new-gray: #86868b;
    --new-light: #f5f5f7;
    --new-white: #ffffff;
    --new-accent: #0071e3;
    --border-light: #d2d2d7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: #fff;
    overflow-x: hidden;
}

/* Top Navigation Bar */
.top-nav {
    background: #f5f5f7;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}

.top-nav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    font-size: 20px;
    font-weight: 600;
    color: var(--new-black);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--new-black);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.7;
}

.cart-link {
    position: relative;
    color: var(--new-black);
    font-size: 20px;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Hero Section */
.category-hero-new {
    background: var(--new-black);
    padding: 60px 0 40px 0;
    text-align: center;
}

.category-hero-new h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--new-white);
    margin: 0 0 12px 0;
    letter-spacing: -1px;
}

.category-hero-new p {
    font-size: 19px;
    color: var(--new-gray);
    margin: 0;
}

/* Main Layout with Sidebar */
.category-layout {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar Filters */
.sidebar-filters {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-section {
    background: var(--new-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--new-black);
    margin-bottom: 16px;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #1d1d1f;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
}

.filter-group label:hover {
    color: var(--new-accent);
}

.filter-group input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.price-range {
    display: flex;
    gap: 12px;
    align-items: center;
}

.price-range input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 14px;
}

.btn-reset-filters {
    width: 100%;
    padding: 12px;
    background: var(--new-white);
    border: 1px solid var(--new-black);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--new-black);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset-filters:hover {
    background: var(--new-black);
    color: var(--new-white);
}

/* Products Grid - Smaller Cards */
.products-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Smaller Product Card */
.product-card-new {
    background: var(--new-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Product Image - Smaller */
.product-image-new {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--new-light);
    position: relative;
    overflow: hidden;
}

.product-image-new img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card-new:hover .product-image-new img {
    transform: scale(1.05);
}

/* Quick View Button - Appears on Hover */
.btn-quick-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 12px 24px;
    background: var(--new-white);
    color: var(--new-black);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-card-new:hover .btn-quick-view {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.btn-quick-view:hover {
    background: var(--new-black);
    color: var(--new-white);
}

/* NEW Badge */
.product-badge-new {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--new-black);
    color: var(--new-white);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 2;
}

.product-badge-new.sale {
    background: #ff3b30;
}

/* Product Info - Compact */
.product-info-new {
    padding: 16px;
    text-align: center;
}

.product-brand-new {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--new-gray);
    margin-bottom: 6px;
}

.product-title-new {
    font-size: 15px;
    font-weight: 600;
    color: var(--new-black);
    margin: 0 0 8px 0;
    line-height: 1.3;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-new {
    font-size: 16px;
    color: var(--new-black);
    margin-bottom: 12px;
    font-weight: 600;
}

.price-old-new {
    text-decoration: line-through;
    color: var(--new-gray);
    margin-right: 6px;
    font-size: 13px;
}

/* Add to Basket Button - Compact */
.btn-buy-new {
    width: 100%;
    padding: 10px;
    background: var(--new-accent);
    color: var(--new-white);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-buy-new:hover {
    background: #0077ed;
    transform: translateY(-2px);
}

/* Quick View Modal */
.quick-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.quick-view-modal.active {
    display: flex;
}

.modal-content {
    background: var(--new-white);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: var(--new-light);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: var(--new-black);
    color: var(--new-white);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.modal-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--new-light);
    border-radius: 12px;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--new-black);
    margin-bottom: 8px;
}

.modal-brand {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--new-gray);
    margin-bottom: 16px;
}

.modal-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--new-black);
    margin-bottom: 24px;
}

.modal-description {
    font-size: 15px;
    color: #1d1d1f;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-modal-add {
    flex: 1;
    padding: 16px;
    background: var(--new-accent);
    color: var(--new-white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-modal-add:hover {
    background: #0077ed;
    transform: translateY(-2px);
}

/* Loading State */
.loading-new {
    text-align: center;
    padding: 80px 20px;
}

.spinner-new {
    width: 40px;
    height: 40px;
    border: 3px solid var(--new-light);
    border-top-color: var(--new-black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state-new {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    padding: 0 40px;
}

.empty-state-new h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--new-black);
    margin: 0 0 12px 0;
}

.empty-state-new p {
    font-size: 17px;
    color: var(--new-gray);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.btn-back-new {
    padding: 14px 28px;
    background: var(--new-black);
    color: var(--new-white);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-back-new:hover {
    background: #1d1d1f;
    transform: translateY(-2px);
}

/* ==================== PRODUCT TITLE LINK ==================== */
.product-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-title-link:hover .product-title-new {
    color: var(--new-accent);
}

/* ==================== PRODUCT SPECS PREVIEW ==================== */
.product-specs-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.spec-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--new-light);
    border-radius: 4px;
    font-size: 10px;
    color: var(--new-gray);
}

.spec-tag i {
    color: #34c759;
    font-size: 8px;
}

/* ==================== STOCK INDICATOR ==================== */
.stock-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stock-indicator.in-stock {
    color: #34c759;
}

.stock-indicator.out-of-stock {
    color: #ff3b30;
}

.stock-indicator i {
    font-size: 12px;
}

/* ==================== DISABLED BUTTON ==================== */
.btn-buy-new:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
    transform: none;
}

.btn-buy-new:disabled:hover {
    transform: none;
}

/* ==================== MODAL ENHANCEMENTS ==================== */
.modal-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 10px 16px;
    border-radius: 8px;
}

.modal-stock.in-stock {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.modal-stock.out-of-stock {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.modal-specs {
    background: var(--new-light);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.modal-specs h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--new-black);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-specs h4 i {
    color: var(--new-accent);
}

.modal-specs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-specs ul li {
    font-size: 13px;
    color: var(--new-gray);
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.modal-specs ul li:last-child {
    border-bottom: none;
}

.modal-specs ul li strong {
    color: var(--new-black);
}

/* View Full Details Button */
.btn-modal-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--new-light);
    color: var(--new-black);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-modal-details:hover {
    background: var(--new-black);
    color: var(--new-white);
    border-color: var(--new-black);
}

.btn-modal-add:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Tablet */
@media (max-width: 1024px) {
    .top-nav .container {
        padding: 0 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .category-layout {
        grid-template-columns: 1fr;
        padding: 0 20px;
        margin: 20px auto;
        gap: 20px;
    }

    .sidebar-filters {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .filter-section {
        margin-bottom: 0;
    }

    .products-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .modal-body {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .category-hero-new {
        padding: 40px 20px 30px 20px;
    }

    .category-hero-new h1 {
        font-size: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Top Navigation - Mobile */
    .top-nav {
        padding: 10px 0;
    }

    .top-nav .container {
        padding: 0 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo-link {
        font-size: 18px;
        order: 1;
    }

    .cart-link {
        order: 2;
        margin-left: auto;
    }

    .nav-links {
        order: 3;
        width: 100%;
        gap: 15px;
        overflow-x: auto;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        font-size: 13px;
    }

    /* Hero - Mobile */
    .category-hero-new {
        padding: 30px 15px;
    }

    .category-hero-new h1 {
        font-size: 28px;
        letter-spacing: -0.5px;
    }

    .category-hero-new p {
        font-size: 15px;
    }

    /* Layout - Mobile */
    .category-layout {
        padding: 0 10px;
        margin: 15px auto;
        gap: 15px;
    }

    /* Sidebar Filters - Mobile Collapsible */
    .sidebar-filters {
        display: block;
        background: #f5f5f7;
        border-radius: 12px;
        padding: 15px;
    }

    .filter-section {
        border: none;
        background: transparent;
        padding: 10px 0;
        margin-bottom: 0;
        border-bottom: 1px solid var(--border-light);
    }

    .filter-section:last-child {
        border-bottom: none;
    }

    .filter-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .filter-group label {
        font-size: 13px;
        padding: 6px 0;
    }

    .price-range {
        flex-wrap: wrap;
    }

    .price-range input {
        width: 70px;
        padding: 6px;
        font-size: 13px;
    }

    /* Products Grid - Mobile */
    .products-grid-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card-new {
        border-radius: 10px;
    }

    .product-image-new {
        aspect-ratio: 1 / 1;
    }

    .btn-quick-view {
        display: none; /* Hide quick view on mobile - use tap instead */
    }

    .product-info-new {
        padding: 12px;
    }

    .product-brand-new {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .product-title-new {
        font-size: 13px;
        min-height: 34px;
        margin-bottom: 6px;
    }

    .product-price-new {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .price-old-new {
        font-size: 11px;
    }

    .btn-buy-new {
        padding: 8px;
        font-size: 12px;
        border-radius: 6px;
    }

    .product-badge-new {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 9px;
    }

    /* Modal - Mobile */
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-body {
        padding: 20px;
        gap: 20px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .modal-image {
        border-radius: 8px;
    }

    .modal-details h2 {
        font-size: 22px;
    }

    .modal-brand {
        font-size: 12px;
    }

    .modal-price {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .modal-description {
        font-size: 14px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-modal-add {
        padding: 14px;
        font-size: 15px;
    }

    /* Empty State - Mobile */
    .empty-state-new {
        margin: 40px auto;
        padding: 0 20px;
    }

    .empty-state-new h2 {
        font-size: 24px;
    }

    .empty-state-new p {
        font-size: 15px;
    }

    .btn-back-new {
        padding: 12px 24px;
        font-size: 14px;
    }

    .btn-reset-filters {
        padding: 10px;
        font-size: 13px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .category-hero-new h1 {
        font-size: 24px;
    }

    .category-hero-new p {
        font-size: 14px;
    }

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

    .product-info-new {
        padding: 10px;
    }

    .product-title-new {
        font-size: 12px;
        min-height: 30px;
    }

    .product-price-new {
        font-size: 13px;
    }

    .btn-buy-new {
        padding: 7px;
        font-size: 11px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 12px;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .product-card-new:active {
        transform: scale(0.98);
    }

    .btn-buy-new:active {
        transform: scale(0.95);
    }

    /* Show tap feedback instead of hover */
    .product-card-new:hover {
        transform: none;
        box-shadow: none;
    }

    .product-card-new:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}
