/* ===== PRODUCTS PAGE STYLES ===== */

/* Products Hero - Compact & Clean */
.products-hero {
    padding: calc(var(--header-height) + 3rem) 0 3rem;
    background: url('../assets/images/hero/products-background.png') center/cover no-repeat;
    text-align: center;
    position: relative;
    border-bottom: none;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 70px;
}

.products-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    z-index: 1;
}

.products-hero-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.products-hero-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.2;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-arabic);
    color: var(--navy);
}

.products-hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

.products-hero-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-xl) 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    align-items: center;
}

.products-hero-features li {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-arabic);
    padding: 8px 16px;
    background: rgba(17, 76, 154, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 76, 154, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.products-hero-features li:hover {
    background: rgba(17, 76, 154, 0.08);
    border-color: rgba(17, 76, 154, 0.2);
    transform: translateY(-2px);
}

.products-hero-features li i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-arabic);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(17, 76, 154, 0.25);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 76, 154, 0.35);
}

.btn-hero i {
    width: 20px;
    height: 20px;
}

/* Filter Bar - Horizontal Sticky */
.products-filters {
    background: white;
    padding: 0;
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(17, 76, 154, 0.08);
}

.products-filters .container {
    display: block;
    padding-top: 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 16px 0;
    width: 100%;
}

.filter-btn {
    padding: 10px 18px;
    border: 1px solid #dbe2ea;
    background: #f3f6fa;
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-arabic);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    border-color: var(--primary);
    background: rgba(17, 76, 154, 0.05);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(17, 76, 154, 0.25);
}

/* Products Section - Compact Catalog */
.products-section {
    background: transparent;
    padding: 40px 0 var(--spacing-3xl);
    width: 100%;
}

/* Products Grid - 4 Columns Compact */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Product Card - Compact Catalog Style */
.product-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(17, 76, 154, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 360px;
    padding: 16px;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(17, 76, 154, 0.12);
    border-color: var(--primary);
}

.product-image {
    width: 100%;
    height: 140px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 8px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid #f0f0f0;
}

.product-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: var(--font-arabic);
    line-height: 1.4;
    min-height: 2.4em;
}

/* Product Badge - Compact Style */
.product-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(17, 76, 154, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-xs);
    width: fit-content;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Availability Badge - جملة | قطاعي */
.product-availability-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    width: fit-content;
    font-family: var(--font-arabic);
}

.product-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-product-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(17, 76, 154, 0.2);
    font-family: var(--font-arabic);
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-product-details:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(17, 76, 154, 0.3);
}

.btn-product-details i {
    width: 14px;
    height: 14px;
}

/* Products CTA */
.products-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
}

.products-cta-box {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.products-cta-box h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 12px;
    font-family: var(--font-arabic);
    color: white;
    line-height: 1.5;
}

.products-cta-box p {
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    line-height: 1.6;
}

.products-cta .btn-white {
    background: white;
    color: var(--primary);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    padding: 14px 32px;
    font-size: 0.95rem;
}

.products-cta .btn-white:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 968px) {
    .products-hero {
        padding: calc(var(--header-height) + 2rem) 0 2rem;
        height: 350px;
        margin-bottom: 50px;
    }

    .products-hero-features {
        gap: var(--spacing-sm);
    }

    .products-hero-features li {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .products-hero-features li i {
        width: 16px;
        height: 16px;
    }

    .btn-hero {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .products-filters {
        position: relative;
        top: 0;
    }

    .filter-buttons {
        padding: 14px 0;
        gap: 10px;
    }

    .filter-btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

    .products-section {
        padding: 30px 0 var(--spacing-2xl);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .product-card {
        min-height: 340px;
    }

    .product-image {
        height: 135px;
        padding: 8px;
    }

    .product-image img {
        width: 115px;
        height: 115px;
        object-fit: contain;
    }

    .products-cta {
        padding: 50px 0;
    }

    .products-cta-box {
        padding: 30px 20px;
    }
}

@media (max-width: 640px) {
    .products-hero {
        padding: calc(var(--header-height) + 1.5rem) 0 1.5rem;
        height: 320px;
        margin-bottom: 40px;
    }

    .products-hero-title {
        font-size: 1.8rem;
    }

    .products-hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-md);
    }

    .products-hero-features {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .products-hero-features li {
        font-size: 0.82rem;
        padding: 6px 14px;
        width: 100%;
        max-width: 280px;
    }

    .products-hero-features li i {
        width: 15px;
        height: 15px;
    }

    .btn-hero {
        padding: 11px 22px;
        font-size: 0.9rem;
    }

    .products-filters {
        position: relative;
        top: 0;
    }

    .filter-buttons {
        padding: 12px 0;
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    .filter-btn:hover {
        transform: none;
    }

    .products-section {
        padding: 25px 0 var(--spacing-xl);
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-card {
        min-height: 320px;
        padding: 14px;
    }

    .product-image {
        height: 130px;
        padding: 8px;
    }

    .product-image img {
        width: 110px;
        height: 110px;
        object-fit: contain;
    }

    .product-name {
        font-size: 0.95rem;
        min-height: auto;
    }

    .products-cta {
        padding: 40px 0;
    }

    .products-cta-box {
        padding: 25px 15px;
    }
}

/* Smooth transitions for filter changes */
.product-card {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PRODUCT MODAL STYLES ===== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-modal.active {
    display: flex;
}

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.product-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 2;
}

.product-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.product-modal-close i {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.product-modal-body {
    padding: 50px 40px 40px;
}

.product-modal-title {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-family: var(--font-arabic);
    line-height: 1.4;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary);
}

.product-modal-section {
    margin-bottom: 24px;
}

.product-modal-section:last-child {
    margin-bottom: 0;
}

.product-modal-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    font-family: var(--font-arabic);
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-modal-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.product-modal-section p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-line;
}

.product-modal-warning {
    background: rgba(239, 68, 68, 0.05);
    padding: 16px;
    border-radius: 12px;
    border-right: 4px solid #ef4444;
}

.product-modal-warning h3 {
    color: #dc2626;
}

.product-modal-warning h3::before {
    background: #dc2626;
}

.product-modal-warning p {
    color: #991b1b;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .product-modal {
        padding: 10px;
    }

    .product-modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }

    .product-modal-body {
        padding: 45px 24px 24px;
    }

    .product-modal-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .product-modal-section {
        margin-bottom: 20px;
    }

    .product-modal-section h3 {
        font-size: 0.98rem;
    }

    .product-modal-section p {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .product-modal-close {
        top: 12px;
        left: 12px;
        width: 32px;
        height: 32px;
    }

    .product-modal-close i {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .product-modal-body {
        padding: 40px 20px 20px;
    }

    .product-modal-title {
        font-size: 1.2rem;
    }

    .product-modal-section h3 {
        font-size: 0.92rem;
    }

    .product-modal-section p {
        font-size: 0.88rem;
    }
}
