/**
 * Página: Contacto
 * Metodología: BEM (Block Element Modifier)
 * 
 * Block: contacto-page, contacto-form, contacto-modal
 * Elements: Múltiples elementos de formulario y modal
 */

/* Box-sizing universal */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevenir scroll horizontal */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Block: Página de contacto */
.contacto-page {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Element: Hero/Portada */
.contacto-page__hero {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 0;
  background-color: #fff;
}

.contacto-page__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Element: Title Section */
.contacto-page__title-section {
  width: 100%;
  padding: 40px 20px 0 20px;
  box-sizing: border-box;
}

.contacto-page__title {
  color: #1a1a1a;
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 30px 0;
  text-align: center;
}

/* Element: Contenido principal */
.contacto-page__content {
  width: 100%;
  padding: 60px 20px 80px 20px;
  box-sizing: border-box;
}

.contacto-page__container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Element: Introducción */
.contacto-page__intro {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid #FF6600;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.contacto-page__intro p {
  color: #333;
  font-size: 1.125rem;
  line-height: 1.8;
  margin: 0;
}

.contacto-page__intro strong {
  color: #FF6600;
  font-weight: 600;
}

/* Element: Form Card */
.contacto-page__form-card {
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 60px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

/* Block: Formulario de Contacto */
.contacto-form__group {
  margin-bottom: 25px;
}

.contacto-form__label {
  display: block;
  margin-bottom: 8px;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.9375rem;
}

.contacto-form__required {
  color: #cf2e2e;
  margin-left: 4px;
}

.contacto-form__input,
.contacto-form__textarea,
.contacto-form__select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #d4d4d4;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: #505050;
  transition: all 0.3s ease;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.contacto-form__textarea {
  resize: vertical;
  min-height: 120px;
}

.contacto-form__input:hover,
.contacto-form__textarea:hover,
.contacto-form__select:hover {
  border-color: rgba(255, 102, 0, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contacto-form__input:focus,
.contacto-form__textarea:focus,
.contacto-form__select:focus {
  outline: none;
  border-color: #FF6600;
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.15);
  transform: translateY(-2px);
}

.contacto-form__input::placeholder,
.contacto-form__textarea::placeholder {
  color: #999;
}

/* Phone Input */
.contacto-form__phone {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.contacto-form__select {
  flex-shrink: 0;
  width: 130px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23505050' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.contacto-form__input--phone {
  flex: 1;
  min-width: 0;
}

/* Note */
.contacto-form__note {
  background: linear-gradient(135deg, rgba(255, 102, 0, 0.08) 0%, rgba(255, 102, 0, 0.03) 100%);
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #FF6600;
  font-size: 0.9375rem;
  color: #505050;
  margin-bottom: 25px;
}

.contacto-form__note strong {
  color: #1a1a1a;
}

/* Urgency Switch */
.contacto-form__urgency {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 247, 240, 0.5) 100%);
  border: 2px solid #d4d4d4;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contacto-form__urgency:hover {
  border-color: rgba(255, 102, 0, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contacto-form__urgency.urgent {
  background: linear-gradient(135deg, rgba(207, 46, 46, 0.1) 0%, rgba(207, 46, 46, 0.05) 100%);
  border-color: #cf2e2e;
}

.contacto-form__switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.contacto-form__switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.contacto-form__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.contacto-form__slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.contacto-form__switch input:checked + .contacto-form__slider {
  background-color: #cf2e2e;
}

.contacto-form__switch input:checked + .contacto-form__slider::before {
  transform: translateX(24px);
}

.contacto-form__urgency-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contacto-form__urgency-title {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 0.9375rem;
}

.contacto-form__urgency-desc {
  font-size: 0.875rem;
  color: #505050;
  opacity: 0.8;
}

.contacto-form__urgency.urgent .contacto-form__urgency-title {
  color: #cf2e2e;
}

.contacto-form__urgency-icon {
  font-size: 1.5rem;
  display: none;
}

.contacto-form__urgency.urgent .contacto-form__urgency-icon {
  display: block;
}

/* Error Message */
.contacto-form__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(207, 46, 46, 0.1) 0%, rgba(207, 46, 46, 0.05) 100%);
  border-left: 4px solid #cf2e2e;
  border-radius: 8px;
  color: #cf2e2e;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
}

.contacto-form__error.show {
  opacity: 1;
  max-height: 200px;
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: 8px;
}

.contacto-form__error svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  fill: #cf2e2e;
  flex-shrink: 0;
  margin-top: 2px;
}

.contacto-form__input.error,
.contacto-form__textarea.error {
  border-color: #cf2e2e;
}

.contacto-form__input.error:focus,
.contacto-form__textarea.error:focus {
  border-color: #cf2e2e;
  box-shadow: 0 0 0 4px rgba(207, 46, 46, 0.15);
}

/* Submit Button */
.contacto-form__submit {
  width: 100%;
  background: linear-gradient(135deg, #FF6600 0%, #e55a00 100%);
  color: #ffffff;
  padding: 16px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contacto-form__submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
}

.contacto-form__submit:active {
  transform: translateY(-1px);
}

/* Element: Location Section */
.contacto-page__location {
  margin-bottom: 60px;
}

.contacto-page__location-title {
  color: #1a1a1a;
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 40px 0;
  position: relative;
  padding-bottom: 15px;
}

.contacto-page__location-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #FF6600 0%, #e55a00 100%);
  border-radius: 2px;
}

.contacto-page__location-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Info Items */
.contacto-page__info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contacto-page__info-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.contacto-page__info-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #FF6600 0%, #e55a00 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}

.contacto-page__info-icon svg {
  width: 24px;
  height: 24px;
}

.contacto-page__info-content {
  flex: 1;
}

.contacto-page__info-label {
  color: #1a1a1a;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.contacto-page__info-text {
  color: #666666;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.contacto-page__info-text a {
  color: #FF6600;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.contacto-page__info-text a:hover {
  color: #e55a00;
  text-decoration: underline;
}

/* Map */
.contacto-page__map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.contacto-page__map:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: #FF6600;
}

