/* static/css/products.css - MOBILE-FIRST Product grid and card styles */

/* ========================================
   BASE STYLES - MOBILE (320px+)
   ======================================== */

/* Products Container */
.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem 1.5rem;
}

/* Product Grid - Mobile: 1 column */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

/* Product Image */
.product-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.image-frame {
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 4px;
    border-radius: 8px;
    margin: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: calc(100% - 12px);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 4px;
    background-color: #f0f0f0;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Product Info */
.product-info {
    padding: 1rem;
}

.product-heading {
    margin: 0 0 0.5rem 0;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.3;
    color: #009D94;
}

.product-secondheading {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.3;
    color: #009D94;
}

.product-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-title a {
    color: #009D94;
    text-decoration: none;
    transition: color 0.5s ease;
}

.product-title a:hover {
    color: #0d3b66;
}

.product-price {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.price-from {
    color: #009D94;
    font-size: 0.9rem;
}

.price-amount {
    font-weight: 700;
    color: #009D94;
    transition: color 0.5s ease, font-weight 0.9s;
}

.price-amount:hover {
    font-weight: 800;
    color: #0d3b66;
}

.price-currency {
    color: #009D94;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.product-description {
    color: #009D94;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    transition: color 0.5s ease;
}

.product-description:hover {
    color: #0d3b66;
}

/* Product Actions */
.product-actions {
    padding: 0 1rem 1rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.quick-add {
    background: #059669;
    color: white;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.quick-add:hover {
    background: #047857;
}

/* Promotional Block - Mobile */
.promotional-block {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #FF2E96 0%, #F81894 100%);
    border-radius: 1rem;
    padding: 1rem;
    margin: 1rem 0;
    color: white;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.promotional-block::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.promo-content {
    position: relative;
    z-index: 1;
}

.promo-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.promotional-block h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.promotional-block p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.promo-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.promo-features .feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.promo-features .feature-icon {
    font-size: 1.5rem;
}

.promo-security {
    margin-top: 1rem;
}

.security-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.security-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* Small Business Badge - Mobile (relative positioning) */
.small-business-badge {
    position: relative;
    top: auto;
    left: auto;
    margin: 10px 15px 0;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    justify-content: center;
}

.small-business-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #667eea 20%, #764ba2 80%);
}

.badge-icon {
    width: 20px;
    height: 20px;
    color: #FFD700;
    flex-shrink: 0;
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.badge-text {
    flex: 1;
    line-height: 1.2;
}

.badge-main {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
}

.badge-sub {
    font-size: 9px;
    opacity: 0.9;
    font-weight: 400;
}

/* Empty Products State */
.empty-products {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    width: 60px;
    height: 60px;
    color: #cbd5e1;
    margin: 0 auto 1rem;
}

.empty-content h3 {
    font-size: 1.25rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ========================================
   SMALL PHONES (480px+)
   ======================================== */
@media (min-width: 480px) {
    .products-container {
        padding: 0 1rem 1.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .image-frame {
        padding: 6px;
        margin: 8px;
        width: calc(100% - 16px);
    }
    
    .product-info {
        padding: 1.25rem;
    }
    
    .empty-products {
        padding: 3rem 1.5rem;
    }
    
    .empty-icon {
        width: 70px;
        height: 70px;
    }
}

/* ========================================
   LARGE PHONES (640px+)
   ======================================== */
@media (min-width: 640px) {
    .promotional-block {
        padding: 1.5rem;
    }
    
    .promotional-block h3 {
        font-size: 1.5rem;
    }
    
    .promotional-block p {
        font-size: 1rem;
    }
    
    .promo-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .promo-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .promo-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   TABLETS (768px+)
   ======================================== */
@media (min-width: 768px) {
    .products-container {
        padding: 0 2rem 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .image-frame {
        padding: 8px;
        margin: 12px;
        width: calc(100% - 24px);
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-heading {
        font-size: 0.75rem;
    }
    
    .product-secondheading {
        font-size: 1rem;
    }
    
    .promotional-block {
        padding: 1.5rem;
    }
    
    .promo-features {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Small Business Badge - Fixed on larger screens */
    .small-business-badge {
        position: fixed;
        top: 70px;
        left: 10px;
        margin: 0;
        max-width: 160px;
        justify-content: flex-start;
    }
    
    .empty-products {
        padding: 4rem 2rem;
    }
    
    .empty-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }
    
    .empty-content h3 {
        font-size: 1.5rem;
    }
    
    .empty-content p {
        font-size: 1rem;
    }
}

/* ========================================
   DESKTOP (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .products-container {
        padding: 0 2rem 4rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .product-heading {
        font-size: 1rem;
    }
    
    .product-secondheading {
        font-size: 1.25rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .promotional-block {
        padding: 2rem;
        margin: 2rem 0;
    }
    
    .promotional-block h3 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .promotional-block p {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
    
    .promo-features {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .small-business-badge {
        top: 80px;
        left: 20px;
        padding: 12px 16px;
        max-width: 200px;
    }
    
    .badge-icon {
        width: 24px;
        height: 24px;
    }
    
    .badge-main {
        font-size: 13px;
    }
    
    .badge-sub {
        font-size: 10px;
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .promotional-block,
    .product-image,
    .small-business-badge {
        transition: none !important;
        animation: none !important;
    }
    
    .product-card:hover {
        transform: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: #1a202c;
        color: white;
        border-color: #2d3748;
    }
    
    .image-frame {
        background: #2d3748;
    }
    
    .product-image {
        background: #2d3748;
    }
}

/* Print Styles */
@media print {
    .promotional-block,
    .product-actions,
    .small-business-badge {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .product-grid {
        gap: 1rem !important;
    }
}