/* ═══════════════════════════════════════════════════════════════════
   DIFORTUNA STUDIO — Estilos Globales
   ═══════════════════════════════════════════════════════════════════ */

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F5F5F2;
  color: #1A1A1A;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #8B7355; color: #F5F5F2; }

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* Typography */
.serif { font-family: 'Playfair Display', Georgia, serif; }
.sans { font-family: 'Inter', -apple-system, sans-serif; }

/* Para DIFOR usamos Cormorant */
.difor-page .serif { font-family: 'Cormorant Garamond', Georgia, serif; }

/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  transition: all 0.4s ease;
}

nav.scrolled {
  background: rgba(245,245,242,0.95);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  color: #1A1A1A;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-link {
  position: relative;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #1A1A1A;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #8B7355;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after { width: 100%; }

.nav-link.active { color: #8B7355; }

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  border: 1px solid #1A1A1A;
  background: transparent;
  color: #1A1A1A;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary:hover {
  background: #1A1A1A;
  color: #F5F5F2;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #8B7355;
  background: transparent;
  color: #8B7355;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary:hover {
  background: #8B7355;
  color: #F5F5F2;
}

.btn-light {
  border-color: #F5F5F2;
  color: #F5F5F2;
}

.btn-light:hover {
  background: #F5F5F2;
  color: #1A1A1A;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 48px;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
}

.section {
  padding: 120px 48px;
}

.section-dark {
  background: #1A1A1A;
  color: #F5F5F2;
}

.section-light {
  background: #fff;
}

.section-warm {
  background: #F0EDE8;
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

/* ═══════════════════════════════════════════════════════════════════
   TYPOGRAPHY UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #999;
  display: block;
  margin-bottom: 24px;
}

.label-accent { color: #8B7355; }

.title-xl {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
}

.title-lg {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
}

.title-md {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
}

.tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 3vw, 28px);
  font-style: italic;
  color: #8B7355;
}

.body-text {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.9;
  color: #666;
  font-weight: 300;
}

.body-text-light {
  color: rgba(255,255,255,0.7);
}

/* ═══════════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════════ */

/* Horizontal Line */
.h-line {
  width: 60px;
  height: 1px;
  background: #1A1A1A;
  opacity: 0.3;
}

.h-line-light {
  background: #F5F5F2;
}

.h-line-center {
  margin: 0 auto;
}

/* Quote */
.quote {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 4vw, 42px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
}

/* Service Item */
.service-item {
  border-top: 1px solid rgba(26,26,26,0.1);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 40px;
  align-items: start;
  transition: all 0.4s ease;
}

.service-item:hover {
  padding-left: 20px;
  border-top-color: #8B7355;
}

.service-num {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #8B7355;
  letter-spacing: 1px;
}

.service-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 12px;
}

.service-desc {
  font-size: 15px;
  line-height: 1.7;
  color: #666;
  font-weight: 300;
  max-width: 500px;
}

/* Project Card */
.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-info {
  position: absolute;
  bottom: 32px;
  left: 32px;
  color: #fff;
}

.project-category {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
  display: block;
  margin-bottom: 8px;
}

.project-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
}

/* Service Card (for servicios page) */
.service-card {
  background: #fff;
  padding: 48px;
  transition: all 0.4s ease;
  border: 1px solid transparent;
  height: 100%;
}

.service-card:hover {
  border-color: #8B7355;
  transform: translateY(-4px);
}

.service-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 16px;
}

.service-card p {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  font-weight: 300;
  margin-bottom: 24px;
}

/* Includes List */
.includes-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26,26,26,0.06);
}

.includes-item:last-child {
  border-bottom: none;
}

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8B7355;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.check-icon svg {
  width: 10px;
  height: 8px;
}

.includes-item span {
  font-size: 13px;
  color: #666;
}

/* Price Tag */
.price-tag {
  display: inline-block;
  padding: 8px 16px;
  background: #F0EDE8;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
}

/* Process Step */
.process-step {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(26,26,26,0.1);
}

.process-step:last-child {
  border-bottom: none;
}

.step-number {
  width: 48px;
  height: 48px;
  border: 1px solid #8B7355;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: #8B7355;
  flex-shrink: 0;
}

.step-content h4 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 14px;
  line-height: 1.7;
  color: #666;
  font-weight: 300;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #888;
  display: block;
  margin-bottom: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid rgba(26,26,26,0.2);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1A1A1A;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-bottom-color: #1A1A1A;
}

.form-group select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.form-group textarea {
  resize: none;
  min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #1A1A1A;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(26,26,26,0.2);
  background: #FAFAF8;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1A1A1A;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1A1A1A;
}

/* Contact and form page specific responsive */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }
  
  .contact-form {
    padding: 40px 32px !important;
  }
  
  .contact-info-item {
    margin-bottom: 32px !important;
  }
}

