/* ============================================
   ROOMTY - Responsive Styles
   ============================================ */

/* Mobile First Approach */

/* Extra small devices (phones, 320px and up) - iPhone SE, Android pequeños */
@media (min-width: 320px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .hero h1 {
    font-size: var(--font-size-4xl);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .hero-ctas {
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
  }
  
  .hero-ctas .btn {
    width: 100%;
  }
  
  .logo img {
    height: 2rem;
  }
  
  .nav {
    height: 3.5rem;
    padding: 0 var(--spacing-md);
  }
  
  .mobile-menu-btn {
    padding: var(--spacing-xs);
  }
  
  .mobile-menu-btn svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .btn {
    font-size: var(--font-size-sm);
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .btn-lg {
    font-size: var(--font-size-base);
    padding: var(--spacing-md) var(--spacing-lg);
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
  
  h3 {
    font-size: var(--font-size-xl);
  }
  
  .social-proof-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  .social-proof-stat-value {
    font-size: var(--font-size-2xl);
  }
  
  .social-proof-stat-label {
    font-size: var(--font-size-xs);
  }
  
  .trust-grid,
  .how-it-works-grid,
  .funnel-grid,
  .inventory-grid,
  .benefits-grid,
  .testimonials-grid,
  .social-proof-images,
  .app-download-grid,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .app-store-badges {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
  }
  
  .app-store-badges img {
    max-width: 150px;
    height: auto;
  }
  
  .seo-links-box {
    padding: var(--spacing-md);
  }
  
  .seo-links {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .seo-link {
    width: 100%;
    text-align: center;
  }
  
  .form-container {
    padding: var(--spacing-md);
  }
  
  .form-group {
    margin-bottom: var(--spacing-md);
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  textarea,
  select {
    font-size: 16px; /* Previene zoom en iOS */
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

/* Small devices (phones, 375px and up) - iPhone 6/7/8, iPhone X/11/12/13 */
@media (min-width: 375px) {
  .hero h1 {
    font-size: var(--font-size-5xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
  }
  
  .logo img {
    height: 2.25rem;
  }
  
  .nav {
    height: 4rem;
  }
  
  .social-proof-stat-value {
    font-size: var(--font-size-3xl);
  }
  
  .social-proof-stat-label {
    font-size: var(--font-size-sm);
  }
}

/* Medium-small devices (phones, 414px and up) - iPhone Plus, Android grandes */
@media (min-width: 414px) {
  .hero h1 {
    font-size: var(--font-size-5xl);
  }
  
  .hero-ctas {
    flex-direction: row;
    gap: var(--spacing-md);
  }
  
  .hero-ctas .btn {
    width: auto;
    flex: 1;
  }
  
  .social-proof-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .app-store-badges {
    flex-direction: row;
    justify-content: center;
  }
}

/* Small devices (landscape phones, 640px and up) */
@media (min-width: 640px) {
  .hero h1 {
    font-size: var(--font-size-6xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-2xl);
  }
  
  .hero-ctas {
    flex-direction: row;
  }
  
  .hero-ctas .btn {
    width: auto;
  }
  
  .logo img {
    height: 3rem;
  }
  
  .social-proof-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .social-proof-stat-value {
    font-size: var(--font-size-4xl);
  }
  
  .social-proof-stat-label {
    font-size: var(--font-size-base);
  }
  
  .app-store-badges {
    flex-direction: row;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  
  .nav-ctas {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: none;
  }
  
  .mobile-menu {
    display: none !important;
  }
  
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .how-it-works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .step-connector {
    display: block;
    position: absolute;
    top: 50%;
    right: -1rem;
    width: 2rem;
    height: 2px;
    background-color: var(--roomty-green-medium);
    transform: translateY(-50%);
  }
  
  .funnel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .social-proof-images {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .app-download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .app-mockup-secondary {
    display: block;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-stats {
    font-size: var(--font-size-base);
  }
  
  /* Investors & Agencies Section - Tablet */
  .investors-agencies-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .shared-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cta-buttons {
    flex-direction: row;
  }
  
  /* Hero Container - Tablet Layout (60/40) */
  .hero-container {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
  }
  
  .hero-content {
    text-align: left;
    max-width: none;
  }
  
  .hero-image-wrapper {
    max-width: 100%;
  }
  
  .hero-image {
    border-radius: 20px;
  }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
  .hero h1 {
    font-size: var(--font-size-7xl);
  }
  
  /* Hero Container - Desktop Layout (50/50) */
  .hero-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    padding: 6rem var(--spacing-xl);
  }
  
  .hero-content {
    text-align: left;
    padding-right: var(--spacing-xl);
  }
  
  .hero-image-wrapper {
    max-width: 100%;
  }
  
  .hero-image {
    border-radius: 24px;
  }
  
  .hero-stats {
    justify-content: flex-start;
  }
  
  .hero-ctas {
    justify-content: flex-start;
  }
  
  /* Investors & Agencies Section - Desktop */
  .investors-agencies-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
  }
  
  .shared-benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .inventory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .mobile-menu-btn,
  .btn {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --roomty-green: #6B8E23;
    --roomty-yellow: #B8860B;
    --roomty-dark: #000000;
  }
  
  .card,
  .step-card,
  .funnel-card,
  .space-card {
    border: 2px solid var(--roomty-dark);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* SEO Links Accordion Responsive */
@media (max-width: 768px) {
  .seo-links-header {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
  }
  
  .seo-links-content {
    padding-left: var(--spacing-md) !important;
    padding-right: var(--spacing-md) !important;
  }
  
  .seo-links {
    gap: var(--spacing-sm);
  }
  
  .seo-link {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
  }
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
  /* Ensure touch targets are at least 44x44px */
  .btn,
  .seo-link,
  .nav-links a,
  .mobile-menu a {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Improve text readability */
  body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Improve form inputs on mobile */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  textarea,
  select,
  .form-input,
  .form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: var(--radius-md);
    font-size: 16px !important; /* Previene zoom automático en iOS */
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Improve form container on mobile */
  .form-container {
    margin: var(--spacing-md);
    max-width: calc(100% - 2 * var(--spacing-md));
  }
  
  .form-group-row {
    grid-template-columns: 1fr !important;
  }
  
  /* Improve checkbox and radio on mobile */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
    margin-right: var(--spacing-sm);
  }
  
  /* Improve button appearance on mobile */
  .btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Improve image loading on mobile */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Better spacing for mobile sections */
  section {
    padding: var(--spacing-xl) 0;
  }
  
  /* Improve card spacing on mobile */
  .card,
  .step-card,
  .funnel-card,
  .space-card,
  .testimonial-card {
    margin-bottom: var(--spacing-md);
  }
  
  /* Improve header on mobile */
  .header {
    position: sticky;
    top: 0;
  }
  
  /* Improve footer on mobile */
  .footer {
    padding: var(--spacing-xl) 0 var(--spacing-lg);
  }
  
  .footer-grid {
    gap: var(--spacing-xl);
  }
  
  /* Improve hero section on mobile */
  .hero {
    padding: var(--spacing-2xl) 0;
    min-height: auto;
  }
  
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .hero-content {
    text-align: center;
    order: 1;
  }
  
  .hero-image-wrapper {
    order: 2;
    max-width: 100%;
    margin: 0 auto;
  }
  
  .hero-image {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
  }
  
  .hero-stats {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }
  
  /* Investors & Agencies Section - Mobile */
  .investors-agencies {
    padding: var(--spacing-xl) 0;
  }
  
  .investors-agencies-header h2 {
    font-size: var(--font-size-2xl);
  }
  
  .investor-card,
  .agency-card {
    padding: var(--spacing-lg);
  }
  
  .shared-benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .investors-cta-final {
    padding: var(--spacing-lg);
  }
  
  .investors-cta-final h3 {
    font-size: var(--font-size-2xl);
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  .cta-buttons .btn {
    width: 100%;
  }
  
  /* Improve inventory cards on mobile */
  .space-card img {
    height: 200px;
  }
  
  /* Improve app download section on mobile */
  .app-download-content {
    text-align: center;
  }
  
  .app-mockups {
    justify-content: center;
    margin-top: var(--spacing-lg);
  }
  
  .app-mockup-primary img {
    max-width: 200px;
    height: auto;
  }
  
  /* Improve inventory section on mobile */
  .inventory-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
  }
  
  /* Improve trust section on mobile */
  .trust-item {
    text-align: center;
    padding: var(--spacing-md);
  }
  
  /* Improve how it works section on mobile */
  .how-it-works-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
  }
  
  /* Improve step cards on mobile */
  .step-card {
    text-align: center;
  }
  
  .step-connector {
    display: none !important;
  }
  
  /* Improve testimonials on mobile */
  .testimonial-card {
    text-align: center;
  }
  
  /* Improve footer links on mobile */
  .footer-column {
    margin-bottom: var(--spacing-lg);
  }
  
  .footer-column h3 {
    margin-bottom: var(--spacing-md);
  }
  
  .footer-column ul {
    list-style: none;
    padding: 0;
  }
  
  .footer-column li {
    margin-bottom: var(--spacing-sm);
  }
  
  .footer-column a {
    font-size: var(--font-size-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Prevent text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Improve button spacing on mobile */
  .btn-group {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  /* Improve seo-links-box on mobile */
  .seo-links-box {
    margin: var(--spacing-md);
  }
  
  .seo-links-box h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
  }
  
  .seo-links-box p {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
  }
}

/* Dark mode support (optional, for future) */
@media (prefers-color-scheme: dark) {
  /* Currently not implementing dark mode, but structure is ready */
}

