/* ========================================
   CATEGORY PAGE STYLES
   Dark Theme with Orange Accents
   ======================================== */

/* Override body padding for this page */
body {
    padding-bottom: calc(var(--search-bar-height) + 20px);
}

/* Category Header */
.category-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 40px 20px;
    border-bottom: 1px solid var(--border-color);
}

.category-header-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb span:last-child {
    color: var(--text-primary);
}

/* Category Title */
.category-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.product-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Products Section */
.products-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 100px;
}

.products-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* Filters Sidebar */
.filters-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: start;
    height: fit-content;
}

.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.filter-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%23666'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

.filter-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Price Filter */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.price-input {
    flex: 1;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}

.price-input:focus {
    border-color: var(--accent-primary);
}

.price-input::placeholder {
    color: var(--text-muted);
}

.price-separator {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 2px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.category-list a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.category-list a.active {
    color: var(--accent-primary);
    background: rgba(255, 109, 0, 0.1);
}

.category-list .count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Products Main Area */
.products-main {
    min-height: 400px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loader {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.loader span {
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loader span:nth-child(1) { animation-delay: 0s; }
.loader span:nth-child(2) { animation-delay: 0.2s; }
.loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-15px); opacity: 1; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Product Grid */
.products-main .product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Product Card - override masonry styles */
.products-main .product-card {
    width: 100% !important;
    margin-bottom: 0 !important;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.products-main .product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 109, 0, 0.15);
}

.products-main .product-image-container {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.products-main .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    background: #fff;
    padding: 10px;
}

.products-main .product-card:hover .product-image {
    transform: scale(1.05);
}

.products-main .quick-view-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bg-primary);
    background: var(--accent-primary);
    border-radius: 6px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.products-main .product-card:hover .quick-view-badge {
    opacity: 1;
    transform: translateY(0);
}

.products-main .product-info {
    padding: 18px;
}

.products-main .product-category {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.products-main .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}

.products-main .product-name a {
    color: inherit;
    text-decoration: none;
}

.products-main .product-name a:hover {
    color: var(--accent-primary);
}

.products-main .product-sku {
    font-size: 0.7rem;
    font-family: var(--font-display);
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.products-main .product-pricing {
    margin-bottom: 15px;
}

.products-main .price-case {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.products-main .price-amount {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.products-main .price-amount .currency {
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.products-main .price-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.products-main .price-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.products-main .product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-main .quantity-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.products-main .qty-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.products-main .qty-select {
    width: 60px;
    height: 38px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%23666'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.products-main .qty-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.products-main .qty-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.products-main .add-to-cart-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bg-primary);
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.products-main .add-to-cart-btn:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 109, 0, 0.4);
}

.products-main .add-to-cart-btn.added {
    background: #22c55e;
    border-color: #22c55e;
}

.products-main .add-to-cart-btn svg {
    flex-shrink: 0;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-primary {
    color: var(--bg-primary);
    background: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 109, 0, 0.4);
}

.btn-outline {
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 20px 30px;
    margin-top: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
}

.footer-brand .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 16px;
}

.footer-brand .logo-icon {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.footer-brand .accent {
    color: var(--accent-primary);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-column h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-column a {
    display: block;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .products-main .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .products-container {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        margin-bottom: 20px;
    }

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

    .filter-section:last-child {
        grid-column: 1 / -1;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .filters-sidebar {
        grid-template-columns: 1fr 1fr;
    }

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

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .category-title {
        font-size: 1.3rem;
    }

    .products-section {
        padding: 24px 16px 100px;
    }

    .filters-sidebar {
        grid-template-columns: 1fr;
    }

    .products-main .product-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .products-main .product-info {
        padding: 14px;
    }

    .products-main .price-amount {
        font-size: 1.1rem;
    }
}
