/* Category Page Styles */

/* Logo size — matches header.css */

.breadcrumbs {
    background: #f9fafb;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}
.breadcrumbs a {
    color: #008b44;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

.category-hero {
    padding: 80px 0;
    text-align: center;
    color: white;
    position: relative;
    background-size: cover;
    background-position: center;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.category-hero > * {
    position: relative;
    z-index: 2;
}

.category-hero h1 {
    font-size: clamp(32px, 6vw, 56px);
    margin-bottom: 16px;
    font-weight: 900;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.category-hero .subtitle {
    font-size: clamp(16px, 3vw, 22px);
    opacity: 0.95;
    margin-bottom: 12px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.category-hero .category-count {
    font-size: clamp(14px, 2vw, 16px);
    opacity: 0.9;
}

.subcategory-nav {
    background: white;
    border-bottom: 2px solid #e5e7eb;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.subcat-buttons {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.subcat-btn {
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.subcat-btn:hover {
    border-color: #008b44;
    background: #f0f9f4;
}
.subcat-btn.active {
    background: #008b44;
    color: white;
    border-color: #008b44;
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 40px 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}
.sidebar-section {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.sidebar-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #0a1612;
}
.brand-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.brand-item {
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-item:hover {
    background: #f0f9f4;
    color: #008b44;
}
.brand-star {
    color: #F7C951;
    font-size: 16px;
}
.guide-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-list li {
    margin-bottom: 12px;
}
.guide-list a {
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
}
.guide-list a:hover {
    color: #008b44;
    text-decoration: underline;
}

.sidebar-cta {
    background: linear-gradient(135deg, #008b44, #006d35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
}
.cta-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.sidebar-cta h4 {
    font-size: 20px;
    color: white;
    margin-bottom: 8px;
}
.sidebar-cta p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}
.btn-sidebar {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #008b44;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}
.btn-sidebar:hover {
    background: #f9fafb;
    transform: translateY(-2px);
}

/* Product Area */
.product-area {
    min-height: 800px;
}
.category-intro {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}
.category-intro h2 {
    font-size: 32px;
    margin-bottom: 16px;
    color: #0a1612;
}
.category-intro > p {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 24px;
}

.buying-guide {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
}
.buying-guide h3 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #0a1612;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.guide-card {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}
.guide-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.guide-card h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #0a1612;
}
.guide-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.filter-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}
.results-count {
    font-size: 16px;
    color: #4b5563;
}
.sort-control,
.brand-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Brand dropdown — same style as sort/pagesize selects */
.brand-control label {
    font-weight: 600;
    color: #0a1612;
    white-space: nowrap;
}
#spg-brand {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    min-width: 220px;
}
.sort-control label {
    font-weight: 600;
    color: #0a1612;
}
.sort-select {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.product-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px -8px rgba(0,0,0,0.2);
    border-color: #008b44;
}
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: #008b44;
    color: white;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    z-index: 10;
    letter-spacing: 0.5px;
}
.product-badge.new {
    background: #6366f1;
}
.product-image {
    width: 100%;
    height: 220px;
    background: #f0f0f0;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.6) 100%
    );
    opacity: 0;
    transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image::before {
    opacity: 1;
}

/* Image zoom effect on hover */
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}
.product-info {
    padding: 20px;
}
.product-brand {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.product-name {
    font-size: 18px;
    font-weight: 700;
    color: #0a1612;
    margin-bottom: 8px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}
.product-specs {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}
.product-price {
    font-size: 24px;
    font-weight: 800;
    color: #008b44;
    margin-bottom: 16px;
}
.btn-add-cart {
    width: 100%;
    padding: 12px 20px;
    background: #008b44;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-add-cart:hover {
    background: #006d35;
    transform: translateY(-2px);
}

.product-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
}
.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.product-placeholder h4 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #0a1612;
}
.product-placeholder p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}
.btn-call {
    display: inline-block;
    padding: 14px 32px;
    background: #008b44;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}
.btn-call:hover {
    background: #006d35;
    transform: translateY(-2px);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2.5rem;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-btn.page-num {
    padding: 0;
    width: 44px;
}
.page-btn:hover:not(:disabled) {
    border-color: #008b44;
    background: #f0f9f4;
}
.page-btn.active {
    background: #008b44;
    color: white;
    border-color: #008b44;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.category-faq {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
}
.category-faq h3 {
    font-size: 28px;
    margin-bottom: 24px;
    color: #0a1612;
}
.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}
.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.faq-item h4 {
    font-size: 18px;
    color: #0a1612;
    margin-bottom: 12px;
}
.faq-item p {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 60px 0;
    }
    
    .category-hero h1 {
        font-size: clamp(28px, 6vw, 36px);
    }
    .category-hero .subtitle {
        font-size: clamp(16px, 3vw, 18px);
    }
    .subcat-buttons {
        flex-wrap: nowrap;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .guide-grid {
        grid-template-columns: 1fr;
    }
    .filter-sort-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .product-specs {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .category-intro {
        padding: 24px;
    }
    
    .category-intro h2 {
        font-size: 24px;
    }
    
    .category-intro > p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .category-hero {
        padding: 48px 0;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-image {
        height: 200px;
    }
    
    .main-content {
        gap: 24px;
        padding: 32px 0;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 375px) {
    .category-hero h1 {
        font-size: 24px;
    }
    
    .category-hero .subtitle {
        font-size: 14px;
    }
    
    .product-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
}

/* ========================================
   BRAND-FIRST NAVIGATION (Nutrients)
   ======================================== */

.brand-nav-section {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}
.brand-nav-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #0a1612;
}
.brand-nav-section > p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 24px;
}
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.brand-card:hover {
    border-color: #008b44;
    background: #f0f9f4;
    color: #008b44;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 158, 82, 0.15);
}
.brand-card.active {
    border-color: #008b44;
    background: #008b44;
    color: white;
}
.brand-card .brand-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}
.brand-card.active .brand-count {
    background: rgba(255,255,255,0.2);
}
.brand-card .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: white;
}
.brand-featured {
    border-color: #F7C951;
    background: #fffdf5;
}
.brand-featured::before {
    content: '★';
    color: #F7C951;
    font-size: 14px;
}

/* Filter mode toggle (brand vs function) */
.filter-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    width: fit-content;
}
.filter-mode-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}
.filter-mode-btn.active {
    background: white;
    color: #0a1612;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.filter-mode-btn:hover:not(.active) {
    color: #374151;
}

/* Subcategory filter section (within brand view) */
.subcat-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.subcat-chip {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4b5563;
}
.subcat-chip:hover {
    border-color: #008b44;
    color: #008b44;
}
.subcat-chip.active {
    background: #008b44;
    color: white;
    border-color: #008b44;
}

/* Type cards for non-brand categories (Grow Lights, etc.) */
.type-nav-section {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}
.type-nav-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #0a1612;
}
.type-nav-section > p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 24px;
}
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #1f2937;
}
.type-card:hover {
    border-color: #008b44;
    background: #f0f9f4;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(71, 158, 82, 0.12);
}
.type-card.active {
    border-color: #008b44;
    background: #008b44;
    color: white;
}
.type-card .type-icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.type-card .type-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}
.type-card .type-count {
    font-size: 13px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    .brand-card {
        padding: 10px 12px;
        font-size: 13px;
    }
    .type-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .type-card {
        padding: 16px 12px;
    }
    .type-card .type-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    .brand-nav-section,
    .type-nav-section {
        padding: 20px;
    }
    .filter-mode-toggle {
        width: 100%;
    }
    .filter-mode-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .brand-grid {
        grid-template-columns: 1fr 1fr;
    }
    .type-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Category page footer layout */
.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}