.contacto-page__map iframe {
  display: block;
  width: 100%;
}

/* Element: CTA Section */
.contacto-page__cta {
  background: linear-gradient(135deg, #FF6600 0%, #e55a00 100%);
  border-radius: 16px;
  padding: 50px 40px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(255, 102, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.contacto-page__cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.contacto-page__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  margin-bottom: 25px;
  color: #ffffff;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.contacto-page__cta-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.contacto-page__cta-title {
  color: #ffffff;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 20px 0;
  position: relative;
  z-index: 1;
}

.contacto-page__cta-text {
  color: #ffffff;
  font-size: 1.125rem;
  line-height: 1.7;
  margin: 0 0 30px 0;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.contacto-page__cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #FF6600;
  font-size: 1.125rem;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.contacto-page__cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #f8f9fa;
}

.contacto-page__cta-button svg {
  width: 20px;
  height: 20px;
}

/* Block: Modal */
.contacto-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.contacto-modal.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.contacto-modal__content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.contacto-modal__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(255, 102, 0, 0.05) 100%);
}

.contacto-modal__icon.error {
  background: linear-gradient(135deg, rgba(207, 46, 46, 0.1) 0%, rgba(207, 46, 46, 0.05) 100%);
}

.contacto-modal__icon.success {
  background: linear-gradient(135deg, rgba(0, 208, 132, 0.1) 0%, rgba(0, 208, 132, 0.05) 100%);
}

.contacto-modal__icon svg {
  width: 40px;
  height: 40px;
  fill: #FF6600;
}

.contacto-modal__icon.error svg {
  fill: #cf2e2e;
}

.contacto-modal__icon.success svg {
  fill: #00d084;
}

.contacto-modal__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin: 0 0 16px 0;
}

.contacto-modal__message {
  font-size: 1rem;
  color: #505050;
  text-align: center;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.contacto-modal__button {
  width: 100%;
  background: linear-gradient(135deg, #FF6600 0%, #e55a00 100%);
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.contacto-modal__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .contacto-page__hero::before,
  .contacto-page__cta::before {
    animation: none;
  }
  
  .contacto-form__submit:hover,
  .contacto-page__cta-button:hover {
    transform: none;
  }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .contacto-page__hero {
    padding: 60px 30px;
  }

  .contacto-page__content {
    padding: 50px 30px 60px 30px;
  }

  .contacto-page__intro {
    padding: 25px;
    margin-bottom: 35px;
  }

  .contacto-page__form-card {
    padding: 35px 30px;
  }

  .contacto-page__cta {
    padding: 40px 30px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .contacto-page__hero {
    padding: 50px 20px;
  }

  .contacto-page__content {
    padding: 40px 20px 50px 20px;
  }

  .contacto-page__intro {
    padding: 20px;
    margin-bottom: 30px;
  }

  .contacto-page__intro p {
    font-size: 1rem;
  }

  .contacto-page__form-card {
    padding: 30px 20px;
  }

  .contacto-form__phone {
    flex-direction: column;
    gap: 15px;
  }

  .contacto-form__select {
    width: 100%;
  }

  .contacto-form__urgency {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .contacto-page__location-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contacto-page__info {
    gap: 25px;
  }

  .contacto-page__info-item {
    gap: 15px;
  }

  .contacto-page__info-icon {
    width: 45px;
    height: 45px;
  }

  .contacto-page__info-icon svg {
    width: 22px;
    height: 22px;
  }

  .contacto-page__info-label {
    font-size: 1rem;
  }

  .contacto-page__info-text {
    font-size: 0.9375rem;
  }

  .contacto-page__map iframe {
    height: 350px;
  }

  .contacto-page__cta {
    padding: 35px 25px;
    border-radius: 12px;
  }

  .contacto-page__cta-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }

  .contacto-page__cta-icon svg {
    width: 48px;
    height: 48px;
  }

  .contacto-page__cta-text {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .contacto-page__cta-button {
    font-size: 1rem;
    padding: 14px 30px;
  }

  .contacto-modal__content {
    padding: 30px 25px;
  }
}
