/* صفحة المنتجات - تصميم عصري فاخر */

:root {
    --prod-primary: #ed8936;
    --prod-accent: #ed8936;
    --prod-accent-light: #f6ad55;
    --prod-bg: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #0b0f19 100%);
    --prod-card-bg: linear-gradient(145deg, rgba(22, 28, 41, 0.95) 0%, rgba(32, 40, 57, 0.9) 100%);
    --prod-text: #ffffff;
    --prod-text-muted: rgba(255, 255, 255, 0.72);
    --prod-border: rgba(255, 255, 255, 0.08);
    --prod-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    --prod-shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 25px rgba(237, 137, 54, 0.15);
}

/* Page layout: sidebar + main */
.products-page-wrap {
    padding: 2.5rem 0 4rem;
    background:
        linear-gradient(180deg, rgba(12, 18, 28, 0.96) 0%, rgba(9, 13, 21, 1) 42%, rgba(13, 16, 24, 1) 100%),
        var(--prod-bg);
    min-height: calc(100vh - 80px);
    color: var(--prod-text);
}

.products-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.products-hero-copy {
    min-width: 0;
    padding: 1.6rem 0;
}

.products-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.products-breadcrumb a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 0.2s;
}

.products-breadcrumb a:hover {
    color: #fff;
}

.products-breadcrumb i {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.75rem;
}

.products-breadcrumb span {
    color: #fff;
    font-weight: 700;
}

.products-eyebrow,
.products-result-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: #ffd6b3;
    background: rgba(237, 137, 54, 0.13);
    border: 1px solid rgba(237, 137, 54, 0.24);
    font-size: 0.78rem;
    font-weight: 800;
}

.products-hero h1 {
    margin: 0.8rem 0 0.85rem;
    max-width: 760px;
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: 0;
}

.products-hero-lead {
    max-width: 700px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.02rem;
    line-height: 1.85;
}

.products-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.35rem;
}

