        :root {
            --primary-color: #6f42c1;
            --secondary-color: #f8f9fa;
            --accent-color: #ff6b6b;
            --dark-color: #343a40;
            --light-color: #ffffff;
            --gray-color: #6c757d;
            --border-radius: 12px;
            --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
            --transition: all 0.3s ease;
            --gradient-primary: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
            --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
            color: var(--dark-color);
            line-height: 1.6;
            min-height: 100vh;
        }
        .public-header {
            background: var(--gradient-primary);
            color: white;
            padding: 1rem 0;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .nav-public {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 1rem;
            flex-wrap: wrap;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: white;
            text-decoration: none;
            margin-bottom: 0.5rem;
        }

        .nav-links {
            display: flex;
            gap: 1rem;
            align-items: center;
            flex-wrap: wrap;
            justify-content: center;
        }

        .nav-link {
            color: rgba(255, 255, 255, 0.9);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            padding: 0.5rem 0.8rem;
            border-radius: var(--border-radius);
            font-size: 0.9rem;
        }

        .nav-link:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .btn-login {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.6rem 1.2rem;
            border-radius: var(--border-radius);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            border: 2px solid rgba(255, 255, 255, 0.3);
            font-size: 0.9rem;
        }

        .btn-login:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
            color: white;
        }

        .admin-badge {
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.7rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            margin-left: 0.5rem;
        }

        .location-banner {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 0.8rem 1rem;
            text-align: center;
            position: relative;
            overflow: hidden;
            display: <?php echo ($user_lat && $user_lon) ? 'none' : 'block'; ?>;
        }

        .location-content {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .location-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
        }

        .btn-location {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .btn-location:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .distance-badge {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.3rem 0.6rem;
            border-radius: 15px;
            font-size: 0.75rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }

        .hero-section {
            background: var(--gradient-primary);
            color: white;
            padding: 3rem 1rem;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .hero-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
        }

        .hero-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 1rem;
            position: relative;
            line-height: 1.2;
        }

        .hero-subtitle {
            font-size: 1rem;
            margin-bottom: 2rem;
            opacity: 0.9;
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
            position: relative;
            line-height: 1.5;
        }

        .search-box {
            max-width: 100%;
            margin: 0 auto;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 1rem 3rem 1rem 1.5rem;
            border: none;
            border-radius: 50px;
            font-size: 1rem;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        }

        .search-btn {
            position: absolute;
            right: 0.5rem;
            top: 50%;
            transform: translateY(-50%);
            background: var(--gradient-primary);
            border: none;
            color: white;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            cursor: pointer;
            transition: var(--transition);
        }

        .search-btn:hover {
            transform: translateY(-50%) scale(1.1);
        }

        /* Main Content - MOBILE FIRST */
        .main-content {
            padding: 2rem 1rem;
        }

        /* Section Styles */
        .section {
            margin-bottom: 3rem;
        }

        .section-header {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            align-items: flex-start;
            margin-bottom: 2rem;
        }

        .section-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--dark-color);
            position: relative;
            padding-bottom: 0.5rem;
        }

        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 3rem;
            height: 3px;
            background: var(--gradient-primary);
            border-radius: 2px;
        }

        .view-all-btn {
            background: var(--gradient-primary);
            color: white;
            border: none;
            padding: 0.8rem 1.5rem;
            border-radius: var(--border-radius);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            width: 100%;
            justify-content: center;
        }

        .view-all-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(111, 66, 193, 0.4);
            color: white;
        }

        /* Grid de Produtos - MOBILE FIRST */
        .products-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .product-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
            transition: var(--transition);
            overflow: hidden;
            position: relative;
            text-decoration: none;
            color: inherit;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .product-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            color: inherit;
            text-decoration: none;
        }

        .product-image-container {
            width: 100%;
            height: 200px;
            overflow: hidden;
            background: #f8f9fa;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem;
        }

        .product-image {
            width: 100%;
            height: 100%;
            object-fit: contain;
            transition: var(--transition);
            max-width: 100%;
            max-height: 100%;
        }

        .product-card:hover .product-image {
            transform: scale(1.05);
        }

        .product-info {
            padding: 1.2rem;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }

        .product-name {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark-color);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .product-store {
            font-size: 0.85rem;
            color: var(--gray-color);
            margin-bottom: 0.8rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .product-price {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 0.5rem;
        }

        .product-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #f0f0f0;
        }

        .product-category {
            background: var(--gradient-primary);
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 15px;
            font-size: 0.7rem;
            font-weight: 500;
        }

        /* Distância badge */
        .distance-indicator {
            background: var(--gradient-secondary);
            color: white;
            padding: 0.3rem 0.6rem;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }

        .distance-indicator.small {
            font-size: 0.65rem;
            padding: 0.2rem 0.5rem;
        }

        /* Botão Visitar Loja */
        .btn-visitar-loja {
            background: var(--gradient-secondary);
            color: white;
            border: none;
            padding: 0.8rem 1rem;
            border-radius: var(--border-radius);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            margin-top: auto;
            justify-content: center;
        }

        .btn-visitar-loja:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
            color: white;
        }

        /* Lojas Grid - MOBILE FIRST */
        .stores-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        .store-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 1.5rem;
            text-align: center;
            transition: var(--transition);
            text-decoration: none;
            color: inherit;
            position: relative;
        }

        .store-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            color: inherit;
            text-decoration: none;
        }

        .store-icon {
            width: 60px;
            height: 60px;
            background: var(--gradient-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            color: white;
            font-size: 1.5rem;
        }

        .store-name {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark-color);
        }

        .store-desc {
            font-size: 0.8rem;
            color: var(--gray-color);
            line-height: 1.4;
            margin-bottom: 1rem;
        }

        .store-distance {
            position: absolute;
            top: 1rem;
            right: 1rem;
        }

        /* Features Section - MOBILE FIRST */
        .features-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
            margin-top: 2rem;
        }

        .feature-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 2rem 1.5rem;
            text-align: center;
            transition: var(--transition);
        }

        .feature-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        }

        .feature-icon {
            width: 60px;
            height: 60px;
            background: var(--gradient-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            color: white;
            font-size: 1.5rem;
        }

        .feature-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.8rem;
            color: var(--dark-color);
        }

        .feature-desc {
            color: var(--gray-color);
            line-height: 1.5;
            font-size: 0.9rem;
        }

        /* Footer - MOBILE FIRST */
        .footer {
            background: var(--dark-color);
            color: white;
            padding: 3rem 1rem 1.5rem;
            margin-top: 3rem;
        }

        .footer-content {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
            margin-bottom: 2rem;
        }

        .footer-section h3 {
            margin-bottom: 1rem;
            color: white;
            font-size: 1.1rem;
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 0.5rem;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
            transition: var(--transition);
            font-size: 0.9rem;
        }

        .footer-links a:hover {
            color: white;
        }

        .footer-bottom {
            text-align: center;
            padding-top: 1.5rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.8rem;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
        }

        .empty-state i {
            font-size: 3rem;
            color: var(--gray-color);
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .empty-state h3 {
            color: var(--dark-color);
            margin-bottom: 0.5rem;
            font-size: 1.2rem;
        }

        .empty-state p {
            color: var(--gray-color);
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }

        /* Modal Location - MAIS AMIGÁVEL */
        .location-modal .modal-content {
            border-radius: 20px;
            border: none;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .location-modal .modal-header {
            border-bottom: none;
            padding: 2rem 2rem 0;
            text-align: center;
        }

        .location-modal .modal-body {
            padding: 1rem 2rem 2rem;
            text-align: center;
        }

        .location-icon {
            font-size: 3rem;
            color: var(--primary-color);
            margin-bottom: 1rem;
        }

        .location-title {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark-color);
        }

        .location-text {
            color: var(--gray-color);
            margin-bottom: 2rem;
            line-height: 1.5;
        }

        .location-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn-location-primary {
            background: var(--gradient-primary);
            color: white;
            border: none;
            padding: 0.8rem 2rem;
            border-radius: 25px;
            font-weight: 500;
            transition: var(--transition);
        }

        .btn-location-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(111, 66, 193, 0.4);
        }

        .btn-location-secondary {
            background: transparent;
            color: var(--gray-color);
            border: 1px solid #dee2e6;
            padding: 0.8rem 2rem;
            border-radius: 25px;
            font-weight: 500;
            transition: var(--transition);
        }

        .btn-location-secondary:hover {
            background: #f8f9fa;
            color: var(--dark-color);
        }

        /* Modal para imagem ampliada - CORRIGIDO */
        .image-modal .modal-content {
            border: none;
            border-radius: 15px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
            background: transparent;
            overflow: hidden;
        }

        .image-modal .modal-header {
            border-bottom: none;
            background: rgba(0, 0, 0, 0.7);
            padding: 1rem 1.5rem;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 10;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .image-modal .modal-title {
            color: white;
            font-weight: 600;
            font-size: 1.1rem;
            margin: 0;
        }

        .image-modal .btn-close {
            filter: invert(1);
            opacity: 0.8;
            padding: 0.5rem;
            margin: 0;
            background: transparent;
            border: none;
            font-size: 1.2rem;
        }

        .image-modal .btn-close:hover {
            opacity: 1;
            background: transparent;
        }

        .image-modal .modal-body {
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 60vh;
            background: rgba(0, 0, 0, 0.9);
        }

        .modal-image {
            max-width: 100%;
            max-height: 70vh;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        /* Override do Bootstrap para garantir que o modal feche corretamente */
        .modal-backdrop {
            z-index: 1040;
        }

        .modal {
            z-index: 1050;
        }

        /* Animações */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .fade-in-up {
            animation: fadeInUp 0.6s ease-out;
        }

        /* Loading spinner */
        .spinner-border-sm {
            width: 1rem;
            height: 1rem;
        }

        /* ========== DESKTOP STYLES ========== */
        @media (min-width: 768px) {
            .nav-public {
                padding: 0 2rem;
                flex-wrap: nowrap;
            }

            .logo {
                font-size: 1.8rem;
                margin-bottom: 0;
            }

            .nav-links {
                gap: 2rem;
            }

            .nav-link {
                font-size: 1rem;
                padding: 0.5rem 1rem;
            }

            .btn-login {
                padding: 0.8rem 1.5rem;
                font-size: 1rem;
            }

            .hero-section {
                padding: 5rem 2rem;
            }

            .hero-title {
                font-size: 3rem;
            }

            .hero-subtitle {
                font-size: 1.2rem;
                max-width: 600px;
            }

            .search-box {
                max-width: 600px;
            }

            .main-content {
                padding: 4rem 2rem;
            }

            .section-header {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }

            .section-title {
                font-size: 2rem;
            }

            .view-all-btn {
                width: auto;
            }

            .products-grid {
                grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                gap: 2rem;
            }

            .stores-grid {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 2rem;
            }

            .features-grid {
                grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                gap: 2rem;
            }

            .footer-content {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 3rem;
            }
        }

        @media (min-width: 1024px) {
            .hero-title {
                font-size: 3.5rem;
            }

            .products-grid {
                grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            }
        }

        /* Estilos específicos para telas maiores */
        @media (min-width: 1200px) {
            .products-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }