/* ===== PRODUCTS PAGES ===== */

/* ===== PRODUCTS INDEX ===== */
.products-hero-section {
    background: linear-gradient(135deg, #050508 0%, #0e0e16 50%, #050508 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    padding: 140px 0 60px;
    position: relative;
}

.products-hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 60%,
        rgba(65, 105, 225, 0.12) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.products-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.products-hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
}

/* Products Section */
.products-section {
    background: var(--white);
    padding: 60px 0 100px;
    position: relative;
}

.products-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* ===== SIDEBAR (Desktop) ===== */
.products-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.clear-filters {
    font-size: 13px;
    color: #5b7fff;
    text-decoration: none;
}

.clear-filters:hover {
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-toggle:hover {
    color: #5b7fff;
}

.filter-toggle.active i {
    transform: rotate(180deg);
}

.filter-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-content.active {
    max-height: 500px;
    padding-top: 10px;
}

.filter-item {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.filter-item:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.filter-item.active {
    background: #5b7fff;
    color: white;
}

.filter-group form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    color: black;
    padding: 12px 60px 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
}

.search-box input:focus {
    border-color: #5b7fff;
}

.search-box button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 36px;
    background: #5b7fff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: #4169e1;
}

.search-box button i {
    font-size: 14px;
}

/* ===== MOBILE FILTER BUTTON ===== */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 990;
    padding: 12px 24px;
    background: #1f2937;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    gap: 8px;
    align-items: center;
    transition: all 0.3s ease;
}
.mobile-filter-btn:hover {
    background: #111827;
}
.filter-count {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #5b7fff;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== MOBILE FILTER OVERLAY & DRAWER ===== */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-filter-overlay.open {
    opacity: 1;
}

.mobile-filter-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}
.mobile-filter-drawer.open {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.drawer-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}
.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.2s ease;
}
.drawer-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.drawer-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.drawer-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.drawer-clear-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}
.drawer-clear-btn:hover {
    border-color: #d1d5db;
    color: #1f2937;
}
.drawer-done-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #5b7fff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.drawer-done-btn:hover {
    background: #4169e1;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #5b7fff;
    color: white;
    font-size: 13px;
    border-radius: 50px;
}

.filter-badge a {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    line-height: 1;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: #5b7fff;
    box-shadow: 0 10px 30px rgba(91, 127, 255, 0.15);
    transform: translateY(-4px);
}

.product-image {
    position: relative;
    width: 100%;
    height: 240px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
}

.product-placeholder i {
    font-size: 48px;
}

.product-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: #5b7fff;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.product-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.vendor-badge,
.application-badge {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}

.vendor-badge strong,
.application-badge strong {
    color: #1f2937;
}

.product-codes {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #6b7280;
    margin-top: auto;
}

.product-codes strong {
    color: #1f2937;
}

/* Empty State */
.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.products-empty i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
    display: block;
}

.products-empty p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #6b7280;
}

/* Pagination */
.products-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.products-pagination nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.products-pagination .pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.products-pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
    background: white;
}

.products-pagination .page-item .page-link:hover {
    background: #5b7fff;
    color: white;
    border-color: #5b7fff;
}

.products-pagination .page-item.active .page-link {
    background: #5b7fff;
    color: white;
    border-color: #5b7fff;
}

.products-pagination .page-item.disabled .page-link {
    color: #d1d5db;
    cursor: not-allowed;
}

/* =============================================================================
   PRODUCT DETAIL PAGE
   ============================================================================= */
.product-detail-section {
    background: var(--white);
    padding: 120px 0 100px;
}

.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    font-size: 14px;
    flex-wrap: wrap;
}

.product-breadcrumb a {
    color: #5b7fff;
    text-decoration: none;
}

.product-breadcrumb a:hover {
    text-decoration: underline;
}

.product-breadcrumb i {
    font-size: 10px;
    color: #9ca3af;
}

