﻿/* Products Page Styles */
.products-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 130px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-description {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.6;
}

.product-search {
    margin-top: 30px;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 20px 30px;
    font-size: 1.1rem;
    outline: none;
}

.search-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

    .search-btn:hover {
        background: #ff5252;
    }

/* Featured Products */
.featured-products-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 700;
}

    .section-title span {
        color: #667eea;
    }

/* MAIN CHANGE – GRID UPDATED TO 4 CARDS */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cards */
    gap: 25px;
    margin-bottom: 40px;
}

/* Product Card – compact small */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    }

/* Discount badge */
.discount-badge {
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

/* NEW: Average Rating Badge - Right top corner */
.average-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #333;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

    .average-rating-badge .rating-value {
        font-size: 0.9rem;
        font-weight: 800;
    }

    .average-rating-badge .rating-count {
        color: #666;
        font-size: 0.7rem;
        font-weight: 500;
        margin-left: 3px;
    }

/* FIXED – small Featured badge */
.featured-badge {
    background: #ffd700;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto;
    position: absolute;
    top: 10px;
    left: 10px; /* Changed from right to left side */
    z-index: 20;
}

.product-card .product-image {
    height: 200px; /* smaller */
    overflow: hidden;
    position: relative;
}

    .product-card .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s;
    }

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 15px;
    position: relative;
}

.product-category {
    display: block;
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.3;
}

/* NEW: Product Rating Stars - Small and inline with price */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-rating-stars {
    display: flex;
    gap: 2px;
}

    .product-rating-stars i {
        font-size: 0.8rem;
        color: #ffc107;
    }

    .product-rating-stars .empty-star {
        color: #e0e0e0;
    }

.product-rating-value {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.original-price {
    color: #6c757d;
    text-decoration: line-through;
    font-size: 0.85rem;
}

.discounted-price,
.current-price {
    color: #ff6b6b !important;
    font-size: 1rem;
    font-weight: 600;
}

.stock-status {
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.in-stock {
    color: #28a745;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.out-of-stock {
    color: #dc3545;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* NEW: Transparent Add to Cart Button on Hover - Bottom Only */
.product-card-hover-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px; /* Only bottom portion */
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 12px 12px;
    z-index: 10;
    overflow: hidden;
}

.product-card:hover .product-card-hover-actions {
    opacity: 1;
}

.btn-add-to-cart-hover {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    transform: translateY(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.product-card:hover .btn-add-to-cart-hover {
    transform: translateY(0);
}

.btn-add-to-cart-hover:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(0) scale(1.05);
    color: #5a67d8;
}

.btn-add-to-cart-hover i {
    color: #667eea;
    font-size: 0.9rem;
}

/* Remove old action buttons */
.product-actions {
    display: none;
}

.all-products-section {
    background: #f8f9fa;
    padding: 20px 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-link {
    padding: 12px 18px;
    border: none;
    background: #E8E8F5;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .page-link:hover:not(.current) {
        background: #483F76;
        color: white;
    }

    .page-link.current {
        color: white;
    }

.page-dots {
    padding: 10px 5px;
    color: #6c757d;
}

/* ------------------------------ */
/* SHOP BY CATEGORY (UNMODIFIED)  */
/* ------------------------------ */

.categories-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-image {
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

    .category-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s;
    }

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px;
}

    .category-overlay h3 {
        margin: 0 0 5px 0;
        font-size: 1.3rem;
    }

    .category-overlay p {
        margin: 0;
        opacity: 0.9;
        font-size: 0.9rem;
    }

/* ---------------------------- */

/* No Products */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.no-products-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.no-products h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.no-products p {
    color: #6c757d;
    margin-bottom: 25px;
}

.btn-clear-filters {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

    .btn-clear-filters:hover {
        background: #5a67d8;
    }

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 1.2rem;
}

    .loading-spinner i {
        font-size: 2rem;
        margin-bottom: 10px;
        display: block;
    }

/* Floating Cart */
.floating-cart-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
}

.cart-float-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #d81b60;
    color: white;
    border-radius: 50%;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: 0.25s ease;
    position: relative;
}

    .cart-float-link:hover {
        transform: scale(1.08);
    }

.cart-float-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff1744;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Products Info & Filters Styling */
.products-info {
    text-align: center;
    margin-bottom: 15px;
}

#totalProductsInfo {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    background: #eef0ff;
    margin-top: 20px;
    padding: 8px 20px;
    display: inline-block;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Category + Sort Filters */
.products-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

    .products-controls select {
        padding: 10px 15px;
        border-radius: 8px;
        border: 2px solid #dce0f7;
        background: #f7f8ff;
        font-size: 0.95rem;
        font-weight: 600;
        color: #495057;
        cursor: pointer;
        width: 180px;
        transition: all 0.25s ease;
    }

        .products-controls select:hover {
            border-color: #667eea;
            background: #eef0ff;
        }

        .products-controls select:focus {
            outline: none;
            border-color: #5a67d8;
            background: #eef0ff;
            box-shadow: 0 0 0 3px rgba(102,126,234,0.3);
        }

/* Notification */
.notification {
    position: fixed;
    top: 90px !important;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

    .notification.success {
        border-left: 4px solid #28a745;
    }

    .notification.error {
        border-left: 4px solid #dc3545;
    }

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification i {
    font-size: 1.2rem;
}

.notification.success i {
    color: #28a745;
}

.notification.error i {
    color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* NEW: Product card click effect */
.product-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Hero Section Mobile */
    .products-hero {
        padding: 100px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
        padding: 0 15px;
    }

    .hero-description {
        font-size: 1rem;
        padding: 0 20px;
    }

    .search-input-group {
        margin: 0 15px;
        border-radius: 12px;
    }

    .search-input {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .search-btn {
        padding: 0 25px;
        font-size: 1rem;
    }

    /* Section Titles Mobile */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
        padding: 0 15px;
    }

    /* MAIN CHANGE - 1 card per row on mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    /* Product Card Mobile Adjustments */
    .product-card {
        margin-bottom: 5px;
    }

        .product-card .product-image {
            height: 180px;
        }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 1rem;
    }

    /* Badge positions for mobile */
    .featured-badge {
        top: 8px;
        left: 8px;
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .average-rating-badge {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    /* Product Meta (rating + price) mobile */
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
    }

    .product-price {
        justify-content: flex-start;
        width: 100%;
    }

    /* Hover Actions - Make always visible on mobile */
    .product-card-hover-actions {
        opacity: 1;
        height: 50px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
    }

    .btn-add-to-cart-hover {
        transform: translateY(0);
        padding: 8px 16px;
        font-size: 0.8rem;
        background: white;
        border: 2px solid #667eea;
    }

    /* Products Controls Mobile */
    .products-controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        margin: 0 15px 25px 15px;
    }

        .products-controls select {
            width: 100%;
            max-width: 100%;
        }

    /* Pagination Mobile */
    .pagination {
        gap: 5px;
        padding: 0 15px;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 40px;
        justify-content: center;
    }

    /* Categories Grid Mobile */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .category-image {
        height: 160px;
        border-radius: 12px;
    }

    /* Floating Cart Mobile */
    .floating-cart-btn {
        bottom: 15px;
        left: 15px;
    }

    .cart-float-link {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    /* Notification Mobile */
    .notification {
        top: 70px !important;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    /* No Products Mobile */
    .no-products {
        margin: 0 15px;
        padding: 40px 20px;
    }

    .no-products-icon {
        font-size: 3rem;
    }

    /* Products Info Mobile */
    #totalProductsInfo {
        font-size: 1rem;
        padding: 6px 15px;
        margin: 0 15px;
        display: block;
        text-align: center;
    }
}

/* Extra Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .product-card .product-image {
        height: 160px;
    }

    /* Adjust badge sizes for very small screens */
    .featured-badge,
    .average-rating-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .btn-add-to-cart-hover {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Reduce spacing */
    .products-grid {
        gap: 15px;
    }

    .featured-products-section,
    .categories-section {
        padding: 50px 0;
    }
}

/* Mobile Landscape Fixes */
@media (max-width: 768px) and (orientation: landscape) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-card .product-image {
        height: 140px;
    }
}

/* Fix for mobile hover state issues */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
    }

        .product-card:hover .product-image img {
            transform: none;
        }

    .btn-add-to-cart-hover:active {
        background: #667eea;
        color: white;
        transform: scale(0.95);
    }
}

.page-link.current {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 18px !important;
    height: 40px;
    min-width: 43px;
    background: #483F76;
    color: white;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Registered Users Specific Styles */

/* Member Exclusive Banner */
.member-exclusive-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
}

    .member-exclusive-banner i {
        margin-right: 10px;
    }

/* Premium Hero */
.premium-hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Member Price Styling */
.member-price {
    color: #d81b60;
    font-size: 1rem;
    font-weight: bold;
}

.member-price-label {
    font-size: 0.9rem;
    color: #666;
    display: block;
}

.member-savings {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Member Badge */
.member-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 2;
}

    .member-badge i {
        margin-right: 5px;
    }

/* Premium Card */
.premium-card {
    border: 2px solid #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

/* Member Quick Links */
.member-quick-links {
    background: #f8f9fa;
    padding: 20px 0;
    margin-top: 40px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
}

    .quick-link:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .quick-link i {
        font-size: 24px;
        color: #667eea;
        margin-bottom: 10px;
    }

    .quick-link small {
        color: #666;
        font-size: 12px;
    }

/* Premium Product Details */
.premium-product-details .member-price-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 14px;
}

.price-comparison-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.member-price-large {
    font-size: 2.5rem;
    color: #d81b60;
    font-weight: bold;
}

.btn-add-to-cart-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-buy-now-premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
}

.member-benefits {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

    .member-benefits li {
        margin-bottom: 10px;
    }

    .member-benefits i.fa-check-circle {
        color: #28a745;
    }

/* Verified Reviews */
.verified-review {
    border-left: 4px solid #28a745;
}

.verified-badge {
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    margin-left: 10px;
}

.btn-write-review-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
}

.premium-review-modal {
    background: white;
    border-radius: 15px;
    max-width: 500px;
}

.btn-submit-review-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    width: 100%;
    font-size: 1.1rem;
    border-radius: 10px;
}

/* Premium Related Products */
.premium-related {
    position: relative;
    border: 1px solid #667eea;
}

.member-badge-small {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}