/* =============================================
   THRIFT ZONE DEALS PAGE - SPECIAL STYLING
   White & Blue Theme for Maximum Engagement
   Two-Column Mobile Layout
   ============================================= */

/* Root Variables for Consistent White & Blue Theme */
:root {
    --primary-blue: #1e40af;
    --light-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --electric-blue: #2563eb;
    --sky-blue: #0ea5e9;
    --pure-white: #ffffff;
    --light-gray: #f8fafc;
    --border-gray: #e2e8f0;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --deal-red: #ef4444;
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-light: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Page Background */
body {
    background: var(--gradient-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Enhanced Header for Deals Page */
.header {
    background: var(--pure-white);
    box-shadow: var(--shadow-medium);
    border-bottom: 3px solid var(--primary-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .logo h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.8rem;
}

/* Deals Page Hero Section */
.deals-page-hero {
    background: var(--gradient-primary);
    color: var(--pure-white);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.deals-page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.deals-hero-content {
    position: relative;
    z-index: 2;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: var(--pure-white);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.deals-page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: slideInUp 0.8s ease-out;
}

.deals-live-badge {
    background: var(--success-green);
    color: var(--pure-white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 1rem;
    animation: pulse 2s infinite;
}

.deals-page-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.deals-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.deals-stat:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.deals-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--pure-white);
}

.deals-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Enhanced Filter Section */
.deals-page-filters {
    background: var(--pure-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    margin: -2rem 1rem 2rem 1rem;
    position: relative;
    z-index: 10;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--light-gray);
    color: var(--text-dark);
    border: 2px solid transparent;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: var(--accent-blue);
    color: var(--pure-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.filter-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: var(--pure-white);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-medium);
}

/* Results Info Section */
.deals-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    background: var(--pure-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.last-updated {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Enhanced Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

/* Product Card Design */
.product-card {
    background: var(--pure-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border-gray);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-blue);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--light-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--deal-red);
    color: var(--pure-white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 2;
}

.limited-time-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning-orange);
    color: var(--pure-white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

.wishlist-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.wishlist-btn:hover {
    background: var(--pure-white);
    color: var(--deal-red);
    transform: scale(1.1);
}

.wishlist-btn:focus {
    outline: 2px solid var(--deal-red);
    outline-offset: 2px;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary-blue);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.savings {
    color: var(--success-green);
    font-weight: 600;
    font-size: 0.9rem;
}

.product-actions {
    display: flex;
    gap: 0.8rem;
}

.claim-btn,
.buy-btn,
.view-deal-btn {
    flex: 1;
    background: var(--gradient-primary);
    color: var(--pure-white);
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.claim-btn:hover,
.buy-btn:hover,
.view-deal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--electric-blue);
}

.claim-btn:active,
.buy-btn:active,
.view-deal-btn:active {
    transform: translateY(0);
}

.claim-btn:focus,
.buy-btn:focus,
.view-deal-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.loading-spinner {
    margin-bottom: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-gray);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Load More Button */
.load-more-section {
    text-align: center;
    padding: 3rem 0;
}

.load-more-btn {
    background: var(--pure-white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.load-more-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-primary);
    color: var(--pure-white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.back-to-top:focus {
    outline: 2px solid var(--pure-white);
    outline-offset: 2px;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Special Effects for Engagement */
.deal-countdown {
    background: linear-gradient(45deg, var(--deal-red), var(--warning-orange));
    color: var(--pure-white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1rem;
    animation: pulse 2s infinite;
}

.trending-badge {
    position: absolute;
    top: 50px;
    left: 10px;
    background: var(--success-green);
    color: var(--pure-white);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

/* Product Rating Styles */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.product-rating i {
    color: #fbbf24;
    font-size: 0.75rem;
}

.rating-count {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .deals-page-title {
        font-size: 2rem;
    }
    
    .deals-page-stats {
        gap: 1.5rem;
    }
    
    .deals-stat {
        padding: 1rem;
    }
    
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        white-space: nowrap;
        min-width: max-content;
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* TWO PRODUCTS PER ROW ON MOBILE */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .deals-results-info {
        flex-direction: column;
        text-align: center;
        margin: 0 0.5rem 1rem 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .results-count {
        font-size: 1rem;
    }
    
    .last-updated {
        font-size: 0.8rem;
    }
    
    /* Compact Product Card for Mobile */
    .product-card {
        margin: 0;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 0.75rem;
    }
    
    .product-title {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 2;
        min-height: 2.4rem;
    }
    
    .product-category {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }
    
    .discount-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .limited-time-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }
    
    .trending-badge {
        top: 45px;
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .wishlist-btn {
        width: 32px;
        height: 32px;
        bottom: 8px;
        right: 8px;
    }
    
    .product-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
    
    .original-price {
        font-size: 0.875rem;
    }
    
    .savings {
        font-size: 0.8rem;
    }
    
    .product-rating {
        margin-bottom: 0.5rem;
    }
    
    .product-rating i {
        font-size: 0.7rem;
    }
    
    .rating-count {
        font-size: 0.7rem;
    }
    
    .claim-btn,
    .buy-btn,
    .view-deal-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .product-actions {
        gap: 0.5rem;
    }
    
    .deal-countdown {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 480px) {
    .deals-page-hero {
        padding: 2rem 0;
    }
    
    .deals-page-title {
        font-size: 1.5rem;
    }
    
    .deals-live-badge {
        display: block;
        margin: 0.5rem auto 0 auto;
        width: fit-content;
    }
    
    .deals-page-stats {
        gap: 1rem;
    }
    
    .deals-stat {
        padding: 0.75rem 1rem;
    }
    
    .deals-stat-number {
        font-size: 1.5rem;
    }
    
    .deals-stat-label {
        font-size: 0.8rem;
    }
    
    .deals-page-filters {
        margin: -1rem 0.5rem 1rem 0.5rem;
        padding: 1rem;
    }
    
    .filter-tabs {
        gap: 0.375rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    /* MAINTAIN TWO PRODUCTS PER ROW */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .product-card {
        margin: 0;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 0.625rem;
    }
    
    .product-title {
        font-size: 0.75rem;
        min-height: 2.2rem;
        margin-bottom: 0.4rem;
    }
    
    .product-category {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .original-price {
        font-size: 0.8rem;
    }
    
    .savings {
        font-size: 0.75rem;
    }
    
    .product-rating {
        margin-bottom: 0.4rem;
    }
    
    .product-rating i {
        font-size: 0.65rem;
    }
    
    .rating-count {
        font-size: 0.65rem;
    }
    
    .claim-btn,
    .buy-btn,
    .view-deal-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .product-actions {
        gap: 0.4rem;
    }
    
    .discount-badge {
        top: 6px;
        left: 6px;
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .limited-time-badge {
        top: 6px;
        right: 6px;
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
    
    .trending-badge {
        top: 40px;
        left: 6px;
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
    
    .wishlist-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .deal-countdown {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        margin-top: 0.625rem;
    }
    
    .load-more-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* Micro-interactions */
.product-card:active {
    transform: translateY(-5px) scale(0.98);
}

.filter-btn:active {
    transform: translateY(0) scale(0.95);
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.no-products i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.no-products h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.no-products p {
    font-size: 1rem;
    color: var(--text-light);
}

/* Filter Overlay for Mobile */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.filter-overlay.active {
    display: block;
}