.product-breadcrumb span {
    color: #6b7280;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

/* ── Image area ── */
.product-images {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.image-layout-with-thumbs {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.thumb-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80px;
    flex-shrink: 0;
}

.thumb-strip .thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumb-strip .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-strip .thumb:hover {
    border-color: #5b7fff;
}

.thumb-strip .thumb.active {
    border-color: #5b7fff;
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.2);
}

.main-image {
    flex: 1;
    aspect-ratio: 1;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-images > .main-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
}

.image-placeholder i {
    font-size: 80px;
}

/* ── Product Info Panel ── */
.detail-category {
    display: inline-block;
    padding: 6px 14px;
    background: #5b7fff;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.product-detail-info h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.2;
}

.detail-short-desc {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 20px;
}

.detail-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-description p {
    margin-bottom: 10px;
}

.detail-description p:last-child {
    margin-bottom: 0;
}

.detail-description ul,
.detail-description ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.meta-label {
    color: #6b7280;
    min-width: 100px;
}

.meta-value {
    color: #1f2937;
    font-weight: 600;
}

.detail-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ── Tabs ── */
.product-tabs {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.tab-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-content {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.8;
}

.specifications-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 16px 20px;
    background: white;
}

.spec-label {
    font-size: 14px;
    color: #6b7280;
}

.spec-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #4b5563;
}

.features-list i {
    color: #5b7fff;
    font-size: 12px;
}

/* ── Related Products ── */
.related-products {
    margin-top: 80px;
}

.related-products h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 30px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.related-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-card:hover {
    border-color: #5b7fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(91, 127, 255, 0.12);
}

.related-image {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.related-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    padding: 15px;
    margin: 0;
    line-height: 1.4;
}

.related-vendor {
    display: block;
    font-size: 12px;
    color: #6b7280;
    padding: 0 15px 15px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-sidebar {
        display: none;
    }

    .mobile-filter-btn {
        display: inline-flex;
    }

    .mobile-filter-drawer {
        display: flex;
    }

    .products-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-images {
        position: static;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail-info h1 {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .products-hero-section {
        padding: 120px 0 50px;
    }

    .products-hero-content h1 {
        font-size: 32px;
    }

    .products-section {
        padding: 30px 0 80px;
    }

    .products-section .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-image {
        height: 160px;
    }

    .product-info {
        padding: 14px;
    }

    .product-info h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .product-description {
        font-size: 11px;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-meta {
        gap: 4px;
        margin-bottom: 8px;
    }

    .vendor-badge,
    .application-badge {
        font-size: 11px;
    }

    .product-codes {
        gap: 8px;
        padding-top: 8px;
        font-size: 10px;
    }

    .product-category {
        font-size: 9px;
        padding: 3px 7px;
        top: 8px;
        left: 8px;
    }

    .product-detail-section {
        padding: 100px 0 80px;
    }

    .product-detail-info h1 {
        font-size: 24px;
    }

    .detail-short-desc {
        font-size: 14px;
    }

    .image-layout-with-thumbs {
        flex-direction: column-reverse;
    }

    .thumb-strip {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .thumb-strip .thumb {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
    }

    .image-layout-with-thumbs .main-image {
        width: 100%;
    }

    .detail-cta {
        flex-direction: column;
    }

    .detail-cta .theme-btn {
        width: 100%;
        justify-content: center;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .related-image {
        height: 140px;
    }

    .related-card h3 {
        font-size: 13px;
        padding: 12px;
    }

    .related-vendor {
        font-size: 11px;
        padding: 0 12px 12px;
    }

    .spec-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 12px 16px;
    }

    .active-filters {
        gap: 8px;
        margin-bottom: 16px;
    }

    .filter-badge {
        font-size: 12px;
        padding: 5px 10px;
    }

    .products-pagination .page-item .page-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .products-hero-content h1 {
        font-size: 26px;
    }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-image {
        height: 130px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 12px;
    }

    .product-description,
    .product-meta,
    .product-codes {
        display: none;
    }
}