.products-primary-action,
.products-secondary-action,
.btn-catalog-help,
.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.products-primary-action,
.btn-catalog-help {
    background: linear-gradient(135deg, #ed8936, #f6ad55);
    color: #111827;
    border: 1px solid rgba(246, 173, 85, 0.45);
    box-shadow: 0 12px 28px rgba(237, 137, 54, 0.24);
}

.products-secondary-action,
.btn-clear-filters {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.products-primary-action:hover,
.products-secondary-action:hover,
.btn-catalog-help:hover,
.btn-clear-filters:hover {
    transform: translateY(-2px);
}

.products-primary-action:hover,
.btn-catalog-help:hover {
    color: #111827;
}

.products-secondary-action:hover,
.btn-clear-filters:hover {
    color: var(--prod-accent-light);
    border-color: rgba(237, 137, 54, 0.45);
}

.products-hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    align-content: center;
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
    box-shadow: var(--prod-shadow);
}

.hero-metric {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(5, 9, 16, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-metric span {
    min-width: 74px;
    color: #ff9f43;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.hero-metric small {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

/* P1 catalog controls: the compact toolbar is mobile-only. */
.mobile-catalog-controls,
.mobile-filters-close,
.mobile-filters-backdrop {
    display: none;
}

.active-filter-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin: -0.65rem 0 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.active-filter-chips[hidden],
.mobile-filters-backdrop[hidden] {
    display: none !important;
}

.active-filter-chip,
.filter-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 36px;
    max-width: min(82vw, 280px);
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(237, 137, 54, 0.35);
    border-radius: 999px;
    color: #ffe2c6;
    background: rgba(237, 137, 54, 0.12);
    font: 700 0.78rem 'Cairo', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-layout {
    display: grid;
    grid-template-columns: 305px minmax(0, 1fr);
    gap: 1.8rem;
    align-items: start;
    min-width: 0;
}

/* Sidebar Glassmorphism */
.products-sidebar {
    position: sticky;
    top: 6rem;
    min-width: 0;
    max-width: 100%;
    background: var(--prod-card-bg);
    border-radius: 18px;
    padding: 1.8rem;
    box-shadow: var(--prod-shadow);
    border: 1px solid var(--prod-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.sidebar-desc {
    font-size: 0.85rem;
    color: var(--prod-text-muted);
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.8rem;
    transition: all 0.3s ease;
}

.sidebar-search:focus-within {
    border-color: var(--prod-accent);
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.15);
}

.sidebar-search i {
    color: var(--prod-accent);
}

.sidebar-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.95rem;
    color: #fff;
    font-family: 'Cairo', sans-serif;
}

.sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-search input:focus {
    outline: none;
}

.sidebar-block {
    margin-bottom: 1.8rem;
}

.sidebar-block-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.85rem;
    border-right: 3px solid var(--prod-accent);
    padding-right: 0.5rem;
}

.sidebar-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.sidebar-categories .pill {
    justify-content: flex-start;
    width: 100%;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    text-align: right;
}

.sidebar-categories .pill span:first-of-type {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    margin-inline-start: auto;
    min-width: 1.8rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    text-align: center;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 800;
}

.sidebar-select {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    outline: none;
    transition: border 0.3s;
}

.sidebar-select:focus {
    border-color: var(--prod-accent);
}

.sidebar-stats {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    color: var(--prod-text-muted);
    font-weight: 600;
}

/* Main */
.products-main {
    min-width: 0;
}

.products-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
}

.products-toolbar h2 {
    margin: 0.55rem 0 0.25rem;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1.25;
    font-weight: 900;
}

.products-toolbar p {
    margin: 0;
    color: var(--prod-text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.products-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.btn-clear-filters {
    cursor: pointer;
}

.btn-clear-filters[hidden] {
    display: none;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.pill:hover,
.pill.active {
    border-color: var(--prod-accent);
    background: rgba(237, 137, 54, 0.15);
    color: #fff;
}

.products-masonry {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 1200px) {
    .products-masonry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* Catalog mode: loading state (AJAX) */
.products-catalog-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 1rem;
    color: var(--prod-text-muted);
    font-size: 1.05rem;
}
.products-catalog-loading i {
    font-size: 1.5rem;
    color: var(--prod-accent);
}

/* Card-shaped loading placeholders keep the catalog from jumping while data loads. */
.product-card-skeleton,
.products-masonry .skeleton-product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--prod-border);
    border-radius: 18px;
    background: var(--prod-card-bg);
    box-shadow: var(--prod-shadow);
}

.product-card-skeleton .skeleton-image {
    aspect-ratio: 16 / 10;
    width: 100%;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.product-card-skeleton .skeleton-body {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
}

.product-card-skeleton .skeleton-image,
.product-card-skeleton .skeleton-line,
.products-masonry .skeleton-product-card .skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.045) 20%, rgba(255, 255, 255, 0.13) 42%, rgba(255, 255, 255, 0.045) 64%);
    background-size: 220% 100%;
    animation: products-skeleton-shimmer 1.35s ease-in-out infinite;
}

.product-card-skeleton .skeleton-line {
    width: 100%;
    height: 0.8rem;
    border-radius: 999px;
}

.product-card-skeleton .skeleton-line--title {
    width: 76%;
    height: 1.3rem;
}

.product-card-skeleton .skeleton-line--short {
    width: 54%;
}

.product-card-skeleton .skeleton-line--actions {
    height: 44px;
    margin-top: 0.35rem;
    border-radius: 10px;
}

@keyframes products-skeleton-shimmer {
    from { background-position: 120% 0; }
    to { background-position: -120% 0; }
}

.product-card-modern {
    min-width: 0;
    max-width: 100%;
    height: 100%;
    background: var(--prod-card-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--prod-shadow);
    border: 1px solid var(--prod-border);
    transition: all 0.45s cubic-bezier(0.25, 1, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--prod-shadow-lg);
    border-color: rgba(237, 137, 54, 0.35);
}

.product-card-image {
    aspect-ratio: 16/10;
    background: #0b0f19;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.2, 1);
}

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

.product-card-badge {
    position: absolute;
    top: auto;
    bottom: 0.75rem;
    right: 0.8rem;
    padding: 0.3rem 0.75rem;
    background: #f6ad55;
    color: #111827;
    border: 1px solid rgba(255, 231, 204, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.product-card-featured {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.28rem 0.65rem;
    background: rgba(17, 24, 39, 0.86);
    color: #ffe5c4;
    border: 1px solid rgba(255, 229, 196, 0.28);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.product-card-actions-bar {
    display: none;
}

.product-card-modern:hover .product-card-actions-bar {
    opacity: 1;
    transform: translateY(0);
}

.product-card-actions-bar button {
    flex: 1;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-card-actions-bar button:hover {
    background: var(--prod-accent);
    border-color: var(--prod-accent);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.product-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.product-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em; /* Fallback for 2 lines: 1.4 * 2 = 2.8em */
    min-height: 2.8em;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.product-card-desc {
    font-size: 0.88rem;
    color: var(--prod-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.2em; /* Fallback for 2 lines: 1.6 * 2 = 3.2em */
    min-height: 3.2em;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.product-card-footer {
    margin-top: auto; /* Push footer to bottom */
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
}

.product-card-date {
    display: none;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
}

.product-card-specs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
    width: 100%;
}

.product-card-specs span {
    min-width: 0;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-bottom-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.1rem;
    min-width: 0;
}

.product-card-quote,
.product-card-details {
    min-height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-card-quote {
    flex: 1;
    min-width: 0;
    color: #111827;
    background: linear-gradient(135deg, #ed8936, #f6ad55);
    border: 1px solid rgba(246, 173, 85, 0.45);
}

.product-card-details {
    flex: 0 0 auto;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-card-quote:hover {
    color: #111827;
    transform: translateY(-1px);
}

.product-card-details:hover {
    color: var(--prod-accent-light);
    border-color: rgba(237, 137, 54, 0.45);
}

/* Load more */
.load-more-wrap {
    text-align: center;
    margin-top: 3rem;
}

.btn-load-more {
    min-height: 44px;
    padding: 0.8rem 2.2rem;
    border: 2px solid var(--prod-accent);
    background: transparent;
    color: var(--prod-accent);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.btn-load-more:hover {
    background: var(--prod-accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.35);
}

.products-empty,
.products-error {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.75rem;
    min-height: 310px;
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--prod-text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
}

.products-empty > i,
.products-error > i {
    font-size: 3.2rem;
    margin-bottom: 0.25rem;
    opacity: 0.6;
    color: var(--prod-accent);
}

.products-empty h3,
.products-error h3 {
    margin: 0.2rem 0 0.45rem;
    color: #fff;
    font-size: 1.35rem;
}

.products-empty p,
.products-error p {
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.75;
}

.products-empty .btn-clear-filters,
.btn-retry-products {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    margin-top: 0.85rem;
    padding: 0.7rem 1.15rem;
    border-radius: 12px;
    font: 800 0.9rem 'Cairo', sans-serif;
    cursor: pointer;
}

.products-error {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.025));
}

.products-error > i {
    color: #f6ad55;
}

.btn-retry-products {
    color: #111827;
    border: 1px solid rgba(246, 173, 85, 0.45);
    background: linear-gradient(135deg, var(--prod-accent), var(--prod-accent-light));
    box-shadow: 0 8px 22px rgba(237, 137, 54, 0.2);
}

.btn-retry-products:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(237, 137, 54, 0.32);
}

/* Premium Modal Sheet Redesign */
.product-modal-modern {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.2, 1);
}

.product-modal-modern.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

.modal-box {
    position: relative;
    background: linear-gradient(145deg, #111827 0%, #1f2937 100%);
    border-radius: 28px;
    max-width: 900px;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.2, 1);
    color: #fff;
}

.product-modal-modern.active .modal-box {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--prod-accent);
    border-color: rgba(237, 137, 54, 0.4);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    padding-block: 2rem;
    padding-inline: 2.5rem;
}

.modal-gallery {
    position: sticky;
    top: 0;
}

.modal-gallery img {
    width: 100%;
    border-radius: 16px;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-thumbs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.modal-thumbs[hidden] {
    display: none;
}

.modal-thumb-button,
.modal-thumbs button {
    appearance: none;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    padding: 2px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.modal-thumbs > img {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    margin: 0;
    aspect-ratio: 1;
}

.modal-thumb-button img,
.modal-thumbs button img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 8px;
    aspect-ratio: 1;
    object-fit: cover;
}

.modal-thumbs > img:hover,
.modal-thumbs > img.active,
.modal-thumb-button:hover,
.modal-thumb-button.active,
.modal-thumb-button[aria-current="true"],
.modal-thumbs button:hover,
.modal-thumbs button.active,
.modal-thumbs button[aria-current="true"] {
    border-color: var(--prod-accent);
}

.modal-thumb-button:hover,
.modal-thumbs button:hover,
.modal-thumbs > img:hover {
    transform: translateY(-2px);
}

.modal-thumbs:has(> img:only-child),
.modal-thumbs:has(> button:only-child) {
    display: none;
}

.modal-info {
    padding-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.modal-cat {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    background: rgba(237, 137, 54, 0.15);
    color: var(--prod-accent);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 10px;
    width: fit-content;
}

.modal-info h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 0;
    font-weight: 800;
    line-height: 1.35;
}

.modal-desc {
    color: var(--prod-text-muted);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
}

.modal-specs {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
}

.modal-specs .spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
}

.modal-specs .spec-row .spec-label {
    color: var(--prod-text-muted);
}

.modal-specs .spec-row .spec-value {
    font-weight: 600;
    color: #fff;
}

/* Compact recommendations inside the product detail sheet. */
.modal-related-products {
    min-width: 0;
    margin-top: 0.4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-related-products[hidden] {
    display: none;
}

.modal-related-title {
    margin: 0 0 0.75rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.modal-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    min-width: 0;
}

.modal-related-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    min-height: 82px;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(5, 9, 16, 0.42);
    color: #fff;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.modal-related-card:hover {
    transform: translateY(-2px);
    border-color: rgba(246, 173, 85, 0.48);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.modal-related-card-image {
    display: block;
    width: 68px;
    height: 68px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
    background: #0b0f19;
}

.modal-related-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: inherit;
    aspect-ratio: 1;
    object-fit: cover;
}

.modal-related-card-body,
.modal-related-card-content {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.modal-related-card-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modal-related-card-category,
.modal-related-card-meta {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-related-card-action {
    color: #ffc98f;
    font-size: 0.72rem;
    font-weight: 800;
}

.modal-actions {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.modal-primary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0.65rem;
    min-width: 0;
}

.modal-primary-actions .btn-modal {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
}

.modal-more-actions {
    position: relative;
    min-width: 0;
}

.modal-more-actions > summary {
    width: fit-content;
    list-style: none;
    user-select: none;
}

.modal-more-actions > summary::-webkit-details-marker {
    display: none;
}

.modal-more-actions > summary::after {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    margin-inline-start: 0.2rem;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.modal-more-actions[open] > summary::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.modal-more-actions-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: 0;
    margin-top: 0.55rem;
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: rgba(5, 9, 16, 0.32);
}

.modal-more-actions:not([open]) > .modal-more-actions-panel {
    display: none;
}

.modal-more-actions-panel .btn-modal {
    min-width: 0;
    justify-content: flex-start;
    padding: 0.65rem 0.75rem;
    text-align: start;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.btn-modal.btn-primary {
    background: linear-gradient(135deg, var(--prod-accent), var(--prod-accent-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

.btn-modal.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.45);
}

.btn-modal.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.btn-modal.btn-outline:hover {
    border-color: var(--prod-accent);
    color: var(--prod-accent);
    background: rgba(255, 255, 255, 0.08);
}

/* Keep the page-level contact shortcut out of the active product dialog. */
.product-modal-modern.active ~ .whatsapp-widget {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* A visible keyboard focus treatment shared by catalog controls. */
.sidebar-search input:focus-visible,
.mobile-catalog-search input:focus-visible,
.mobile-filter-toggle:focus-visible,
.mobile-filters-close:focus-visible,
.active-filter-chip:focus-visible,
.sidebar-select:focus-visible,
.pill:focus-visible,
.product-card-actions-bar button:focus-visible,
.product-card-quote:focus-visible,
.product-card-details:focus-visible,
.btn-load-more:focus-visible,
.btn-retry-products:focus-visible,
.modal-close-btn:focus-visible,
.modal-thumb-button:focus-visible,
.modal-thumbs button:focus-visible,
.modal-related-card:focus-visible,
.btn-modal:focus-visible,
.products-pagination a:focus-visible,
.btn-compare-go:focus-visible,
.compare-bar-clear:focus-visible,
.compare-differences-toggle:focus-visible,
.compare-section-close:focus-visible,
.compare-section-cta:focus-visible,
.compare-product-remove:focus-visible {
    outline: 3px solid var(--prod-accent-light);
    outline-offset: 3px;
}

/* Share toast */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.8rem 1.6rem;
    background: #38a169;
    color: #fff;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(56, 161, 105, 0.45);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.2, 1);
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (min-width: 769px) {
    /* Reserve a narrow logical-side rail for the fixed WhatsApp shortcut. */
    .products-main {
        padding-inline-end: 3.75rem;
    }
}

@media (max-width: 992px) {
    .products-hero {
        grid-template-columns: 1fr;
    }

    .products-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .products-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }
    
    .products-sidebar {
        position: static;
        padding: 1.5rem;
    }
    
    .sidebar-categories {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .sidebar-categories .pill {
        width: auto;
    }

    .products-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .products-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .products-page-wrap {
        padding-top: 1.1rem;
        overflow: clip;
    }

    .products-hero {
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .products-hero-copy {
        padding: 0.8rem 0;
    }

    .products-hero h1 {
        font-size: 1.95rem;
    }

    .products-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.6rem;
    }

    .hero-metric {
        grid-template-columns: minmax(0, 1fr);
        align-content: center;
        justify-items: center;
        gap: 0.35rem;
        min-width: 0;
        min-height: 82px;
        padding: 0.65rem 0.35rem;
        text-align: center;
    }

    .hero-metric span {
        min-width: 0;
        font-size: 1.55rem;
    }

    .hero-metric small {
        min-width: 0;
        font-size: 0.67rem;
        line-height: 1.35;
    }

    .mobile-catalog-controls {
        position: sticky;
        top: 9rem;
        z-index: 900;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.55rem;
        min-width: 0;
        margin: 0 0 0.85rem;
        padding: 0.55rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        background: rgba(15, 22, 34, 0.94);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .mobile-catalog-search {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
        min-height: 46px;
        padding: 0 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 12px;
        color: var(--prod-accent);
        background: rgba(0, 0, 0, 0.2);
    }

    .mobile-catalog-search:focus-within {
        border-color: rgba(237, 137, 54, 0.72);
        box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.14);
    }

    .mobile-catalog-search input {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0;
        border: 0;
        outline: 0;
        color: #fff;
        background: transparent;
        font: 600 0.88rem 'Cairo', sans-serif;
    }

    .mobile-catalog-search input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        min-width: 92px;
        min-height: 46px;
        padding: 0.55rem 0.75rem;
        border: 1px solid rgba(246, 173, 85, 0.44);
        border-radius: 12px;
        color: #111827;
        background: linear-gradient(135deg, var(--prod-accent), var(--prod-accent-light));
        box-shadow: 0 8px 18px rgba(237, 137, 54, 0.2);
        font: 800 0.82rem 'Cairo', sans-serif;
        cursor: pointer;
    }

    .mobile-filter-count,
    .mobile-catalog-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.35rem;
        height: 1.35rem;
        padding: 0 0.3rem;
        border-radius: 999px;
        color: #fff;
        background: rgba(17, 24, 39, 0.72);
        font-size: 0.68rem;
        line-height: 1;
    }

    .active-filter-chips {
        margin: -0.25rem 0 0.85rem;
        padding-bottom: 0.35rem;
    }

    .products-masonry {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .products-sidebar {
        position: fixed;
        z-index: 2000;
        inset: auto 0 0;
        width: 100%;
        max-width: 100%;
        max-height: min(82dvh, 720px);
        padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 24px 24px 0 0;
        background: linear-gradient(155deg, #171e2d 0%, #101621 100%);
        transform: translateY(calc(100% + 1.5rem));
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.2, 1), visibility 0s linear 0.3s;
        will-change: transform;
    }

    body.products-filters-open {
        overflow: hidden;
    }

    body.products-filters-open .products-sidebar {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    body.products-filters-open .whatsapp-widget {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mobile-filters-backdrop:not([hidden]) {
        position: fixed;
        z-index: 1990;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(3, 7, 18, 0.76);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        cursor: pointer;
    }

    .products-sidebar .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 2;
        align-items: center;
        margin: 0 -1rem 1rem;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(23, 30, 45, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .mobile-filters-close {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 50%;
        color: #fff;
        background: rgba(255, 255, 255, 0.06);
        cursor: pointer;
    }

    .products-sidebar .sidebar-search {
        display: none;
    }

    .products-sidebar .sidebar-block {
        margin-bottom: 1rem;
    }

    .sidebar-categories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        width: 100%;
        overflow: visible;
        padding: 0;
    }

    .sidebar-categories .pill {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0.65rem 0.75rem;
        text-align: start;
    }

    .product-card-actions-bar {
        display: none;
    }

    .product-card-image,
    .product-card-skeleton .skeleton-image {
        aspect-ratio: 16 / 9;
    }

    .product-card-body {
        padding: 1.1rem;
    }

    .product-card-title {
        font-size: 1.15rem;
    }

    .product-card-specs span {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .products-primary-action,
    .products-secondary-action,
    .btn-catalog-help,
    .btn-clear-filters {
        width: 100%;
    }

    .products-toolbar {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .products-toolbar h2 {
        font-size: 1.35rem;
    }

    .products-toolbar .btn-catalog-help {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.055);
        box-shadow: none;
    }

    .products-empty,
    .products-error {
        min-height: 260px;
        padding: 2.25rem 1rem;
    }

    .product-modal-modern {
        align-items: flex-end;
        padding: 0.5rem;
    }

    .modal-box {
        max-height: calc(100dvh - 1rem);
        border-radius: 22px;
    }

    .modal-close-btn {
        top: 0.75rem;
        left: 0.75rem;
        background: rgba(11, 15, 25, 0.82);
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-gallery {
        position: static;
    }

    .modal-gallery > img {
        max-height: 220px;
        aspect-ratio: 16 / 9;
        margin-bottom: 0.5rem;
    }

    .modal-thumbs img {
        width: 52px;
        height: 52px;
    }

    .modal-info {
        gap: 0.7rem;
    }

    .modal-info h2 {
        font-size: 1.55rem;
    }

    .modal-primary-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .modal-primary-actions .btn-modal {
        min-height: 48px;
    }

    .modal-more-actions > summary {
        width: 100%;
        justify-content: center;
    }

    .modal-more-actions-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .modal-specs .spec-row {
        gap: 1rem;
    }

    .modal-specs .spec-label,
    .modal-specs .spec-value {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .modal-specs .spec-value {
        text-align: end;
    }

    /* Product pages already expose inline WhatsApp/RFQ actions on small screens. */
    body .whatsapp-widget {
        display: none;
    }
}

/* Modal: ratings & comments */
.modal-subtitle {
    font-size: 1.05rem;
    color: #fff;
    margin: 1.25rem 0 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}
.modal-ratings,
.modal-comments {
    margin-top: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-ratings-summary {
    font-size: 0.92rem;
    color: var(--prod-text-muted);
    margin-bottom: 0.8rem;
}
.modal-ratings-form,
.modal-comments-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.stars-input {
    display: inline-flex;
    gap: 4px;
}
.stars-input button {
    background: none;
    border: none;
    min-width: 44px;
    min-height: 44px;
    padding: 0.2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.3rem;
}
.stars-input button:hover,
.stars-input[data-rating] button[data-r]:not([data-r="0"]) { color: var(--prod-accent); }
.stars-input button i.fas { color: var(--prod-accent); }

.modal-rating-author,
.modal-comment-author {
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    max-width: 150px;
    outline: none;
}
.modal-rating-author:focus,
.modal-comment-author:focus {
    border-color: var(--prod-accent);
}

.modal-comments-form textarea {
    width: 100%;
    min-width: 200px;
    padding: 0.6rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    font-family: 'Cairo', sans-serif;
}
.modal-comments-form textarea:focus {
    border-color: var(--prod-accent);
}

.modal-comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.8rem;
}
.modal-comment-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
}
.modal-comment-item .comment-author { font-weight: 600; color: #fff; }
.modal-comment-item .comment-date { font-size: 0.78rem; color: var(--prod-text-muted); }
.modal-comment-item p { margin: 0.3rem 0 0; color: var(--prod-text-muted); }

.btn-modal.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; border-radius: 8px; }

/* Compare bar */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #111827, #0b0f19);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.9rem 1.25rem;
    z-index: 9999;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.compare-bar .container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.compare-bar-label { font-weight: 700; color: var(--prod-accent); }
.compare-bar-items { flex: 1; min-width: 0; font-size: 0.9rem; color: rgba(255, 255, 255, 0.9); }
.btn-compare-go {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--prod-accent);
    color: #fff;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-compare-go:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(237, 137, 54, 0.45); }
.btn-compare-go:disabled,
.btn-compare-go:disabled:hover {
    opacity: 0.45;
    filter: saturate(0.25);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.product-modal-modern.active ~ .compare-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(110%);
}
.compare-bar-clear {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.compare-bar-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e53e3e;
}

/* Pagination */
.products-pagination-wrap {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}
.products-pagination {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.products-pagination a,
.products-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}
.products-pagination a:hover {
    border-color: var(--prod-accent);
    color: var(--prod-accent);
    background: rgba(255, 255, 255, 0.1);
}
.products-pagination .page-current {
    background: var(--prod-accent);
    color: #fff;
    border-color: var(--prod-accent);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.35);
}
.products-pagination .page-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Product card: wishlist & compare icons */
.product-card-wishlist,
.product-card-compare {
    position: absolute;
    top: 0.6rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(11, 15, 25, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    z-index: 11;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.product-card-wishlist { right: 0.6rem; }
.product-card-compare { right: 3.35rem; }
.product-card-wishlist:hover,
.product-card-compare:hover {
    color: var(--prod-accent);
    border-color: rgba(237, 137, 54, 0.4);
    background: rgba(11, 15, 25, 0.95);
    transform: scale(1.05);
}
.product-card-wishlist.in-wishlist { color: #e53e3e; }
.product-card-wishlist.in-wishlist i.fas { color: #e53e3e; }
.product-card-compare.in-compare { color: var(--prod-accent-light); }

/* Compare section */
.compare-section {
    margin-bottom: 2rem;
    padding: 1.8rem;
    background: var(--prod-card-bg);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--prod-shadow);
}
.compare-section-title {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.compare-col h4 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--prod-accent); font-weight: 700; }
.compare-col p { font-size: 0.88rem; color: var(--prod-text-muted); margin-bottom: 1rem; line-height: 1.6; }
.compare-specs .spec-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.compare-specs .spec-label { color: var(--prod-text-muted); }
.compare-specs .spec-value { font-weight: 600; color: #fff; }
@media (max-width: 768px) {
    .compare-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

    .compare-bar {
        padding: 0.7rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
    }

    .compare-bar .container {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 44px;
        gap: 0.5rem;
        width: 100%;
        padding: 0;
    }

    .compare-bar-label {
        font-size: 0.78rem;
    }

    .compare-bar-items {
        overflow: hidden;
        font-size: 0.76rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .compare-bar-clear {
        grid-column: 3;
        grid-row: 1;
    }

    .btn-compare-go {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }
}

/* P2 comparison workspace: a single scannable matrix with contained horizontal scroll. */
.compare-section {
    min-width: 0;
    max-width: 100%;
    scroll-margin-top: 6.25rem;
    overflow: hidden;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 100% 0, rgba(237, 137, 54, 0.12), transparent 34%),
        var(--prod-card-bg);
    border-color: rgba(246, 173, 85, 0.18);
}

.compare-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    margin-bottom: 1rem;
}

.compare-section-heading {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.compare-section-eyebrow {
    color: #ffc98f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.compare-section .compare-section-title {
    min-width: 0;
    margin: 0;
    color: #fff;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 800;
}

.compare-section-title i {
    color: var(--prod-accent-light);
}

.compare-section-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.compare-differences-toggle,
.compare-section-close,
.compare-section-cta,
.compare-product-remove {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.13);
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
}

.compare-differences-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.8rem;
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.compare-differences-toggle:hover {
    border-color: rgba(246, 173, 85, 0.45);
    color: #fff;
}

.compare-differences-toggle[aria-pressed="true"] {
    border-color: #f6ad55;
    background: #f6ad55;
    color: #111827;
}

.compare-section-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.82);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.compare-section-close:hover {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

#compareSectionContent {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    overscroll-behavior-inline: contain;
    scrollbar-color: rgba(246, 173, 85, 0.6) rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
}

#compareSectionContent::-webkit-scrollbar {
    height: 8px;
}

#compareSectionContent::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

#compareSectionContent::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(246, 173, 85, 0.6);
}

.compare-matrix {
    --compare-products: 2;
    min-width: 650px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(5, 9, 16, 0.42);
}

.compare-matrix-row,
.compare-matrix-header {
    display: grid;
    grid-template-columns: minmax(9.5rem, 0.72fr) repeat(var(--compare-products), minmax(13rem, 1fr));
    min-width: 0;
}

.compare-matrix-row + .compare-matrix-row {
    border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.compare-matrix-cell,
.compare-matrix-label,
.compare-matrix-value {
    min-width: 0;
    padding: 0.75rem 0.85rem;
    overflow-wrap: anywhere;
}

.compare-matrix-cell + .compare-matrix-cell,
.compare-matrix-label + .compare-matrix-value,
.compare-matrix-value + .compare-matrix-value {
    border-inline-start: 1px solid rgba(255, 255, 255, 0.075);
}

.compare-matrix-header,
.compare-matrix-row:first-child {
    background: rgba(255, 255, 255, 0.035);
}

.compare-matrix-label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
    font-weight: 700;
}

.compare-matrix-value {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.6;
}

.compare-matrix-row.is-different,
.compare-matrix-row[data-different="true"] {
    background: rgba(237, 137, 54, 0.07);
}

.compare-matrix-row.is-different .compare-matrix-value,
.compare-matrix-row[data-different="true"] .compare-matrix-value,
.compare-matrix-cell.is-different,
.compare-matrix-value.is-different {
    box-shadow: inset 3px 0 0 rgba(246, 173, 85, 0.78);
}

[dir="rtl"] .compare-matrix-row.is-different .compare-matrix-value,
[dir="rtl"] .compare-matrix-row[data-different="true"] .compare-matrix-value,
[dir="rtl"] .compare-matrix-cell.is-different,
[dir="rtl"] .compare-matrix-value.is-different {
    box-shadow: inset -3px 0 0 rgba(246, 173, 85, 0.78);
}

.compare-section.is-differences-only .compare-matrix-row:not(.is-different):not([data-different="true"]):not(.compare-matrix-header),
.compare-section[data-differences-only="true"] .compare-matrix-row:not(.is-different):not([data-different="true"]):not(.compare-matrix-header) {
    display: none;
}

.compare-product-header {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    min-height: 82px;
    padding-inline-end: 2.2rem;
}

.compare-product-image {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    aspect-ratio: 1;
    object-fit: cover;
    background: #0b0f19;
}

.compare-product-header h4,
.compare-product-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.compare-product-category {
    display: block;
    margin-top: 0.2rem;
    color: #ffc98f;
    font-size: 0.7rem;
    font-weight: 700;
}

.compare-product-copy {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.compare-product-quote {
    width: fit-content;
    margin-top: 0.2rem;
    color: #ffd2a3;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.compare-product-quote:hover {
    color: #fff;
}

.compare-product-remove {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.76);
}

.compare-product-remove:hover {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

.compare-section .compare-grid {
    grid-template-columns: repeat(2, minmax(13rem, 1fr));
    min-width: 550px;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(5, 9, 16, 0.42);
}

.compare-col {
    min-width: 0;
    padding: 1rem;
}

.compare-col + .compare-col {
    border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
}

.compare-section .compare-col h4 {
    color: #ffc98f;
    font-size: 1.05rem;
    font-weight: 800;
}

.compare-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-section-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.compare-section-cta:hover {
    transform: translateY(-1px);
}

.compare-section-cta-primary {
    border-color: rgba(255, 220, 181, 0.72);
    background: linear-gradient(135deg, #ed8936, #f6ad55);
    color: #111827;
    box-shadow: 0 10px 24px rgba(237, 137, 54, 0.24);
}

.compare-section-cta-primary:hover {
    color: #111827;
}

.compare-section-cta-secondary {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.compare-section-cta-secondary:hover {
    border-color: rgba(246, 173, 85, 0.45);
    color: #ffc98f;
}

@media (max-width: 768px) {
    .compare-section {
        padding: 1rem;
        border-radius: 18px;
        scroll-margin-top: 14rem;
    }

    .compare-section-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .compare-section-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        width: 100%;
    }

    .compare-differences-toggle {
        width: 100%;
    }

    .compare-matrix {
        min-width: 610px;
    }

    .compare-matrix-row,
    .compare-matrix-header {
        grid-template-columns: minmax(8rem, 0.62fr) repeat(var(--compare-products), minmax(12rem, 1fr));
    }

    .compare-section .compare-grid {
        grid-template-columns: repeat(2, minmax(12rem, 1fr));
        min-width: 500px;
    }

    .compare-section-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .compare-section-cta {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-related-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .modal-related-card {
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .modal-related-card-image {
        width: 62px;
        height: 62px;
    }

    .compare-section {
        max-width: 100%;
        padding: 0.85rem;
    }

    .compare-section-title {
        font-size: 1rem;
    }

    .compare-differences-toggle {
        padding-inline: 0.65rem;
        font-size: 0.76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card-skeleton .skeleton-image,
    .product-card-skeleton .skeleton-line,
    .products-masonry .skeleton-product-card .skeleton {
        animation: none;
    }

    .products-sidebar,
    .compare-bar,
    .modal-more-actions > summary::after {
        transition: none;
    }
}
