/* =====================================================
   Products Page — Premium Dark Theme
   ===================================================== */

/* ── Hero ── */
.products-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.products-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(10, 12, 13, 0.92) 45%, rgba(0, 230, 208, 0.08));
    z-index: 1;
}

.products-hero-grid {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8vw 140px 8vw;
    gap: 2rem;
}

.products-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
}

.products-hero-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #00e6d0;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    display: block;
}

.products-hero-heading {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.products-hero-highlight {
    color: #00e6d0;
    font-style: italic;
    display: block;
}

.products-hero-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    max-width: 440px;
}

.products-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1.5px solid rgba(0, 230, 208, 0.5);
    color: #00e6d0;
    padding: 0.75rem 1.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.3s;
    width: fit-content;
}

.products-hero-cta:hover {
    background: #00e6d0;
    color: #0a0c0d;
    border-color: #00e6d0;
}

/* hide the old image col — bg is now the hero background */
.products-hero-image {
    display: none;
}

/* ── Stat Bar ── */
.products-hero-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(10, 12, 13, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.products-stat-card {
    flex: 1;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    text-align: left;
    position: relative;
}

.products-stat-card+.products-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.products-stat-card i {
    font-size: 2rem;
    flex-shrink: 0;
}

.products-stat-card--accent i {
    color: #00e6d0;
}

.products-stat-card--dark i {
    color: #00e6d0;
}

.products-stat-card-text {
    display: flex;
    flex-direction: column;
}

.products-stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.products-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.3rem;
}

@media (max-width: 768px) {
    .products-hero-grid {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 5vw;
    }

    .products-hero-heading {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .products-stat-card {
        padding: 1.25rem 1rem;
        gap: 0.75rem;
    }

    .products-stat-number {
        font-size: 1.6rem;
    }
}

/* --- Filter/Search Bar --- */
.products-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding: 1.2rem 1.5rem;
    background: #1e2024;
    border-radius: 1rem;
    border: 1px solid #2a2d32;
}

.products-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}

.products-search input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    background: #16181a;
    border: 1.5px solid #2a2d32;
    border-radius: 2rem;
    color: #f8f9fa;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.products-search input:focus {
    border-color: #309290;
    box-shadow: 0 0 0 3px rgba(48, 146, 144, 0.15);
}

.products-search input::placeholder {
    color: #6b7280;
}

.products-search .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
    pointer-events: none;
}

.products-count {
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Filter Pills --- */
.filter-section {
    margin-bottom: 2rem;
}

.filter-label {
    color: #bfc3c6;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.6rem;
    display: block;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    background: #1e2024;
    border: 1.5px solid #2a2d32;
    border-radius: 2rem;
    color: #bfc3c6;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.filter-pill:hover {
    border-color: #309290;
    color: #309290;
    background: rgba(48, 146, 144, 0.08);
}

.filter-pill.active {
    background: #309290;
    border-color: #309290;
    color: #fff;
    font-weight: 600;
}

.filter-pill.empty-filter {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: #6b7280;
}

.filter-pill.empty-filter:hover {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: #6b7280;
}

.filter-pill .pill-count {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.2rem;
}

.filter-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Products Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
}

/* --- Product Card --- */
.product-card {
    background: #1e2024;
    border-radius: 1.1rem;
    border: 1.5px solid #2a2d32;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(.4, 2, .6, 1), box-shadow 0.25s, border-color 0.25s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 40px rgba(48, 146, 144, 0.12), 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: #309290;
}

.product-card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #16181a;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.product-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #3a3d42;
    font-size: 3rem;
}

.product-card-body {
    padding: 1.2rem 1.3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.product-badge-category {
    background: rgba(48, 146, 144, 0.15);
    color: #309290;
    border: 1px solid rgba(48, 146, 144, 0.25);
}

.product-badge-manufacturer {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.product-badge-stock {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.product-badge-out-of-stock {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.product-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8f9fa;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.product-card-desc {
    color: #9ca3af;
    font-size: 0.88rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Out of Stock Overlay --- */
.product-card.out-of-stock .product-card-image {
    position: relative;
}

.product-card.out-of-stock .product-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.out-of-stock-ribbon {
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 2.5rem;
    transform: rotate(45deg);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* --- No Results --- */
.products-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #6b7280;
}

.products-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    display: block;
}

.products-empty h3 {
    color: #9ca3af;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.products-empty p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* --- Active Filters Bar --- */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: rgba(48, 146, 144, 0.12);
    border: 1px solid rgba(48, 146, 144, 0.25);
    border-radius: 2rem;
    color: #309290;
    font-size: 0.82rem;
    font-weight: 500;
}

.active-filter-tag .remove-filter {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
    text-decoration: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
}

.active-filter-tag .remove-filter:hover {
    opacity: 1;
}

.clear-all-filters {
    color: #6b7280;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s;
    background: none;
    border: none;
    font-family: 'Poppins', sans-serif;
}

.clear-all-filters:hover {
    color: #ef4444;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .products-search {
        max-width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.2rem;
    }

    .product-card-image {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .filter-pills {
        gap: 0.35rem;
    }

    .filter-pill {
        font-size: 0.78rem;
        padding: 0.3rem 0.8rem;
    }
}

/* --- Footer Stacking & Spacing Fix --- */
/* Ensure footer sits above the particles background and doesn't overlap products */
.footer {
    position: relative;
    z-index: 2;
}

/* Ensure product grid has breathing room before the footer */
.products-grid {
    padding-bottom: 2rem;
}

/* Responsive footer improvements */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .footer {
        padding: 2rem 0 1rem 0;
    }

    .footer-section h3 {
        font-size: 1rem;
    }
}

/* --- Public Product Details Modal --- */
.pm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pm-modal {
    background: #1e2024;
    border: 1px solid #2a2d32;
    border-radius: 1.25rem;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.98);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.pm-overlay.active .pm-modal {
    transform: translateY(0) scale(1);
}

.pm-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #9ca3af;
    font-size: 1.8rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.pm-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

.pm-content {
    display: flex;
    flex-wrap: wrap;
}

.pm-image-col {
    flex: 0 0 40%;
    background: #16181a;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #2a2d32;
}

.pm-image-col img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    margin-bottom: 2rem;
}

.pm-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pm-badge {
    background: rgba(48, 146, 144, 0.15);
    color: #309290;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pm-badge.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #bfc3c6;
}

.pm-details-col {
    flex: 1;
    min-width: 300px;
    padding: 2.5rem;
}

.pm-details-col h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.pm-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #22c55e;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
}

.pm-lead {
    font-size: 1.05rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.pm-divider {
    height: 1px;
    background: #2a2d32;
    margin: 2rem 0;
}

.pm-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 600;
}

.pm-long-desc {
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.7;
}

.pm-long-desc p {
    margin-bottom: 1rem;
}

.pm-long-desc ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.pm-long-desc li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .pm-image-col {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid #2a2d32;
        padding: 2rem;
    }

    .pm-details-col {
        padding: 2rem;
    }
}