/**
 * Lojinha Bicuiras - Modern E-commerce CSS
 * Design System: Minimalist + Brutalist Modern
 * Referências: Allbirds, Everlane, Warby Parker, Glossier
 * Mobile-First, Performance-Optimized
 */

/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
    /* Colors */
    --shop-primary: #2DB8C7;
    --shop-primary-dark: #2399a6;
    --shop-secondary: #1E88E5;
    --shop-text-primary: #1E293B;
    --shop-text-secondary: #64748b;
    --shop-text-muted: #94a3b8;
    --shop-bg: #F5F9FC;
    --shop-bg-white: #FFFFFF;
    --shop-border: #e2e8f0;
    --shop-success: #10b981;
    --shop-warning: #f59e0b;
    --shop-error: #ef4444;
    
    /* Typography */
    --font-display: 'Bebas Neue', 'Archivo Black', Impact, sans-serif;
    --font-heading: 'Oswald', 'Bebas Neue', sans-serif;
    --font-body: 'DM Sans', 'Inter', -apple-system, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-base: 1;
    --z-sticky: 100;
    --z-fixed: 200;
    --z-modal: 1000;
}

/* ========================================
   BASE STYLES
   ======================================== */
body.shop-page {
    font-family: var(--font-body);
    background: var(--shop-bg);
    color: var(--shop-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LOJA CONTAINER
   ======================================== */
.loja-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    padding-bottom: calc(var(--space-2xl) + 80px); /* Bottom nav space */
}

/* ========================================
   HERO SECTION
   ======================================== */
.loja-hero {
    text-align: center;
    margin-bottom: var(--space-3xl);
    padding: var(--space-3xl) var(--space-xl);
    background: linear-gradient(135deg, var(--shop-primary), var(--shop-secondary));
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.loja-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}

.loja-hero-content {
    position: relative;
    z-index: var(--z-base);
}

.loja-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
}

.loja-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
    line-height: 1;
}

.loja-hero-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   FILTER BAR
   ======================================== */
.filter-bar {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--shop-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--shop-border);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--shop-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-body);
}

.filter-btn:hover {
    border-color: var(--shop-primary);
    color: var(--shop-primary);
}

.filter-btn.active {
    background: var(--shop-primary);
    border-color: var(--shop-primary);
    color: white;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 3rem;
    border: 2px solid var(--shop-border);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-family: var(--font-body);
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 3px rgba(45, 184, 199, 0.1);
}

.search-icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--shop-text-muted);
    pointer-events: none;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

/* ========================================
   PRODUCT CARD
   ======================================== */
.product-card {
    background: var(--shop-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 1 !important; /* Sempre visível */
    transform: none !important; /* Sem transformação inicial */
}

.product-card:hover {
    transform: translateY(-8px) !important; /* Efeito hover */
    box-shadow: var(--shadow-lg);
}

.product-card:active {
    transform: translateY(-4px) scale(0.98);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--shop-success);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-md);
    z-index: var(--z-base);
    box-shadow: var(--shadow-md);
}

.product-badge.new {
    background: var(--shop-secondary);
}

.product-badge.sale {
    background: var(--shop-error);
}

/* Image Wrapper */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f8fafc;
    border: 2px solid var(--shop-charcoal);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow), opacity var(--transition-base);
    display: block; /* Garantir que sempre apareça */
    opacity: 1; /* Sempre visível */
}

.product-card:hover .product-image:not(.product-image-back) {
    transform: scale(1.08);
}

/* Image Toggle (Front/Back) */
.product-image-back {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base), transform var(--transition-slow);
    pointer-events: none;
}

.product-card:hover .product-image-back {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1.08);
}

/* Garantir que a imagem frontal sempre apareça */
.product-image:not(.product-image-back) {
    opacity: 1 !important;
    display: block !important;
    position: relative;
    z-index: 1;
}

/* Quick View Button */
.quick-view-btn {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    padding: var(--space-sm) var(--space-xl);
    background: white;
    color: var(--shop-text-primary);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-base);
    white-space: nowrap;
    font-family: var(--font-body);
}

.product-card:hover .quick-view-btn {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.quick-view-btn:hover {
    background: var(--shop-primary);
    color: white;
}

/* Product Info */
.product-info {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--shop-text-muted);
}

.product-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--shop-text-primary);
    line-height: 1.3;
    margin: 0;
}

.product-description {
    font-size: 0.875rem;
    color: var(--shop-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-colors {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--shop-border);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--shop-primary);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--shop-border);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-primary);
}

.product-price-old {
    font-size: 1rem;
    text-decoration: line-through;
    color: var(--shop-text-muted);
    margin-left: var(--space-sm);
}

.add-to-cart-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--shop-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
}

.add-to-cart-btn:hover {
    background: var(--shop-primary-dark);
    transform: scale(1.05);
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--shop-bg-white);
    border-radius: var(--radius-lg);
    margin: var(--space-3xl) 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    color: var(--shop-text-secondary);
    font-size: 1rem;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-3xl);
}

.pagination-btn {
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--shop-border);
    border-radius: var(--radius-md);
    background: var(--shop-bg-white);
    color: var(--shop-text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 44px;
    font-family: var(--font-body);
}

.pagination-btn:hover {
    border-color: var(--shop-primary);
    color: var(--shop-primary);
}

.pagination-btn.active {
    background: var(--shop-primary);
    border-color: var(--shop-primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-lg);
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .loja-container {
        padding: var(--space-xl) var(--space-md);
        padding-bottom: calc(var(--space-xl) + 80px);
    }
    
    .loja-hero {
        padding: var(--space-xl) var(--space-lg);
        margin-bottom: var(--space-xl);
    }
    
    .loja-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .product-info {
        padding: var(--space-md);
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
    
    .quick-view-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .product-info {
        padding: var(--space-sm);
    }
    
    .product-name {
        font-size: 0.875rem;
    }
    
    .product-description {
        display: none;
    }
    
    .product-footer {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }
    
    .add-to-cart-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   LOADING STATES
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, 
        #f0f0f0 25%, 
        #e0e0e0 50%, 
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 400px;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.product-card:focus-visible,
.filter-btn:focus-visible,
.add-to-cart-btn:focus-visible {
    outline: 3px solid var(--shop-primary);
    outline-offset: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid currentColor;
    }
    
    .filter-btn {
        border-width: 3px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .filter-bar,
    .add-to-cart-btn,
    .quick-view-btn {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

