/* =================================================================
   1. DESIGN SYSTEM & GLOBAL STYLES
   Note: Main variables defined in variables.css
================================================================= */
:root {
    /* Local overrides if needed - main vars in variables.css */
    --color-primary: var(--wm-red, #A52A2A);
    --color-primary-dark: var(--wm-red-dark, #7A1F1F);
    --color-dark: var(--wm-dark-gray, #212529);
    --color-text: var(--wm-body-text, #555);
    --color-text-light: var(--text-light, #777);
    --color-surface: var(--wm-white, #FFFFFF);
    --color-background: var(--wm-light-gray, #F8F9FC);
    --color-border: var(--border-color, #E8EDF5);
    --font-primary: var(--wm-font, 'Jost', sans-serif);
    --border-radius-md: 16px;
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --transition-main: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

.section {
    padding: 80px 0;
}

/* =================================================================
   2. HERO SECTION
================================================================= */
.solutions-hero {
    position: relative;
    padding: 120px 0;
    background-size: cover;
    background-position: center;
    color: var(--color-surface);
    text-align: center;
    background-color: var(--color-dark);
}

.solutions-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, rgba(18, 24, 34, 0.8) 0%, rgba(18, 24, 34, 0.6) 50%, transparent 100%);
    z-index: 1;
}

.solutions-hero .container {
    position: relative;
    z-index: 2;
}

.solutions-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -1px;
    color: #ffffff !important; /* Always white, regardless of theme */
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

.solutions-hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 1rem auto 0;
    color: rgba(255, 255, 255, 0.9) !important; /* Always white, regardless of theme */
    font-weight: 300;
}

/* =================================================================
   3. STATIC FILTER BAR
================================================================= */
.filter-bar-wrapper {
    background-color: var(--color-surface);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 999;
}

.filter-group {
    /* Added this for responsive stacking */
    /* On desktop, flex items will arrange side-by-side naturally */
    /* On mobile, Bootstrap classes d-md-none / d-none d-md-flex will handle visibility */
    display: flex;
}

/* Styles for the filter-dropdown (Desktop/Tablet) */
.filter-dropdown .filter-label {
    font-weight: 600;
    color: var(--color-dark);
    margin-right: 1rem;
}

.btn-filter-dropdown {
    background-color: var(--color-background);
    color: var(--color-dark);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    /* Slightly rounded corners for the button */
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: var(--transition-main);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-filter-dropdown:hover,
.btn-filter-dropdown.show {
    background-color: #E8EDF5;
    border-color: #E8EDF5;
    color: var(--color-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-filter-dropdown::after {
    /* Bootstrap dropdown arrow */
    margin-left: 0.75rem;
}

.filter-dropdown .dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    min-width: 200px;
}

.filter-dropdown .dropdown-item {
    color: var(--color-text);
    padding: 0.75rem 1.25rem;
    font-weight: 400;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-dropdown .dropdown-item:hover,
.filter-dropdown .dropdown-item.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

/* Styles for the filter-select-mobile (Mobile) - Keep previous ones */
.filter-select-mobile .form-select {
    border-color: var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    color: var(--color-dark);
    background-color: var(--color-background);
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.filter-select-mobile .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--color-primary), 0.25);
}


/* =================================================================
   4. PRODUCT GRID & CARDS
================================================================= */
.product-grid-section {
    background-color: var(--color-background);
    /* Padding inherited from .section class */
}

.solution-card {
    background-color: #ffffff; /* Always white in light mode */
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    position: relative;
    will-change: transform;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); /* Add subtle shadow like home page */
}

.solution-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.solution-card .card-image-wrapper {
    display: block;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background-color: #f8f9fa; /* Light gray background like home page */
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    position: relative;
}

.solution-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                object-fit 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    will-change: transform;
}

.solution-card:hover .card-image {
    transform: scale(1.05);
    object-fit: cover;
    object-position: center;
}

.solution-card .card-content {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

.solution-card .card-tags {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
    margin-bottom: 8px;
}

.solution-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
    line-height: 1.35;
    letter-spacing: -0.02em;
    transition: color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.solution-card:hover .card-title {
    color: var(--color-primary);
}

.solution-card .card-description {
    color: var(--color-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.solution-card .card-specs {
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.solution-card .spec-item i {
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
    display: block;
}

.solution-card .spec-item .spec-value {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-dark);
    display: block;
}

.solution-card .spec-item .spec-label {
    font-size: 0.7rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    display: block;
}

.solution-card .btn-view-details {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.75rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.solution-card .btn-view-details::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.solution-card .btn-view-details:hover::before {
    width: 300px;
    height: 300px;
}

.solution-card .btn-view-details:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 8px 20px rgba(165, 42, 42, 0.3);
    transform: translateY(-2px);
}

/* =================================================================
   5. BRAND LOGOS CAROUSEL & CTA
================================================================= */
.brand-carousel-section {
    background-color: var(--color-surface);
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 3rem;
}

.brand-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    min-height: 140px;
    height: auto;
    overflow: visible; /* Prevent clipping of brand logos */
}

.brand-logo-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 28px);
    width: min(280px, 75vw); /* Fixed reasonable width for brand logos */
    min-height: min(140px, 40vw);
    height: auto; /* Allow card to grow with content */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Prevent logos from overflowing */
}

.brand-logo-card .brand-logo-image {
    display: block;
    width: 100%; /* Use full card width */
    height: auto;
    max-width: 100%; /* Constrain to card width */
    max-height: 160px; /* Reasonable max height for logos */
    object-fit: contain; /* Preserve aspect ratio, show full logo */
    object-position: center;
}

.brand-swiper .swiper-slide:hover .brand-logo-card {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.contact-cta-section {
    background-color: var(--color-background);
    border-top: 1px solid var(--color-border);
    text-align: center;
    /* Padding inherited from .section class (80px 0) */
    display: block !important; /* Ensure section is visible */
    position: relative;
    z-index: 1;
    min-height: 200px; /* Ensure minimum height */
}

.contact-cta-section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    color: var(--color-dark);
    display: block; /* Ensure heading is visible */
}

.contact-cta-section p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    color: var(--color-text);
    display: block; /* Ensure paragraph is visible */
}

.contact-cta-section .btn-cta {
    background-color: var(--color-primary);
    color: var(--color-surface);
    padding: 16px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition-main);
    display: inline-block;
}

.contact-cta-section .btn-cta:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.contact-cta-section .btn-cta .fa-arrow-right {
    margin-left: 0.5rem;
    transition: transform 0.2s ease-out;
}

.contact-cta-section .btn-cta:hover .fa-arrow-right {
    transform: translateX(4px);
}

/* =================================================================
   6. RESPONSIVE DESIGN ADJUSTMENTS
================================================================= */

/* Medium devices (tablets, less than 992px) */
@media (max-width: 992px) {
    .filter-tabs .filter-label {
        display: none;
    }
}

/* Small devices (phones, less than 768px) */
@media (max-width: 768px) {
    .section {
        padding: 40px 0; /* Reduced padding for mobile */
    }

    /* --- Hero Section --- */
    .solutions-hero {
        padding: 60px 0;
    }

    .solutions-hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .solutions-hero p {
        font-size: 1rem;
        padding: 0 15px;
    }

    /* --- Filter Bar --- */
    .filter-bar-wrapper {
        padding: 1rem 0;
    }

    .filter-dropdown {
        display: none;
    }

    .filter-group {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .filter-group:last-child {
        margin-bottom: 0;
    }

    .filter-select-mobile .form-select {
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }

    /* --- Product Cards - Full Width, One Per Row --- */
    .product-grid-section .row {
        margin: 0;
    }

    .product-grid-section .col {
        padding: 0 0 1.5rem 0;
        width: 100%;
        max-width: 100%;
    }

    .solution-card {
        margin: 0;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .solution-card .card-image-wrapper {
        height: 280px; /* Optimized height for mobile */
        border-radius: 12px 12px 0 0;
    }

    .solution-card .card-content {
        padding: 18px;
    }

    .solution-card .card-title {
        font-size: 1.15rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }

    .solution-card .card-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .solution-card .card-specs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: left;
        border-top: 1px solid var(--color-border);
        padding-top: 1rem;
        margin-top: 1rem;
    }

    .solution-card .spec-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-top: 1px solid var(--color-border);
    }

    .solution-card .spec-item:first-child {
        border-top: none;
        padding-top: 0;
    }

    .solution-card .spec-item i {
        margin-bottom: 0;
        margin-right: 12px;
        width: 20px;
        flex-shrink: 0;
    }

    .solution-card .spec-item .spec-value {
        display: inline-block;
        margin-right: 5px;
        font-size: 0.9rem;
        font-weight: 600;
    }

    .solution-card .spec-item .spec-label {
        display: inline-block;
        font-size: 0.8rem;
        color: var(--color-text-light);
    }

    .solution-card .btn-view-details {
        width: 100%;
        padding: 12px 20px;
        margin-top: 1rem;
        text-align: center;
    }

    /* --- CTA Section --- */
    .contact-cta-section {
        padding: 40px 0;
    }

    .contact-cta-section h2 {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    .contact-cta-section p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .contact-cta-section .btn-cta {
        padding: 14px 35px;
        font-size: 1rem;
    }
}

/* Extra small devices (phones, 575px and down) */
@media (max-width: 575px) {
    .section {
        padding: 35px 0;
    }

    .solutions-hero {
        padding: 50px 0;
    }

    .solutions-hero h1 {
        font-size: 1.6rem;
    }

    .solution-card .card-image-wrapper {
        height: 240px;
    }

    .solution-card .card-content {
        padding: 16px;
    }

    .solution-card .card-title {
        font-size: 1.05rem;
    }

    .contact-cta-section h2 {
        font-size: 1.4rem;
    }
}

/* =================================================================
   DARK MODE SUPPORT FOR SHOP PAGE
================================================================= */
[data-theme="dark"] .product-grid-section {
    background-color: var(--dm-bg);
}

[data-theme="dark"] .solution-card {
    background-color: #1a1a1a; /* Dark background like home page cards */
    border-color: var(--dm-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Darker shadow for dark mode */
}

[data-theme="dark"] .solution-card .card-title {
    color: var(--dm-text-primary);
}

[data-theme="dark"] .solution-card .card-description {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .solution-card .card-tags {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .solution-card .card-specs {
    border-top-color: var(--dm-border);
}

[data-theme="dark"] .solution-card .spec-item .spec-value {
    color: var(--dm-text-primary);
}

[data-theme="dark"] .solution-card .spec-item .spec-label {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .solution-card .card-image-wrapper {
    background-color: #0a0a0a;
}

[data-theme="dark"] .solutions-hero {
    background-color: var(--dm-bg);
}

[data-theme="dark"] .solutions-hero h1 {
    color: #ffffff !important; /* Always white, regardless of theme */
}

[data-theme="dark"] .solutions-hero p {
    color: rgba(255, 255, 255, 0.9) !important; /* Always white, regardless of theme */
}

[data-theme="dark"] .brand-carousel-section {
    background-color: var(--dm-surface);
}

[data-theme="dark"] .contact-cta-section {
    background-color: var(--dm-bg);
}

[data-theme="dark"] .contact-cta-section h2 {
    color: var(--dm-text-primary);
}

[data-theme="dark"] .contact-cta-section p {
    color: var(--dm-text-secondary);
}

[data-theme="dark"] .section-title {
    color: var(--dm-text-primary);
}

/* =================================================================
   PAGINATION STYLES - Red theme to match brand identity
================================================================= */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-item .page-link {
    color: var(--color-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-item .page-link:hover {
    color: var(--color-surface);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(165, 42, 42, 0.2);
}

.pagination .page-item.active .page-link {
    color: var(--color-surface);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: var(--color-text-light);
    background-color: var(--color-background);
    border-color: var(--color-border);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}