/*
Theme Name: Madrid Electro
Theme URI: https://rainbowtechnology.xyz
Author: Antigravity
Description: A premium, high-performance theme for Appliance Repair & Spares in Madrid.
Version: 1.5 (Polished)
*/

:root {
    --bg-color: #e0e5ec;
    --text-color: #4a4a4a;
    --primary-color: #007bff;
    --accent-color: #ff4757;
    --shadow-light: #ffffff;
    --shadow-dark: #a3b1c6;
    --font-main: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: color 0.3s; }
a:hover { color: var(--accent-color); }

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

/* --- Header --- */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    margin-bottom: 60px;
    border-radius: 30px;
    background: var(--bg-color);
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.logo h2 { 
    margin: 0; 
    color: #333; 
    font-weight: 800; 
    letter-spacing: -1px;
    font-size: 1.8rem;
}

nav { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }

nav a {
    padding: 12px 24px;
    border-radius: 15px;
    color: #555;
    font-weight: 500;
}

nav a:hover {
    background: var(--bg-color);
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    text-align: center;
    padding: 100px 20px;
    border-radius: 40px;
    margin-bottom: 80px;
    overflow: hidden;
    color: white;
    box-shadow: 20px 20px 60px var(--shadow-dark), -20px -20px 60px var(--shadow-light);
    /* Animated Gradient Background */
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
    font-size: 2.5rem;
    margin: 0 0 20px;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
@media (min-width: 768px) { .hero h1 { font-size: 4rem; } }

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 18px 40px;
    background: #fff;
    color: var(--accent-color);
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

/* --- Featured Image --- */
.featured-image-container {
    text-align: center;
    margin-bottom: 80px;
    padding: 0 20px;
}

.featured-image {
    max-width: 100%;
    border-radius: 30px;
    box-shadow: 25px 25px 50px var(--shadow-dark), -25px -25px 50px var(--shadow-light);
    transition: transform 0.5s ease;
}
.featured-image:hover { transform: scale(1.02); }

/* --- Brands Section --- */
.brands-section {
    text-align: center;
    margin-bottom: 80px;
}
.brands-section h2 { margin-bottom: 40px; font-size: 2rem; color: #333; }

.brands-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.brand-item {
    padding: 15px 30px;
    background: var(--bg-color);
    border-radius: 50px;
    font-weight: 700;
    color: #666;
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    transition: all 0.3s ease;
    cursor: default;
}

.brand-item:hover {
    color: var(--primary-color);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    transform: translateY(2px);
}

/* --- Categories & Info Grid --- */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: #333;
    font-weight: 700;
}

.categories-grid, .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.card, .category-card {
    background: var(--bg-color);
    padding: 40px 30px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.4);
}

.card:hover, .category-card:hover {
    transform: translateY(-10px);
}

.category-icon { font-size: 3.5rem; display: block; margin-bottom: 20px; }

.card h3, .category-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* --- Map --- */
.map-section { margin-bottom: 60px; }
.map-container {
    height: 450px;
    border-radius: 30px;
    padding: 15px;
    background: var(--bg-color);
    box-shadow: inset 12px 12px 24px var(--shadow-dark), inset -12px -12px 24px var(--shadow-light);
}

iframe { border-radius: 20px; filter: grayscale(0%); }

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px;
    border-radius: 30px 30px 0 0;
    background: #333;
    color: #aaa;
    margin-top: 60px;
}

