/**
 * Natpack WooCommerce Shop Page - V1.0.4
 * Professional, Clean, Minimal Design
 */

:root {
    --primary: #003B6F;        
    --primary-light: #00509d;
    --accent-blue: #00A8E8;
    --dark: #0f172a;           
    --gold: #C5A059;           
    --gold-gradient: linear-gradient(135deg, #C5A059 0%, #E6C888 100%);
    --bg-light: #F8FAFC;       
    --bg-white: #FFFFFF;
    --container: 1320px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --shadow-soft: 0 4px 25px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 40px rgba(0, 59, 111, 0.12);
    --border-color: #E2E8F0;
}

/* --- CONTAINER --- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- BUTTONS --- */
.btn {
    padding: 10px 24px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 15px;
    border-radius: 6px;
}

.btn-gold {
    background: var(--gold-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
}

.btn-gold:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 15px 30px rgba(197, 160, 89, 0.4); 
}

/* --- PAGE HERO --- */
.page-hero {
    padding-top: 140px;
    padding-bottom: 50px;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('https://www.preweb.site/projects/natpack/wp-content/uploads/2026/01/N-subtle-bg-img.png');
    opacity: 0.03;
    background-size: cover;
}

.page-hero .eyebrow {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: inline-block;
    background: rgba(197, 160, 89, 0.1);
    padding: 5px 12px;
    border-radius: 50px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    color: #64748B;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

.page-hero h1 {
    font-size: clamp(32px, 4vw, 42px);
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    font-weight: 800;
}

.page-hero p {
    color: #556987;
    font-size: 16px;
    max-width: 600px;
    line-height: 1.6;
}

/* --- SHOP LAYOUT --- */
.shop-section {
    padding: 40px 0 80px;
}

.shop-wrapper {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 30px;
    align-items: start;
}

/* --- SIDEBAR FILTERS (FIXED HEIGHT WITH SCROLL) --- */
.sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
    
    /* FIXED: 100vh max height with internal scrolling */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { 
    background-color: #cbd5e1; 
    border-radius: 20px;
    transition: background-color 0.2s;
}
.sidebar::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-group:last-child {
    border: none;
    margin: 0;
    padding: 0;
}

/* IMPROVED: Better filter title design */
.filter-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
}

/* IMPROVED: Elegant filter items with smaller checkboxes */
.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: 0.2s;
    padding: 6px 8px;
    border-radius: 4px;
    position: relative;
}

.filter-item:hover { 
    background: #F8FAFC;
    color: var(--primary);
}

/* FIXED: Smaller, more elegant checkbox */
.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.filter-item label {
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    font-weight: 500;
    color: #475569;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.filter-item:hover label {
    color: var(--primary);
}

.filter-count {
    font-size: 11px;
    color: #94a3b8;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- PRODUCTS HEADER (IMPROVED RIBBON) --- */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    min-height: auto;
}

.results-count {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

.results-count strong {
    color: var(--primary);
    font-weight: 800;
}

.view-toggle {
    display: flex;
    gap: 8px;
    margin-right: 20px;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    color: #64748B;
}

.view-btn:hover, .view-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* IMPROVED: Better dropdown styling */
.woocommerce-ordering {
    display: flex;
    align-items: center;
    margin: 0;
    position: relative;
}

.woocommerce-ordering select {
    padding: 10px 40px 10px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    background: white;
    font-weight: 600;
    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'%3E%3Cpath fill='%23003B6F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s;
    color: var(--primary);
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.woocommerce-ordering select:hover {
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(0, 59, 111, 0.12);
    transform: translateY(-1px);
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 59, 111, 0.1);
}

/* --- PRODUCT GRID --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 59, 111, 0.1);
    border-color: #cbd5e1;
}

/* FIXED: Removed empty space between image and content */
.product-image {
    position: relative;
    height: 320px;
    background: #F8FAFC;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;
    padding: 20px;
    pointer-events: none; /* CRITICAL: Let clicks pass through to links below */
}

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

/* Quick View Icon - REALLY REALLY Clickable Now! */
.quick-view {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    text-decoration: none;
    pointer-events: auto; /* CRITICAL: Make sure this element receives clicks */
}

.quick-view i {
    color: var(--primary);
    font-size: 16px;
    pointer-events: none; /* Icon shouldn't interfere with link clicks */
}

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

.quick-view:hover {
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 59, 111, 0.2);
    transform: translateY(-2px);
}

