/* ============================================
   PRODUCTS.CSS — Categories, Product List, Detail
   ============================================ */

/* === PRODUCT CATEGORIES (Home Page) === */
.product-categories {
    background: var(--secondary);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.category-card {
    text-decoration: none;
    color: var(--secondary);
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.category-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.category-card:hover img {
    transform: scale(1.08);
}

.category-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.75) 0%, rgba(10, 10, 10, 0.1) 60%);
    z-index: 2;
    transition: all var(--transition-base);
}

.category-card:hover .category-card-overlay {
    background: linear-gradient(to top, rgba(10, 10, 10, 0.85) 0%, rgba(255, 102, 0, 0.15) 100%);
}

.category-card h3 {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
    font-size: 1.3rem;
    color: var(--secondary);
    font-family: var(--font-primary);
    font-weight: 600;
    margin: 0;
    transition: all var(--transition-base);
}

.category-card:hover h3 {
    color: var(--accent-light);
    transform: translateY(-4px);
}

/* === PRODUCT LIST PAGE === */
.product-listing-hero {
    padding-top: 100px;
    padding-bottom: 30px;
    background: var(--gray-50);
}

.product-listing-hero h1 {
    margin-bottom: 8px;
}

.product-list-page {
    padding-top: 20px;
    padding-bottom: 60px;
    background: var(--gray-50);
}

.product-list-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Filter Section */
.filter-section {
    width: 100%;
    margin-bottom: 20px;
}

.filter-toggle-btn {
    display: none;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 12px 18px;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background var(--transition-fast);
}

.filter-toggle-btn i {
    margin-right: 10px;
}

.filter-content-wrapper {
    display: block;
    margin-top: 10px;
    background: var(--secondary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}

.filter-list a {
    display: inline-block;
    padding: 10px 18px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.filter-list a:hover,
.filter-list li.active a {
    background: var(--accent);
    color: var(--primary);
    font-weight: 600;
}

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

.product-card {
    position: relative;
    background: var(--secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.product-card .product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.product-card img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease-out);
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 16px 20px 20px;
    text-align: center;
}

.product-card .product-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.product-card a {
    color: inherit;
    text-decoration: none;
}

.product-card a:hover .product-title {
    color: var(--accent);
}

.product-card .product-description {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* === PRODUCT DETAIL PAGE === */
.product-detail-page {
    padding-top: 100px;
    padding-bottom: 60px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 15px;
}

.product-gallery {
    position: relative;
}

.main-image {
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    height: 320px;
}

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

.thumbnail-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail-images img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.thumbnail-images img.active,
.thumbnail-images img:hover {
    border-color: var(--accent);
}

/* Product Info */
.product-info-detail h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.product-detail-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 15px;
}

.product-meta ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    margin-bottom: 25px;
}

.product-meta li {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--gray-600);
}

/* Sales Contact */
.sales-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
    border-top: 1px solid var(--gray-200);
    padding-top: 15px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-50);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
}

.contact-card img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.contact-card .name {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}

.contact-card .online {
    color: #25d366;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 5px;
}

.btn-chat {
    background: #25d366;
    color: var(--secondary);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: inline-block;
    margin-top: 4px;
}

.btn-chat:hover {
    background: #1aa04e;
    color: var(--secondary);
}

.product-category-link {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.product-category-link a {
    color: var(--primary);
    font-weight: 500;
}

.product-category-link a:hover {
    color: var(--accent);
}

/* Related Products */
.related-products-section {
    padding: 60px 0 80px;
    background: var(--gray-50);
}

.related-products-section .section-title {
    text-align: center;
    margin-bottom: 30px;
}

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

.related-products-grid .product-card {
    background: var(--secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-align: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.related-products-grid .product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.related-products-grid .product-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-products-grid .product-info {
    padding: 12px 15px 16px;
}

.related-products-grid .product-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.related-products-grid .product-description {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* Nav Arrow (Product Detail) */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    z-index: 5;
    transition: background var(--transition-fast);
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.left-arrow { left: 10px; }
.right-arrow { right: 10px; }

/* Add to cart button */
.add-to-cart-btn {
    position: absolute;
    right: 15px;
    width: 35px;
    height: 35px;
    background: var(--accent);
    color: var(--primary);
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.add-to-cart-btn:hover {
    opacity: 1;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card img {
        height: 180px;
    }

    .category-card h3 {
        font-size: 1.1rem;
        bottom: 14px;
        left: 14px;
    }

    .filter-toggle-btn {
        display: flex;
    }

    .filter-content-wrapper {
        display: none;
        margin-top: 10px;
        padding: 10px;
    }

    .filter-content-wrapper.active {
        display: block;
    }

    .filter-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .filter-list a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 42px;
        font-size: 0.9rem;
    }

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

    .product-card img {
        height: 150px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .product-card h3 {
        font-size: 0.95rem;
    }

    .related-products-grid {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .related-products-grid::-webkit-scrollbar {
        display: none;
    }

    .related-products-grid .product-card {
        min-width: 75%;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .related-products-grid .product-image img {
        height: 160px;
    }

    .related-products-section {
        padding: 40px 0;
    }
}

@media (max-width: 576px) {
    .category-card h3 {
        font-size: 1rem;
        bottom: 12px;
        left: 10px;
    }
}
