/**
 * Responsive Fixes and Improvements
 * Fixes for mobile layout issues and improved responsive design
 */

/* ===========================
   DESKTOP HEADER FIXES
   =========================== */
@media (min-width: 769px) {
  .site-header-modern {
    position: sticky !important;
    top: 0 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ===========================
   HEADER RESPONSIVE FIXES
   =========================== */
@media (max-width: 768px) {
  /* Header layout fixes - MANTENER STICKY */
  .site-header-modern {
    position: sticky !important;
    width: 100%;
    top: 0 !important;
    z-index: 9999;
    transform: none !important;
    transition: none !important;
  }

  .main-header-modern {
    padding: 10px 0;
  }

  .header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 0 15px;
  }

  /* Logo responsive */
  .logo-area {
    flex: 0 0 auto;
    max-width: 120px;
  }

  .logo-img {
    height: 40px;
    width: auto;
  }

  /* Hide social icons on mobile */
  .header-social-facebook,
  .header-social-twitter,
  .header-social-instagram,
  .header-social-youtube {
    display: none;
  }

  /* Header buttons group - prevent hiding */
  .header-buttons {
    display: flex !important;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
  }

  /* Affiliate button mobile */
  .btn-afiliate {
    display: inline-flex !important;
    align-items: center;
    padding: 8px 12px;
    background: var(--color-rojo-aragon);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .btn-afiliate .burger-label {
    display: inline-block;
    margin-right: 5px;
  }

  .btn-afiliate .burger-icon {
    display: none;
  }

  /* Menu burger button */
  .menu-burger {
    display: inline-flex !important;
    align-items: center;
    background: transparent;
    border: 2px solid var(--color-rojo-aragon);
    padding: 8px 12px;
    border-radius: 4px;
  }

  .menu-burger .burger-label {
    color: var(--color-rojo-aragon);
    font-size: 0.875rem;
    margin-right: 8px;
  }

  .menu-burger .burger-icon {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 14px;
    justify-content: space-between;
  }

  .menu-burger .burger-icon span {
    display: block;
    height: 2px;
    background: var(--color-rojo-aragon);
    transition: none !important;
  }
}

/* ===========================
   HERO BANNER RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  /* Add padding top for fixed header */
  body {
    padding-top: 60px;
  }

  /* Hero container */
  .hero-banner-modern {
    height: 60vh !important;
    min-height: 400px;
    position: relative;
    overflow: hidden;
  }

  /* Hero background */
  .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover !important;
    background-position: center !important;
  }

  /* Hero overlay */
  .hero-overlay {
    background: linear-gradient(180deg,
      rgba(204, 0, 0, 0.4) 0%,
      rgba(204, 0, 0, 0.6) 100%);
  }

  /* Reset all hero elements positioning for mobile */
  .hero-element {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin: 0 auto !important;
    padding: 0 20px;
  }

  /* Create a flex container for hero content */
  .hero-banner-modern {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
  }

  /* Hero title mobile */
  .hero-title-element {
    order: 1;
    margin-bottom: 15px !important;
  }

  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 !important;
  }

  /* Hero highlight mobile */
  .hero-highlight-element {
    order: 2;
    margin-bottom: 15px !important;
  }

  .hero-highlight {
    font-size: 1.5rem !important;
    color: var(--color-amarillo-aragon) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 700 !important;
  }

  /* Hero description mobile */
  .hero-description-element {
    order: 3;
    margin-bottom: 25px !important;
  }

  .hero-description {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin: 0 auto;
  }

  /* Hero buttons mobile */
  .hero-btn1-element,
  .hero-btn2-element {
    order: 4;
    margin-bottom: 10px !important;
    display: block !important;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    display: inline-block !important;
    padding: 12px 30px !important;
    font-size: 1rem !important;
    width: auto !important;
    min-width: 180px;
    text-align: center;
  }

  /* Hide scroll indicator on mobile */
  .scroll-indicator {
    display: none;
  }
}

/* ===========================
   DUAL MODE RESPONSIVE
   =========================== */
.hero-banner-modern[data-responsive-mode="dual"] {
  /* Variables for dual mode */
  --mobile-hero-height: 50vh;
  --mobile-text-align: center;
}

@media (max-width: 768px) {
  .hero-banner-modern[data-responsive-mode="dual"] {
    height: var(--mobile-hero-height) !important;
    min-height: 350px;
  }

  .hero-banner-modern[data-responsive-mode="dual"] .hero-element {
    text-align: var(--mobile-text-align) !important;
  }
}

/* ===========================
   SMALL MOBILE DEVICES
   =========================== */
@media (max-width: 480px) {
  /* Header adjustments for small screens */
  .header-flex {
    padding: 0 10px;
  }

  .logo-img {
    height: 35px;
  }

  .btn-afiliate,
  .menu-burger {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .btn-afiliate .burger-label {
    display: none;
  }

  .btn-afiliate .burger-icon {
    display: inline-block;
  }

  .menu-burger .burger-label {
    display: none;
  }

  /* Hero adjustments for small screens */
  .hero-banner-modern {
    height: 70vh !important;
    min-height: 450px;
    padding: 30px 15px;
  }

  .hero-title {
    font-size: 1.5rem !important;
  }

  .hero-highlight {
    font-size: 1.25rem !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 10px 25px !important;
    font-size: 0.9rem !important;
    min-width: 150px;
  }
}

/* ===========================
   LANDSCAPE MOBILE
   =========================== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-banner-modern {
    height: 80vh !important;
    min-height: 300px;
  }

  .hero-title {
    font-size: 1.5rem !important;
  }

  .hero-highlight {
    font-size: 1.25rem !important;
  }

  .hero-description {
    display: none;
  }
}

/* ===========================
   MENU OVERLAY RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .menu-overlay {
    padding: 80px 20px 20px;
  }

  .menu-close {
    top: 20px;
    right: 20px;
  }

  .menu-columns {
    flex-direction: column;
  }

  .menu-main {
    width: 100%;
    margin-bottom: 30px;
  }

  .overlay-menu {
    font-size: 1.25rem;
  }

  .menu-sidebar {
    width: 100%;
    text-align: center;
  }
}