.quick-view:hover i {
    color: white;
}

/* IMPROVED: Minimal, elegant badge */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold);
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 3px;
    z-index: 2;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 6px;
}

.product-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: var(--gold);
}

.product-specs {
    display: flex;
    gap: 16px;
    margin: 10px 0 16px 0;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748B;
    font-weight: 600;
}

.spec-item i {
    color: var(--gold);
    font-size: 12px;
}

/* IMPROVED: Professional buttons */
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 0;
}

.product-btn {
    text-align: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
    font-family: inherit;
}

/* View Details Button */
.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 59, 111, 0.15);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 59, 111, 0.25);
}

/* Quote Button */
.btn-outline {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 59, 111, 0.2);
}

/* --- PAGINATION --- */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-wrapper a,
.pagination-wrapper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    background: white;
}

.pagination-wrapper a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination-wrapper span.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- CTA SECTION --- */
.cta-section {
    padding: 80px 0;
    background: var(--primary);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.preweb.site/projects/natpack/wp-content/uploads/2026/01/N-subtle-bg-img.png');
    opacity: 0.05;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 16px;
}

.cta-section p {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* --- YITH FILTER FIXES --- */
.yith-wcan-filters .yith-wcan-filter {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.yith-wcan-filters .filter-title,
.yith-wcan-filters .yith-wcan-filter-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
}

.yith-wcan-filters .yith-wcan-filter-content li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: 0.2s;
}

.yith-wcan-filters .yith-wcan-filter-content li:hover {
    background: #F8FAFC;
}

.yith-wcan-filters .yith-wcan-filter-content li input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    border-radius: 3px;
    margin: 0;
    flex-shrink: 0;
}

/* FIXED: Add space between checkbox and text */
.yith-wcan-filters .yith-wcan-filter-content li label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.yith-wcan-filters .yith-wcan-filter-content li a,
.yith-wcan-filters .yith-wcan-filter-content li label a,
.yith-wcan-filters .yith-wcan-filter-content li .term-label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.yith-wcan-filters .yith-wcan-filter-content li:hover label a,
.yith-wcan-filters .yith-wcan-filter-content li:hover a,
.yith-wcan-filters .yith-wcan-filter-content li:hover .term-label {
    color: var(--primary);
}
}

.yith-wcan-filters .yith-wcan-filter-content li:hover label {
    color: var(--primary);
}

/* --- LIST VIEW --- */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.products-list .product-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

.products-list .product-image {
    height: 200px;
}

.products-list .product-info {
    display: flex;
    flex-direction: column;
}

.products-list .product-actions {
    margin-top: auto;
    grid-template-columns: 200px 200px;
    justify-content: start;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .shop-wrapper { 
        grid-template-columns: 1fr; 
    }
    
    .sidebar { 
        position: static; 
        max-height: none; 
        overflow: visible; 
        display: grid; 
        grid-template-columns: repeat(3, 1fr); 
        gap: 24px; 
    }
    
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .products-list .product-card {
        grid-template-columns: 1fr;
    }
    
    .products-list .product-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-hero { 
        padding-top: 110px; 
    }
    
    .products-grid { 
        grid-template-columns: 1fr; 
    }
    
    .sidebar { 
        grid-template-columns: 1fr; 
    }
    
    .products-header { 
        flex-direction: column; 
        gap: 16px; 
        align-items: flex-start; 
        padding: 20px; 
    }
    
    .woocommerce-ordering select {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .view-toggle { 
        display: none; 
    }
    
    .woocommerce-ordering, 
    .woocommerce-ordering select { 
        width: 100%; 
    }
    
    .product-actions {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
#products-grid.loading { 
    opacity: 0.5; 
    pointer-events: none; 
    position: relative; 
    min-height: 400px; 
}

#products-grid.loading::after {
    content: ''; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    width: 50px; 
    height: 50px; 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid #003B6F;
    border-radius: 50%; 
    animation: natpack-spin 1s linear infinite; 
    z-index: 9999;
}

@keyframes natpack-spin { 
    0% { transform: translate(-50%, -50%) rotate(0deg); } 
    100% { transform: translate(-50%, -50%) rotate(360deg); } 
}
