﻿/* ============================================
   PRODUCT SECTION - THEME-AWARE STYLES
   Compatible with Light/Dark Theme System
   ============================================ */

/* ============================================
   PRODUCTS SECTION
   ============================================ */
.products-section {
    background: var(--bg-secondary);
    overflow: hidden;
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.text-gradient {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   FILTER TABS
   ============================================ */
.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-gold);
    background: var(--bg-card);
    color: var(--primary-gold);
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
}

    .filter-btn:hover {
        background: var(--gradient-gold);
        color: var(--bg-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-gold);
    }

    .filter-btn.active {
        background: var(--gradient-gold);
        color: var(--bg-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-gold);
    }

/* ============================================
   PRODUCTS CAROUSEL
   ============================================ */
.products-carousel-container {
    position: relative;
    margin: 0 auto;
    max-width: 1200px;
}

.products-carousel-wrapper {
    overflow: hidden;
    border-radius: 20px;
    position: relative;
}

.products-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 20px;
    padding: 10px;
}

.product-carousel-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: calc(33.333% - 14px);
    transition: all 0.3s ease;
}

/* ============================================
   CAROUSEL NAVIGATION
   ============================================ */
.carousel-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.carousel-btn {
    background: var(--bg-card);
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: var(--shadow-md);
}

    .carousel-btn:hover {
        background: var(--gradient-gold);
        color: var(--bg-dark);
        transform: scale(1.1);
    }

    .carousel-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }

        .carousel-btn:disabled:hover {
            background: var(--bg-card);
            color: var(--primary-gold);
        }

/* ============================================
   CAROUSEL INDICATORS
   ============================================ */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .carousel-indicator.active {
        background: var(--gradient-gold);
        transform: scale(1.2);
    }

    .carousel-indicator:hover {
        background: var(--secondary-gold);
        transform: scale(1.1);
    }

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-color);
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-gold);
    }

/* ============================================
   PRODUCT IMAGE
   ============================================ */
.product-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit:cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 2.5rem;
}

/* ============================================
   PRODUCT OVERLAY
   ============================================ */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

.quick-view-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--primary-gold);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

    .quick-view-btn:hover {
        background: var(--gradient-gold);
        color: var(--bg-dark);
        transform: scale(1.05);
    }