@media (max-width: 640px) {
  .contact-form {
    padding: 32px 24px !important;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .btn-primary {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
    font-size: 14px;
  }
}

/* Specific improvements for text blocks and readability */
@media (max-width: 640px) {
  /* Hero sections text improvements */
  .hero p, .section p {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  
  /* Service items better spacing */
  .service-item h3 {
    font-size: 22px !important;
    margin-bottom: 12px !important;
  }
  
  .service-item p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
  
  /* Better button styles for mobile */
  .btn-secondary {
    padding: 14px 24px;
    font-size: 12px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) {
  .piece-card:hover img,
  .project-item:hover img {
    transform: none; /* Disable hover effects on touch devices */
  }
  
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
  
  .nav-link:hover::after {
    width: 0; /* Disable hover underlines on touch */
  }
}

/* Loading and performance optimizations for mobile */
@media (max-width: 768px) {
  /* Reduce animation complexity on mobile */
  .fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Simpler transitions on mobile */
  * {
    transition-duration: 0.2s !important;
  }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  .mobile-nav-overlay {
    /* iOS Safari viewport bug fix */
    height: -webkit-fill-available;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  textarea,
  select {
    /* Disable iOS zoom on inputs */
    font-size: 16px !important;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */

footer {
  padding: 60px 48px;
  border-top: 1px solid rgba(26,26,26,0.1);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-style: italic;
  display: block;
  margin-bottom: 8px;
}

.footer-sub {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 12px;
}

.footer-copy {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
}

/* Footer Dark */
footer.footer-dark {
  background: #1A1A1A;
  color: #F5F5F2;
  border-top: none;
}

footer.footer-dark .footer-sub,
footer.footer-dark .footer-copy {
  color: rgba(255,255,255,0.5);
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* Scroll indicator animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

.scroll-indicator {
  animation: float 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: #1A1A1A;
  margin: 2px 0;
  transition: 0.3s;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(245,245,242,0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-overlay .nav-link {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

/* Large tablets */
@media (max-width: 1024px) {
  .container { max-width: 100%; padding: 0 40px; }
  .container-narrow { max-width: 100%; padding: 0 40px; }
  .container-wide { max-width: 100%; padding: 0 40px; }
  
  .section { padding: 100px 40px; }
  nav { padding: 24px 40px; }
  
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* Medium screens / Tablets */
@media (max-width: 968px) {
  nav { padding: 20px 32px; }
  .nav-links { gap: 24px; }
  
  .section { padding: 80px 32px; }
  .container, .container-narrow, .container-wide { padding: 0 32px; }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  
  .service-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Typography adjustments for tablets */
  .title-xl { font-size: 56px; line-height: 1.1; }
  .title-lg { font-size: 36px; line-height: 1.2; }
  .title-md { font-size: 28px; line-height: 1.3; }
  
  /* Hero section adjustments */
  .hero { padding: 100px 32px 60px !important; }
  
  /* DIFOR teaser section */
  #difor-teaser {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  
  #difor-teaser .section-warm {
    padding: 60px 32px !important;
  }
}

/* Small tablets / Large phones */
@media (max-width: 768px) {
  /* Navigation for mobile */
  .nav-links { display: none; }
  .mobile-menu-toggle { display: flex; }
  
  .section { padding: 60px 28px; }
  .container, .container-narrow, .container-wide { padding: 0 28px; }
  
  .hero {
    padding: 80px 28px 40px !important;
    min-height: 70vh !important;
  }
  
  .title-xl { font-size: 44px; line-height: 1.1; }
  .title-lg { font-size: 32px; line-height: 1.2; }
  .title-md { font-size: 24px; line-height: 1.3; }
  
  /* Grid adjustments */
  .grid-2 { gap: 40px; }
  .grid-3, .grid-4 { gap: 32px; }
  
  /* Service items */
  .service-item { padding: 32px 24px; }
}

/* Mobile phones */
@media (max-width: 640px) {
  nav { padding: 16px 24px; }
  .nav-logo { font-size: 20px; }
  
  .section { padding: 50px 24px; }
  .container, .container-narrow, .container-wide { padding: 0 24px; }
  
  .hero {
    padding: 70px 24px 30px !important;
    min-height: 60vh !important;
  }
  
  .title-xl { font-size: 36px; line-height: 1.1; }
  .title-lg { font-size: 28px; line-height: 1.2; }
  .title-md { font-size: 22px; line-height: 1.3; }
  .title-sm { font-size: 18px; line-height: 1.4; }
  
  /* Buttons */
  .btn-primary, .btn-secondary {
    padding: 12px 24px;
    font-size: 11px;
    letter-spacing: 1px;
  }
  
  /* Grid adjustments */
  .grid-2, .grid-3, .grid-4 { gap: 24px; }
  
  /* Footer */
  footer { padding: 40px 24px; }
  footer .container { flex-direction: column; text-align: center; gap: 20px; }
  
  /* Service items */
  .service-item { padding: 24px 20px; }
  
  /* DIFOR teaser adjustments */
  #difor-teaser .section-warm {
    padding: 40px 24px !important;
  }
  
  /* Project grid specific */
  .project-grid { gap: 20px; }
  .project-item { margin-bottom: 20px; }
}

/* Extra small phones */
@media (max-width: 480px) {
  .nav-logo { font-size: 18px; }
  
  .section { padding: 40px 20px; }
  .container, .container-narrow, .container-wide { padding: 0 20px; }
  
  .hero {
    padding: 60px 20px 20px !important;
    min-height: 50vh !important;
  }
  
  .title-xl { font-size: 32px; }
  .title-lg { font-size: 24px; }
  .title-md { font-size: 20px; }
  
  .btn-primary, .btn-secondary {
    padding: 10px 20px;
    font-size: 10px;
  }
  
  #difor-teaser .section-warm {
    padding: 30px 20px !important;
  }
}
