/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #25D366;
    --electric-color: #FFA500;
    --dark-color: #1a1a1a;
    --light-color: #f8f9fa;
    --text-color: #333;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    max-width: 180px;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-contact {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-call,
.btn-whatsapp {
    padding: 10px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.btn-call {
    background-color: #0052a3;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 2px solid #0052a3;
}

.btn-call:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
}

.btn-whatsapp {
    background-color: #1DA851;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 2px solid #1DA851;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-eletricista {
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 400;
}

.hero-description {
    font-size: 1rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #20ba5a;
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: transparent;
    color: white;
    transform: translateY(-3px);
}

/* Sections */
section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--dark-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Services Main (Home Page) */
.services-main {
    background-color: var(--light-color);
}

.services-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.service-main-card {
    background: white;
    padding: 35px 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.service-main-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.service-icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
}

.service-main-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.service-list {
    list-style: none;
    text-align: left;
    margin-bottom: 25px;
}

.service-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
}

.service-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.btn-service {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-service:hover {
    background-color: #0052a3;
    transform: translateX(5px);
}

/* Services Grid (Service Pages) */
.services {
    background-color: var(--light-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.service-card {
    background: white;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--dark-color);
}

.service-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Gallery Section */
.gallery {
    background-color: #fff;
    padding: 40px 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Improve visibility on small images by centering and providing a subtle border */
.gallery-item img[width][height] {
    max-width: 100%;
    max-height: 100%;
    object-position: center;
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 60%);
    color: white;
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}
.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay p {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

/* Benefits Section */
.benefits {
    background-color: var(--light-color);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.benefit-item {
    text-align: center;
    padding: 20px;
}

.benefit-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0 auto 15px;
}

.benefit-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.benefit-item p {
    color: #666;
    font-size: 0.95rem;
}

/* Coverage Section */
.coverage {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.coverage-text {
    text-align: center;
    font-size: 1.05rem;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.8;
    color: #555;
}

.coverage-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.location-tag {
    background-color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.location-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
    color: white;
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.cta-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

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

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.footer-info h3,
.footer-contact h4 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.footer-info p,
.footer-contact p {
    margin-bottom: 8px;
    opacity: 0.9;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #1DA851;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(29, 168, 81, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 2px solid #1DA851;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
    }
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .hero-buttons,
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .header-content {
        justify-content: center;
        text-align: center;
    }
    
    .header-contact {
        width: 100%;
        justify-content: center;
    }
    
    .services-grid,
    .gallery-grid,
    .benefits-grid,
    .services-cards {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    section {
        padding: 45px 0;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0;
    }
    
    .logo img {
        height: 35px;
        max-width: 150px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .btn-call,
    .btn-whatsapp {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .cta-title {
        font-size: 1.6rem;
    }
    
    .service-main-card,
    .service-card {
        padding: 25px 18px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}

/* Performance Optimizations */
img {
    max-width: 100%;
    height: auto;
    /* Otimizações de renderização */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Previne layout shift */
    aspect-ratio: attr(width) / attr(height);
}

/* Otimizações específicas para galeria */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Melhora a renderização */
    image-rendering: auto;
    /* Transição suave para lazy loading */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item img[loading="lazy"] {
    opacity: 1;
}

.gallery-item img[loading="eager"] {
    opacity: 1;
}

/* Otimização para imagens que ainda estão carregando */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

/* Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .whatsapp-float,
    .header,
    .cta {
        display: none;
    }
}
