/* 
  ===== MEU CARRINHO - PREMIUM MODERN DESIGN SYSTEM =====
  Focus: Responsividade, Mobile-First, UX Moderna
*/

:root {
    /* Color Palette - Modern & Clean */
    --primary: #0077ff;
    --primary-dark: #0061d1;
    --primary-light: #e6f1ff;
    --secondary: #ff4d4d;
    --accent: #00d2ff;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Neutral Colors */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-light: #e2e8f0;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Breakpoints */
    --max-width: 1280px;
}

/* 1. RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base for rem */
}

body {
    font-family: 'Poppins', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul { list-style: none; }

button, input {
    font-family: inherit;
    outline: none;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 2. TYPOGRAPHY - Responsive Scale */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem; /* Increased from 1rem */
}

h1 { font-size: 2.25rem; } /* Mobile */
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
}

/* 3. HEADER & NAVIGATION - Mobile First */
.header-premium {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: grid;
    grid-template-columns: auto auto; /* Logo and Toggle */
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
}

.logo-section {
    grid-column: 1;
}

.mobile-menu-toggle {
    grid-column: 2;
    justify-self: end;
}

.search-section {
    grid-column: 1 / span 2; /* Full width row on mobile */
    width: 100%;
    margin-top: 0.5rem;
}

@media (min-width: 1024px) {
    .header-container {
        display: flex;
        justify-content: space-between;
        grid-template-columns: none;
        gap: 1.5rem;
    }
    .search-section {
        flex: 1;
        margin-top: 0;
    }
}

.input-wrapper {
    background: white;
    border-radius: 50px;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.search-input {
    border: none;
    flex: 1;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    background: transparent;
}

.search-icon {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.btn-search-premium {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .btn-search-premium {
        padding: 0.6rem 1.5rem;
        font-size: 0.95rem;
    }
    .logo-link img { height: 60px; }
}

@media (max-width: 767px) {
    .logo-link img { height: 40px; }
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: block;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

.actions-section {
    position: fixed;
    top: 130px; /* Adjusted for two-row header on mobile */
    left: -100%;
    width: 100%;
    height: calc(100vh - 130px);
    background: var(--primary);
    flex-direction: column;
    padding: 2rem;
    transition: left 0.4s ease;
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 1001;
}


.actions-section.active {
    left: 0;
}

@media (min-width: 1024px) {
    .mobile-menu-toggle { display: none; }
    .actions-section {
        position: static;
        flex-direction: row;
        height: auto;
        padding: 0;
        width: auto;
        background: transparent;
    }
}

.nav-item {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

@media (min-width: 1024px) {
    .nav-item { font-size: 0.95rem; }
    .nav-item:hover { border-bottom-color: white; }
}

/* 4. CARDS & GRIDS */
/* Common Grid setups */
.responsive-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

/* 1 Column Mobile, 2 Tablet, 4 Desktop */
.grid-standard {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-standard { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-standard { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
    .grid-standard { grid-template-columns: repeat(4, 1fr); }
}

/* Generic Card Styles */
.card-premium {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-premium:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary);
}

/* Supermarket Card specific */
.supermarket-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.supermarket-logo {
    height: 80px;
    display: flex;
    align-items: center;
}

.supermarket-logo img {
    max-height: 100%;
    object-fit: contain;
}

.supermarket-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
}

/* 5. SECTIONS & HEADERS */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem; /* More space before content */
    padding: 0 1rem;
}

.section-header h2 {
    margin-bottom: 1.25rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Hero Section */
.hero-intro {
    background: linear-gradient(135deg, #0077ff 0%, #0055cc 100%);
    position: relative;
    color: white;
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 3.5rem; /* Space from carousel banner */
    border-bottom-left-radius: 60px;
    border-bottom-right-radius: 60px;
    box-shadow: 0 10px 30px rgba(0, 119, 255, 0.2);
    overflow: hidden;
}

/* Subtle background pattern */
.hero-intro::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-intro h1 {
    margin-bottom: 1.5rem;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-intro p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .hero-intro {
        padding: 7rem 0;
        margin-bottom: 5rem;
    }
    .hero-intro h1 {
        font-size: 4rem;
    }
    .hero-intro p {
        font-size: 1.25rem;
    }
}

/* Supermarket Themes */
.theme-atacadao { background: linear-gradient(rgba(224, 30, 30, 0.9), rgba(180, 0, 0, 1)), url('/image/atacadao-bg.jpg'); }
.theme-assai { background: linear-gradient(rgba(0, 102, 204, 0.9), rgba(0, 51, 153, 1)), url('/image/assai-bg.jpg'); }
.theme-mateus { background: linear-gradient(rgba(240, 140, 0, 0.9), rgba(200, 100, 0, 1)), url('/image/mateus-bg.jpg'); }

/* 5. FORMS - Responsive */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"], 
input[type="email"], 
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1.5px solid var(--border-light);
    border-radius: 0.75rem;
    background: white;
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* 6. HERO BANNER - SLIDESHOW */
.hero-banner {
    margin-bottom: 4rem; /* Separation from next section */
    overflow: hidden;
}

.slideshow-container {
    max-width: 100%;
    position: relative;
    margin: auto;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.slideshow-container img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .slideshow-container img {
        height: 450px;
    }
}

.slide-indicators {
    text-align: center;
    padding: 1rem 0;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: var(--border-light);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
    background-color: var(--primary);
}

/* 7. BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    gap: 0.5rem;
    width: auto; /* Changed from 100% to allow auto-width in navs */
}

/* Use this for full-width buttons on mobile */
.btn-block {
    width: 100%;
}

@media (max-width: 640px) {
    /* Only auto-apply block to specific contexts if needed, or leave it to the user */
    .form-group .btn, .product-card .btn {
        width: 100%;
    }
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 119, 255, 0.3);
}

/* 7. UTILITIES & ANIMATIONS */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s forwards;
}

@keyframes slideInLeft {
    to { opacity: 1; transform: translateX(0); }
}

.text-center { text-align: center; }
.mb-4 { margin-bottom: 2rem; }

/* 9. CAROUSEL & HIGHLIGHTS */
.highlights-section {
    padding: 4rem 0;
    background: white;
}

.carousel-container {
    position: relative;
    padding: 1rem 0;
    overflow: hidden; /* Viewport for the track */
}

/* Arrows - Positioned at the extreme edges */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid var(--primary-light);
    color: var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    z-index: 100;
}

.left-arrow { left: 0.5rem; }
.right-arrow { right: 0.5rem; }

.carousel-arrow:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.highlights-grid, .promocoes-grid {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
    width: max-content; /* Critical for translateX track */
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

/* Ensure container hides overflow for the translateX effect */
.carousel-container {
    position: relative;
    padding: 1.5rem 0; /* More padding and centered */
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
}

/* Ensure each card has a fixed width in the carousel */
.highlights-grid .product-card {
    min-width: 280px;
    max-width: 280px;
}

@media (max-width: 640px) {
    .highlights-grid .product-card {
        min-width: 240px;
        max-width: 240px;
    }
    .carousel-arrow {
        width: 40px;
        height: 40px;
    }
}

.product-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.discount-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.8rem;
    z-index: 5;
    box-shadow: var(--shadow-sm);
}

.product-info {
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Space between name and prices */
}

.product-name {
    font-size: 1rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3rem;
}

/* Supermarket Tags */
.supermarket-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
}