/* Map Fix */
.map-container {
    height: 450px;
    width: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: block;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Brand Colors (80% Opacity) */
.brand-item { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

.brand-bosch { background: rgba(224, 4, 32, 0.8); }
.brand-balay { background: rgba(0, 75, 147, 0.8); }
.brand-siemens { background: rgba(0, 153, 153, 0.8); }
.brand-aeg { background: rgba(34, 34, 34, 0.8); }
.brand-samsung { background: rgba(20, 40, 160, 0.8); }
.brand-lg { background: rgba(165, 0, 52, 0.8); }
.brand-whirlpool { background: rgba(253, 185, 19, 0.8); color: #333 !important; text-shadow: none; }
.brand-indesit { background: rgba(0, 84, 159, 0.8); }
.brand-fagor { background: rgba(227, 6, 19, 0.8); }
.brand-teka { background: rgba(203, 16, 46, 0.8); }
.brand-philips { background: rgba(11, 94, 215, 0.8); }
.brand-solac { background: rgba(255, 102, 0, 0.8); }

/* Categories 3D Modular Update */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

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

.category-card {
    background: #e0e5ec;
    padding: 30px 20px;
    border-radius: 30px;
    text-align: center;
    /* Neumorphism 3D Effect */
    box-shadow: 15px 15px 30px #a3b1c6, -15px -15px 30px #ffffff;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-15px);
    box-shadow: 20px 20px 40px #a3b1c6, -20px -20px 40px #ffffff;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s, transform 0.4s;
}

.category-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.category-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
    transition: transform 0.4s;
}

.category-card:hover .category-img {
    transform: scale(1.1) rotate(5deg);
}

.category-card h3 {
    font-size: 1.3rem;
    color: #4a4a4a;
    font-weight: 700;
    margin: 0;
}

/* Resize Category Images */
.category-img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

/* Force Small Images */
.category-img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Contact Form Section */
.contact-section {
    max-width: 600px;
    margin: 0 auto 80px;
    text-align: center;
}

.contact-form {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.form-group {
    margin-bottom: 25px;
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    outline: none;
    transition: box-shadow 0.3s;
    box-sizing: border-box; /* Fix padding width issue */
}

.contact-form input:focus, 
.contact-form textarea:focus {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.btn-submit {
    width: 100%;
    border: none;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
}

.btn-submit:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Contact Form Improvements */
.contact-section {
    max-width: 800px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: var(--bg-color);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
    align-items: center;
}

.contact-info {
    flex: 1;
    min-width: 250px;
    text-align: left;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact-form-wrapper {
    flex: 1.5;
    min-width: 300px;
}

.contact-form {
    box-shadow: none; /* Remove double shadow */
    padding: 0;
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    box-sizing: border-box; /* Critical for padding */
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    border: none;
    background: #e0e5ec;
    box-shadow: inset 5px 5px 10px #bebebe, inset -5px -5px 10px #ffffff;
    font-size: 1rem;
    color: #4a4a4a;
}

.contact-form input:focus, 
.contact-form textarea:focus {
    outline: none;
    box-shadow: inset 2px 2px 5px #bebebe, inset -2px -2px 5px #ffffff;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    background: #0056b3;
}

/* Contact Form Refinements v2 */
.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: var(--bg-color);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
    align-items: flex-start; /* Align to top */
}

.contact-info {
    flex: 1;
    min-width: 280px;
    text-align: left;
    padding-right: 20px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.contact-info p {
    margin-bottom: 18px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.contact-form-wrapper {
    flex: 1.5;
    min-width: 300px;
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 12px;
    border: none;
    background: #e0e5ec;
    /* Deeper inset shadow for better contrast */
    box-shadow: inset 6px 6px 12px #bebebe, inset -6px -6px 12px #ffffff;
    font-size: 1rem;
    color: #333;
    font-family: 'Inter', sans-serif;
}

.contact-form input:focus, 
.contact-form textarea:focus {
    outline: none;
    box-shadow: inset 3px 3px 6px #bebebe, inset -3px -3px 6px #ffffff;
    background: #eef2f7;
}

.btn-submit {
    width: 100%;
    padding: 18px;
    border-radius: 50px; /* Pill shape */
    background: var(--primary-color);
    color: white;
    font-weight: 800;
    letter-spacing: 1px;
    border: none;
    box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
    background: #0062cc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .contact-container {
        flex-direction: column;
        padding: 25px;
    }
    .contact-info {
        padding-right: 0;
        text-align: center;
        margin-bottom: 20px;
    }
}

/* Mobile Responsive Fixes v3 */
@media (max-width: 480px) {
    /* Global Container Padding */
    .container {
        padding: 0 15px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    /* Header Adjustments */
    header {
        flex-direction: column;
        padding: 15px 0;
        gap: 15px;
    }

    header nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    header nav a {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    /* Hero Section */
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }

    /* Contact Form & Container */
    .contact-container {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .contact-form-wrapper {
        width: 100%;
        min-width: 0; /* Allow shrinking */
    }

    .contact-form input,
    .contact-form textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* Brands Grid */
    .brands-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 10px;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}

/* Mobile Contact Form Fix v4 */
@media (max-width: 480px) {
    .contact-container {
        padding: 15px !important; /* Reduce padding to give more space to inputs */
        width: 100% !important;
        overflow: hidden; /* Cut off anything sticking out */
    }

    .contact-form-wrapper {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .contact-form {
        width: 100% !important;
        margin: 0 !important;
    }

    .contact-form input,
    .contact-form textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 12px !important; /* Slightly smaller padding */
    }
    
    .btn-submit {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Mobile Contact Form Fix v5 - Robust */
@media (max-width: 480px) {
    .contact-form input,
    .contact-form textarea {
        width: 90% !important; /* Force smaller width */
        margin: 0 auto !important; /* Center it */
        display: block !important;
        max-width: 90% !important;
    }
    
    .contact-container {
        padding: 10px !important; /* Even smaller padding */
    }
}

/* Mobile Contact Form Fix v6 - Final */
@media (max-width: 480px) {
    .contact-form {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .contact-form input,
    .contact-form textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 15px 0 !important; /* Reset margins, add bottom space */
        padding: 12px !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    .contact-container {
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .contact-form-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
}
