/* ========== COMPACT PRODUCT CARDS - OPTIMIZED FOR MOBILE ========== */

/* Desktop Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
}

/* Base Product Card */
.product-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 420px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: #2874F0;
}

/* ========== IMAGE SECTION ========== */
.product-image-container {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: #f8fafc;
    position: relative;
    flex-shrink: 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1px;
    background: #ffffff;
}

.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 2.5rem;
    color: #d1d5db;
}

/* ========== BADGES & WISHLIST ========== */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.badge {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.badge-discount { background: linear-gradient(135deg, #ff6b35, #ff4757); }
.badge-limited { background: #8b5cf6; }
.badge-stock-low { background: #ef4444; }

.product-top-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.wishlist-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6b7280;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wishlist-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.wishlist-btn.active {
    background: #ef4444;
    color: white;
}

/* ========== PRODUCT INFO SECTION ========== */
.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-category {
    background: #2874F0;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1f2937;
    margin: 4px 0;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== PRICING SECTION ========== */
.product-pricing {
    margin-bottom: 6px;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 800;
    color: #2874F0;
    line-height: 1;
}

.price-original {
    font-size: 0.85rem;
    color: #9ca3af;
    text-decoration: line-through;
    line-height: 1;
}

.price-discount-badge {
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.savings-amount {
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

/* ========== URGENCY & COUNTDOWN ========== */
.product-urgency {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    min-height: 14px;
    line-height: 1.2;
}

.stock-indicator {
    color: #ef4444;
    font-weight: 600;
}

.limited-time-indicator {
    color: #8b5cf6;
    font-weight: 600;
}

.deal-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: #ea580c;
    min-height: 14px;
    line-height: 1.2;
}

.countdown-label {
    font-weight: 500;
}

.countdown-timer {
    display: flex;
    gap: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    line-height: 1;
}

.countdown-unit {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.countdown-number {
    font-size: 0.75rem;
}

.countdown-text {
    font-size: 0.6rem;
}

/* ========== ENHANCED FEATURES ========== */
.product-enhanced-features {
    margin: 6px 0;
}

.features-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.feature-compact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    min-height: 26px;
    flex: 1;
}

.feature-compact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.like-compact-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.like-compact-btn.active {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.share-compact-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.comment-compact-btn:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}

.comment-compact-btn.has-comments {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}

.timer-compact-btn {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.timer-compact-btn:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #d97706;
}

.timer-compact-btn.urgent {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.feature-compact-count {
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
}

.feature-compact-icon {
    font-size: 0.75rem;
}

/* ========== SOCIAL ACTIONS ========== */
.product-social {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 0;
    border-top: 1px solid #f3f4f6;
}

.social-actions {
    display: flex;
    gap: 14px;
}

.social-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #6b7280;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.social-action:hover { 
    color: #2874F0; 
}

.likes-action.active { 
    color: #ef4444; 
}

/* ========== ACTION BUTTONS ========== */
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.deal-btn {
    flex: 1;
    background: #2874F0;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.2s ease;
}

.deal-btn:hover {
    background: #1e5bb8;
    color: white;
    text-decoration: none;
}

.deal-btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.deal-btn-subtext {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
}

.quick-action-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    border-color: #2874F0;
    color: #2874F0;
    background: #eff6ff;
}

/* ========== COMMENT MODAL ========== */
.comment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.comment-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
}

.comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.comment-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.comment-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.comment-modal-close:hover {
    background: #f3f4f6;
}

.comments-list {
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.comment-item {
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #2874F0;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2874F0;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.4;
}

.comment-date {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
}

.comment-input-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.comment-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 10px;
    font-family: inherit;
}

.comment-input:focus {
    outline: none;
    border-color: #2874F0;
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.1);
}

.comment-submit-btn {
    background: #2874F0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.comment-submit-btn:hover {
    background: #1e5bb8;
}

/* ========================================
   MOBILE OPTIMIZATIONS - COMPACT DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Grid Layout */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 8px;
    }
    
    /* ULTRA COMPACT CARD - Target 260-280px height */
    .product-card {
        min-height: 260px;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    
    /* LARGER IMAGE - Main Focus */
    .product-image-container {
        height: 140px;
    }
    
    .product-image {
        padding: 8px;
    }
    
    /* COMPACT INFO SECTION */
    .product-info {
        padding: 8px 10px;
        gap: 3px;
    }
    
    /* Smaller Category Badge */
    .product-category {
        font-size: 0.6rem;
        padding: 2px 6px;
        margin-bottom: 2px;
    }
    
    /* Compact Title */
    .product-title {
        font-size: 0.8rem;
        line-height: 1.25;
        height: auto;
        max-height: 2em;
        margin: 2px 0;
        -webkit-line-clamp: 2;
    }
    
    /* Compact Pricing */
    .product-pricing {
        margin-bottom: 3px;
    }
    
    .price-section {
        gap: 5px;
        margin-bottom: 2px;
    }
    
    .price-current {
        font-size: 0.95rem;
    }
    
    .price-original {
        font-size: 0.7rem;
    }
    
    .price-discount-badge {
        padding: 1px 4px;
        font-size: 0.6rem;
    }
    
    .savings-amount {
        font-size: 0.65rem;
        margin: 0;
    }
    
    /* Minimal Urgency Section */
    .product-urgency {
        gap: 6px;
        margin-bottom: 3px;
        font-size: 0.65rem;
        min-height: 12px;
    }
    
    .deal-countdown {
        gap: 3px;
        margin-bottom: 3px;
        font-size: 0.6rem;
        min-height: 12px;
    }
    
    .countdown-number {
        font-size: 0.65rem;
    }
    
    .countdown-text {
        font-size: 0.55rem;
    }
    
    /* Compact Features Row */
    .product-enhanced-features {
        margin: 3px 0;
    }
    
    .features-compact-row {
        gap: 4px;
    }
    
    .feature-compact-btn {
        padding: 3px 5px;
        font-size: 0.62rem;
        gap: 2px;
        min-height: 22px;
        border-radius: 4px;
    }
    
    .feature-compact-icon {
        font-size: 0.68rem;
    }
    
    .feature-compact-count {
        font-size: 0.58rem;
        min-width: 12px;
    }
    
    /* Compact Social Section */
    .product-social {
        margin-bottom: 5px;
        padding: 4px 0;
    }
    
    .social-actions {
        gap: 10px;
    }
    
    .social-action {
        font-size: 0.7rem;
        gap: 3px;
    }
    
    /* Action Buttons - Keep Clickable */
    .product-actions {
        margin-top: auto;
        padding-top: 6px;
        gap: 6px;
    }
    
    .deal-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        border-radius: 6px;
        min-height: 40px;
    }
    
    .deal-btn-text {
        gap: 1px;
    }
    
    .deal-btn-subtext {
        font-size: 0.65rem;
    }
    
    .quick-action-btn {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    /* Compact Badges */
    .product-badges {
        top: 6px;
        left: 6px;
        gap: 3px;
    }
    
    .badge {
        padding: 2px 5px;
        font-size: 0.6rem;
        border-radius: 3px;
    }
    
    /* Compact Wishlist */
    .wishlist-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .product-top-actions {
        top: 6px;
        right: 6px;
    }
    
    /* Modal Adjustments */
    .comment-modal {
        padding: 16px;
    }
    
    .comment-modal-content {
        padding: 16px;
        max-height: 75vh;
    }
    
    .comment-modal-title {
        font-size: 1rem;
    }
    
    .comments-list {
        max-height: 180px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .product-card {
        min-height: 255px;
    }
    
    .product-image-container {
        height: 100px;
    }
    
    .product-info {
        padding: 7px 9px;
        gap: 2px;
    }
    
    .product-title {
        font-size: 0.78rem;
        max-height: 1.95em;
    }
    
    .price-current {
        font-size: 0.9rem;
    }
    
    .deal-btn {
        padding: 9px 10px;
        font-size: 0.78rem;
        min-height: 38px;
    }
    
    .quick-action-btn {
        width: 38px;
        height: 38px;
    }
    
    .feature-compact-btn {
        padding: 2px 4px;
        font-size: 0.6rem;
        min-height: 20px;
    }
}

/* Horizontal Scroll for Special Sections */
.horizontal-products-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 12px 0;
    scroll-snap-type: x mandatory;
}

.horizontal-products-scroll .product-card {
    flex: 0 0 320px;
    max-width: 320px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .horizontal-products-scroll {
        gap: 12px;
        padding: 8px 0;
    }
    
    .horizontal-products-scroll .product-card {
        flex: 0 0 280px;
        max-width: 280px;
        min-height: 260px;
    }
}

@media (max-width: 480px) {
    .horizontal-products-scroll .product-card {
        flex: 0 0 260px;
        max-width: 260px;
        min-height: 255px;
    }
}

/* Section Spacing */
.deals {
    padding: 40px 0;
}

.about {
    padding: 40px 0;
    background: #f8fafc;
    clear: both;
}

/* Prevent Horizontal Overflow */
body {
    overflow-x: hidden;
}

.deals-container,
.products-container {
    overflow: visible;
}

* {
    box-sizing: border-box;
}