.supermarket-tag.mateus { background: #fee2e2; color: #b91c1c; }
.supermarket-tag.assai { background: #dcfce7; color: #15803d; }
.supermarket-tag.atacadao { background: #fef9c3; color: #a16207; }

.product-image-container {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

/* 9. FOOTER */
.footer-premium {
    background: #1e293b;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-logo img { height: 60px; margin-bottom: 1.5rem; }
.footer-links h4 { margin-bottom: 1.5rem; color: var(--accent); }
.social-icons { display: flex; gap: 1.5rem; font-size: 1.5rem; }

/* 9. MARKET SPECIFIC COMPONENTS */
.category-nav-wrapper {
    background: white;
    position: sticky;
    top: 75px; 
    z-index: 900;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 1023px) {
    .category-nav-wrapper { top: 121px; } /* Adjust for mobile stacked header */
}


.category-nav::-webkit-scrollbar {
    display: none;
}

.cat-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem !important;
    border-radius: 50px !important;
    white-space: nowrap;
    opacity: 0.85;
}

.cat-link:hover {
    opacity: 1;
}

.market-link img {
    padding: 10px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.market-link:hover img {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* 10. AUTH PAGES (LOGIN / REGISTER) */
.auth-page {
    background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    background-color: var(--primary);
    padding: 1.5rem 0;
    text-align: center;
}

.auth-logo img {
    height: 50px;
    margin: 0 auto;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.5);
    color: white;
}

.auth-card h2 {
    text-align: center;
    background: linear-gradient(135deg, white 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.22rem;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-card input {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.auth-card input:focus {
    background: rgba(255, 255, 255, 0.08);
}

.auth-card label {
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
}

/* 11. SECTION HEADERS */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
    padding-top: 2rem;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 2.8rem;
    }
    .section-header {
        margin-bottom: 4rem;
        padding-top: 3rem;
    }
}

