:root {
    /* Color Palette - HSL for harmony */
    --primary-h: 145;
    --primary-s: 63%;
    --primary-l: 42%;
    --primary-color: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 30%);
    
    --secondary-color: #f39c12;
    --accent-color: #3498db;
    
    --text-main: #1a1f23;
    --text-muted: #5e6d7a;
    --bg-app: #ffffff;
    --bg-light: #f9fafb;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Global Reset & Polish */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Redesign */
.main-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
}

.main-logo {
    height: 48px;
    width: auto;
    display: block;
}

.search-bar {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1.2rem 0.8rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-light);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.5;
}

.search-bar button {
    display: none;
}

.main-nav {
    display: flex;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
}

/* Hero Section */
.hero {
    background: #ffffff;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Store Listing & Grids */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.store-item {
    background: white;
    padding: 2rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.store-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.store-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.store-item:hover img {
    transform: scale(1.15);
}

.store-item span {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Alphabetical Section */
.alphabet-section { margin-bottom: 3rem; }
.letter-head { font-size: 2rem; color: var(--primary-color); border-bottom: 2px solid var(--primary-light); margin-bottom: 1.5rem; padding-bottom: 0.5rem; }

.stores-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.store-card-mini {
    background: white;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.store-card-mini img {
    max-width: 80% !important;
    height: 40px !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto 0.5rem;
}

.store-card-mini span { font-size: 0.8rem; font-weight: 600; }

.hero-logo-large {
    width: 120px;
    height: 120px;
    object-fit: contain;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    display: block;
    margin: 0 auto;
}

/* Coupon Cards & Store Premium */
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.coupon-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-top: 3rem;
}

.store-hero {
    background: white;
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

/* Home Page specific sections */
.popular-stores, .featured-coupons {
    padding: 4rem 0;
}

.view-all-container {
    text-align: center;
    margin-top: 3rem;
}

.btn-secondary {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* Homepage Coupon Cards */
.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.coupon-logo-wrapper {
    width: 60px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo-fallback {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.badge-status {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.btn-coupon-small {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.btn-coupon-small:hover { opacity: 0.9; }

.badge-type {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.badge-type.cupom { background: #e7f3eb; color: #27ae60; }
.badge-type.oferta { background: #fef5e7; color: #f39c12; }

/* Strategic Elements */
.trust-bar {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.trust-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    font-size: 0.9rem;
}

/* Unified Mobile Responsiveness */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    
    .container-header {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }

    .mobile-menu-toggle {
        display: block !important;
        grid-row: 1;
        grid-column: 2;
    }

    .search-bar {
        grid-column: 1 / -1;
        margin-top: 0.5rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        z-index: 9999;
        border-bottom: 3px solid var(--primary-color);
    }

    .main-nav.active {
        display: flex !important;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1.25rem;
        list-style: none;
    }

    .main-nav a {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
    }

    .main-content-grid { grid-template-columns: 1fr; }
    .store-sidebar { display: none; }

    .stores-grid-mini {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    .store-card-mini { padding: 1rem 0.5rem; }
    .store-card-mini img { height: 35px !important; }

    .coupon-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero h1 { font-size: 2.25rem; }
    .trust-container { flex-direction: column; gap: 0.5rem; align-items: center; }
}

/* Footer Defaults */
.main-footer {
    background: #0f172a;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

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

.footer-links ul { list-style: none; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; text-align: center; color: rgba(255,255,255,0.4); }
