/* ========================================================
   COMPLETE NEXT.JS STYLE ARCHIVE TEMPLATE
   ======================================================== */

:root {
    --app-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --brand-color: #2b266c;   /* Updated Primary Color */
    --brand-hover: #1e1b4b;   /* Darker shade for hover states */
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --app-max-width: 1280px;
}

/* Force Divi container to full width */
#main-content .container { width: 100% !important; max-width: 100% !important; padding: 0 !important; }
#left-area { width: 100% !important; float: none !important; padding: 0 !important; }
#sidebar { display: none !important; }

/* Main Wrapper */
.nextjs-shop-wrapper {
    background-color: var(--app-bg);
    min-height: 80vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding-bottom: 80px;
}

.nextjs-container {
    max-width: var(--app-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------- Hero Section ---------------- */
.nextjs-shop-hero {
    background-color: #ffffff;
    padding: 50px 0 35px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    text-align: left;
}

.nextjs-breadcrumbs {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nextjs-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.nextjs-breadcrumbs a:hover { color: var(--brand-color); }

.nextjs-page-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin: 0;
}

/* ---------------- Grid Overrides (Fixes Squished Cards) ---------------- */
.woocommerce ul.products,
.woocommerce-page ul.products,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
}

.woocommerce ul.products::before, 
.woocommerce ul.products::after,
ul.products::before, 
ul.products::after { 
    display: none !important; 
}

/* Force items to fill 100% of their grid cell */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce ul.products li.modern-product-card,
.woocommerce-page ul.products li.modern-product-card,
li.modern-product-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    list-style: none !important;
    opacity: 0; /* JS Fade in */
    transform: translateY(20px);
}

.modern-card-inner {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

.modern-card-inner:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

/* ---------------- Card Details ---------------- */
.modern-card-image-wrapper {
    background-color: #ffffff;
    padding: 24px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.modern-product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.modern-card-inner:hover .modern-product-image { transform: scale(1.05); }

.modern-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.modern-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px 0 !important;
    line-height: 1.4;
}
.modern-title-link { text-decoration: none !important; }

.modern-product-price {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
}

.modern-card-action { margin-top: auto; }

.modern-card-action .button {
    display: block;
    width: 100%;
    text-align: center;
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    border: 1px solid var(--border-color) !important;
}

.modern-card-action .button:hover {
    background: var(--brand-color) !important;
    color: white !important;
    border-color: var(--brand-color) !important;
}


/* Product Category Label */
.modern-product-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-color);
    margin-bottom: 6px;
    display: block;
}

/* Dynamic AJAX Loading State (React Feel) */
.nextjs-main-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nextjs-main-content.is-loading {
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0.99);
}