@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #c01e2d; /* Rojo corporativo */
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --accent-color: #d9534f; /* Para precios/ofertas */
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --font-main: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

button, input, select, textarea, h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main) !important;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0;
    text-align: center;
    font-size: 0.9em;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

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

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

/* Hero Section */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/view-male-engineer-work-engineers-day-celebration.jpg'); /* Updated image if available or keep placeholder */
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 60px 5%;
    display: flex;
    align-items: center;
    min-height: 500px;
    height: auto; /* Allow growth */
}

/* Hero Container Grid */
.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
}

/* Left Content */
.hero-left {
    color: white;
    text-align: left;
}

.hero-left h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
}

.hero-left p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 90%;
}

/* Right Form Card */
.hero-form-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    margin-left: auto;
}

.hero-form-card h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #a01724;
}

/* Responsive Hero */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-left {
        text-align: center;
        margin-bottom: 40px;
    }
    
    .hero-left p {
        margin: 0 auto 30px;
    }

    .hero-form-card {
        margin: 0 auto;
    }
}

/* Old style override/removal target */
.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

/* Courses Grid */
.courses-section {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Modifier for Full Width Sections */
.courses-section.full-width {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 15px auto 0;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.course-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.course-image {
    width: 100%;
    height: 200px;
    background-color: #eee;
    object-fit: cover;
}

.course-content {
    padding: 20px;
}

.course-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
    display: block;
}

.course-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.course-meta i {
    margin-right: 5px;
    color: var(--primary-color);
}

.price {
    display: block;
    margin-top: 10px;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.btn-course {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn-course:hover {
    background-color: #003d80;
}

/* Stats Section */
.stats-section {
    background-color: var(--secondary-color);
    padding: 60px 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--primary-color);
}

.stat-item p {
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 5% 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a:hover {
    color: #aaa;
}

.copyright {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}

/* Services Section Specifics */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 20px 0;
}

.service-card {
    background: white;
    padding: 40px 30px;
    border: 2px solid var(--primary-color); /* Borde rojo como en la imagen */
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(192, 30, 45, 0.15);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.service-title {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 400; /* Tipografía más fina como en la imagen */
}

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

@media (max-width: 768px) {
    .services-grid,
    .course-grid {
        grid-template-columns: 1fr; /* Apilar en móviles */
    }

    .main-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-links {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  padding-top: 100px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.9); 
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: auto;
  min-height: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  margin-top: 15px;
}

.modal-content, #caption {  
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

@media only screen and (max-width: 700px){
  .modal-content {
    width: 100%;
  }
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  padding-top: 100px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.9); 
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  margin-top: 15px;
}

.modal-content, #caption {  
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Logo Image Styles */
.logo-image {
    max-height: 80px;
    width: auto;
    display: block;
}

/* --- Courses Page Styles --- */
.page-header {
    background-color: var(--secondary-color);
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.page-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

.courses-section.full-width {
    padding: 3rem 1rem;
    background-color: #fff;
}

.courses-page-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.courses-page-grid .course-card {
    width: 100%; 
    flex: none;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.courses-page-grid .course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.courses-page-grid .card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.courses-page-grid .course-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .courses-page-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .courses-page-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .courses-page-grid {
        grid-template-columns: 1fr;
    }
}
