/* =========================================
   VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    --primary: #c62828;      /* Rojo Madrid */
    --primary-dark: #a82222;
    --dark: #264653;         /* Azul Petróleo para contraste */
    --light-bg: #f4f7f6;     /* Fondo gris muy claro */
    --white: #ffffff;
    --text: #333333;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--text);
}

/* =========================================
   ENCABEZADO (HEADER)
   ========================================= */
header {
    background: var(--dark);
    color: var(--white);
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h2 {
    margin: 0;
    font-size: 1.5rem;
}

nav a {
    color: var(--white);
    text-decoration: none;
    margin-left: 20px;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary);
}

/* =========================================
   BANNER PRINCIPAL (HERO)
   ========================================= */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('https://images.unsplash.com/photo-1539037116277-4db20889f2d4?q=80&w=1200');
    background-size: cover;
    background-position: center;
    height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    padding: 0 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* =========================================
   CONTENEDOR Y TÍTULOS
   ========================================= */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    color: var(--dark);
    margin-bottom: 30px;
    font-size: 2rem;
}

/* =========================================
   TARJETAS DE CATÁLOGO (CARDS)
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
}

.card-body h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.location {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.price {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn {
    background: var(--primary);
    color: var(--white);
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--primary-dark);
}

/* =========================================
   FORMULARIO DE CONTACTO
   ========================================= */
form {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

/* =========================================
   FOOTER (PIE DE PÁGINA)
   ========================================= */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 50px 8% 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h4 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-section p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

/* =========================================
   RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 20px;
    }

    nav {
        margin-top: 15px;
    }

    nav a {
        margin: 0 10px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    form {
        padding: 20px;
    }
}