/* ============================================
   PRODUCT BADGE
   ============================================ */
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gradient-gold);
    color: var(--bg-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

[dir="rtl"] .product-badge {
    right: auto;
    left: 15px;
}

/* ============================================
   PRODUCT CONTENT
   ============================================ */
.product-content {
    padding: 1.25rem;
}

.product-category {
    color: var(--primary-gold);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
    height: 2.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   PRODUCT META
   ============================================ */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-stock {
    font-size: 0.8rem;
    font-weight: 500;
}

    .product-stock.in-stock {
        color: var(--success-color);
    }

    .product-stock.out-of-stock {
        color: var(--danger-color);
    }

.product-sku {
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

    .product-sku small {
        color: var(--text-muted);
    }

/* ============================================
   PRODUCT ACTIONS
   ============================================ */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.learn-more-btn,
.contact-btn {
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.learn-more-btn {
    background: var(--gradient-gold);
    border: none;
    color: var(--bg-dark);
}

    .learn-more-btn:hover {
        background: var(--secondary-gold);
        color: var(--bg-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-gold);
    }

.contact-btn {
    background: transparent;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
}

    .contact-btn:hover {
        background: var(--gradient-gold);
        color: var(--bg-dark);
        transform: translateY(-2px);
    }

/* ============================================
   NO PRODUCTS MESSAGE
   ============================================ */
.no-products {
    padding: 3rem 1rem;
    text-align: center;
}

    .no-products i {
        color: var(--text-muted);
        margin-bottom: 1rem;
    }

    .no-products h4,
    .no-products p {
        color: var(--text-muted);
    }

/* ============================================
   PRODUCT MODAL
   ============================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-title {
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-primary);
}

.btn-close {
    filter: var(--bs-btn-close-white-filter, none);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   VIEW ALL BUTTON
   ============================================ */
.btn-outline-primary.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .product-carousel-item {
        flex: 0 0 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    /* Filter Tabs */
    .filter-tabs {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 200px;
        margin-bottom: 0.5rem;
    }

    /* Section Title */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Carousel Items */
    .product-carousel-item {
        flex: 0 0 100%;
        min-width: 100%;
    }

    /* Carousel Navigation */
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Product Meta */
    .product-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    /* Product Content */
    .product-content {
        padding: 1rem;
    }

    .product-title {
        font-size: 1rem;
        height: auto;
        -webkit-line-clamp: 3;
    }

    .product-description {
        height: auto;
        -webkit-line-clamp: 3;
    }

    /* Product Actions */
    .product-actions {
        gap: 0.75rem;
    }

    .learn-more-btn,
    .contact-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .products-section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .carousel-navigation {
        padding: 0 10px;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
    }

    .product-image-container {
        height: 180px;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.product-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

    .product-card.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        border: 3px solid var(--border-color);
        border-top-color: var(--primary-gold);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.product-card:focus-within {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

.carousel-btn:focus,
.filter-btn:focus,
.carousel-indicator:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .carousel-navigation,
    .filter-tabs,
    .carousel-indicators,
    .product-overlay {
        display: none !important;
    }

    .product-carousel-item {
        flex: 0 0 33.333%;
        page-break-inside: avoid;
    }

    .product-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
.page-header-products {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    padding-top: 100px !important;
    padding-bottom: 100px !important;
}

/* Gradient Overlay */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 193, 7, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Oil Drops Animation */
.oil-drops-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.oil-drop {
    position: absolute;
    top: -50px;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 50%, #ff8c00 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    opacity: 0;
    animation: dropFall 5s ease-in infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3), inset 0 -5px 10px rgba(255, 140, 0, 0.3);
}

    /* Create ripple effect when drop lands */
    .oil-drop::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        width: 8px;
        height: 8px;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
        border-radius: 50%;
    }

    .oil-drop::after {
        content: '';
        position: absolute;
        bottom: -50px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: radial-gradient(ellipse, rgba(255, 193, 7, 0.4) 0%, transparent 70%);
        border-radius: 50%;
        opacity: 0;
        animation: ripple 0.6s ease-out;
        animation-delay: inherit;
    }

@keyframes dropFall {
    0% {
        top: -50px;
        opacity: 0;
        transform: rotate(45deg) scale(0.8);
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }

    100% {
        top: calc(100% + 50px);
        opacity: 0;
        transform: rotate(45deg) scale(0.8);
    }
}

@keyframes ripple {
    0% {
        width: 10px;
        height: 2px;
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        width: 50px;
        height: 5px;
        opacity: 0;
    }
}

/* Header Icon */
.header-icon {
    font-size: 4rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Text Styles */
.page-header-products h1 {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.text-gradient {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 50%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}

.page-header-products .lead {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* Fade In Animations */
.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

.fade-in-down {
    animation: fadeInDown 1s ease-out forwards;
    opacity: 0;
}

.animation-delay-1 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Decorative Shapes */
.decorative-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    border-radius: 50%;
    animation: shapeFloat 15s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 15%;
    left: 15%;
    animation-delay: 10s;
}

@keyframes shapeFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(20px, -20px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Bottom Wave */
.bottom-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

    .bottom-wave svg {
        position: relative;
        display: block;
        width: calc(100% + 1.3px);
        height: 60px;
    }

/* Responsive */
@media (max-width: 768px) {
    .page-header-products {
        min-height: 350px;
        padding-top: 80px !important;
        padding-bottom: 80px !important;
    }

        .page-header-products h1 {
            font-size: 2rem;
        }

    .header-icon {
        font-size: 3rem;
    }

    .oil-drop {
        width: 12px;
        height: 12px;
    }

    .bottom-wave svg {
        height: 40px;
    }

    .shape-1 {
        width: 60px;
        height: 60px;
    }

    .shape-2 {
        width: 80px;
        height: 80px;
    }

    .shape-3 {
        width: 50px;
        height: 50px;
    }
}

/* Performance Optimization */
.oil-drop,
.shape,
.header-icon {
    will-change: transform, opacity;
}