/* ============================================
   ARQUITECTO CMS - Estilo Principal
   Sistema de variables para personalización
   ============================================ */

:root {
  --primary: #1a1a2e;
  --secondary: #c8a97e;
  --accent: #16213e;
  --text: #333333;
  --bg: #ffffff;
  --bg-alt: #f8f6f3;
  --bg-dark: #0f0f1a;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow: 0 10px 40px rgba(0,0,0,0.08);
  --shadow-hover: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 12px;
  --nav-height: 70px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

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

.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--primary);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.05rem;
  color: #888;
  max-width: 600px;
  margin-bottom: 60px;
  font-weight: 300;
}

.text-center { text-align: center; }
.text-center .section-subtitle { margin-left: auto; margin-right: auto; }

/* --- Sticky Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 30px rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar .logo {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
  transition: var(--transition);
}

.navbar.scrolled .logo { color: var(--primary); }

.navbar .logo span { color: var(--secondary); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}

.navbar.scrolled .nav-links a { color: var(--text); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: var(--transition);
}

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

.nav-links a:hover { color: var(--secondary) !important; }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 5px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 2px;
  background: #fff;
  transition: var(--transition);
  border-radius: 2px;
}

.navbar.scrolled .menu-toggle span { background: var(--primary); }

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

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-slide.active { opacity: 1; }

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26,26,46,0.85) 0%, rgba(15,15,26,0.7) 50%, rgba(26,26,46,0.6) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 40px;
  margin-top: -40px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 200;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-content h1 span { color: var(--secondary); }

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.75);
  font-weight: 300;
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 36px;
}

.btn {
  display: inline-block;
  padding: 14px 40px;
  border: 2px solid var(--secondary);
  background: transparent;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn:hover {
  background: var(--secondary);
  color: var(--primary);
}

.btn-primary {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

.btn-primary:hover {
  background: transparent;
  color: #fff;
}

.btn-sm {
  padding: 10px 28px;
  font-size: 0.75rem;
}

/* Hero Carousel Controls */
.hero-controls {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.hero-dot.active { background: var(--secondary); transform: scale(1.3); }
.hero-dot:hover { background: rgba(255,255,255,0.6); }

.hero-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 3;
  pointer-events: none;
}

.hero-arrow {
  pointer-events: all;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-arrow:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
}

/* --- About / Bio Section --- */
.about {
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: var(--transition);
}

.about-image:hover img { transform: scale(1.03); }

.about-image::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--secondary), transparent);
  opacity: 0.1;
}

.about-content .section-title { margin-bottom: 24px; }

.about-content p {
  margin-bottom: 20px;
  color: #666;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.9;
}

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

.stat-item {
  text-align: center;
  padding: 20px 10px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.service-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 40px 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--secondary);
  transition: var(--transition);
}

.service-card:hover::before { height: 100%; }

.service-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow);
  transform: translateY(-6px);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
  color: var(--secondary);
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--secondary);
  color: #fff;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 12px;
}

.service-card p {
  color: #888;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* --- Portfolio Section --- */
.portfolio {
  background: var(--bg-alt);
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
  justify-content: center;
}

.filter-btn {
  padding: 10px 24px;
  border: 1px solid #ddd;
  background: transparent;
  color: #888;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  border-radius: 30px;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.portfolio-item:hover img { transform: scale(1.08); }

.portfolio-item-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(26,26,46,0.9) 0%, rgba(26,26,46,0.1) 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  opacity: 0;
  transition: var(--transition);
}

.portfolio-item:hover .portfolio-item-overlay { opacity: 1; }

.portfolio-item-overlay h3 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.portfolio-item-overlay span {
  color: var(--secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content {
  background: #fff;
  max-width: 900px;
  width: 95%;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin: 40px auto;
  animation: modalFadeIn 0.4s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--secondary); }

.modal-gallery {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-gallery-prev, .modal-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.modal-gallery-prev {
  left: 20px;
}

.modal-gallery-next {
  right: 20px;
}

.modal-gallery-prev:hover, .modal-gallery-next:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
}

.modal-body {
  padding: 40px;
}

.modal-body h2 {
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--primary);
  margin-bottom: 8px;
}

.modal-body .modal-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.modal-meta span {
  font-size: 0.85rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-meta span strong { color: var(--text); }

.modal-body .description {
  color: #666;
  font-weight: 300;
  line-height: 1.9;
  font-size: 1rem;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.contact-info h3 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 20px;
}

.contact-info > p {
  color: #888;
  font-weight: 300;
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-detail-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--bg-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 1rem;
}

.contact-detail h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.contact-detail p {
  font-size: 0.9rem;
  color: #888;
  font-weight: 300;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 1.1rem;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

/* Contact Form */
.contact-form {
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #f0f0f0;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  transition: var(--transition);
  background: #fafafa;
  outline: none;
}

.form-control:focus {
  border-color: var(--secondary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,169,126,0.1);
}

textarea.form-control { resize: vertical; min-height: 120px; }

.form-status {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: none;
}

.form-status.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.form-status.error { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 32px 24px;
  font-size: 0.85rem;
  font-weight: 300;
}

.footer a { color: var(--secondary); }
.footer a:hover { color: #fff; }

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Responsive --- */
@media (max-width: 992px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  
  .menu-toggle { display: flex; }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--primary);
    flex-direction: column;
    padding: 20px 40px 40px;
    gap: 24px;
    transition: right 0.4s ease;
    align-items: flex-start;
  }
  
  .nav-links.active { right: 0; }
  
  .mobile-menu-close-container { display: flex !important; }
  .mobile-social-links { display: flex !important; }
  
  .nav-links a { color: rgba(255,255,255,0.9) !important; font-size: 1rem; width: 100%; }
  .navbar.scrolled .nav-links a { color: rgba(255,255,255,0.9) !important; }
  
  .hero-content { padding: 0 20px; }
  .hero-arrows { display: none; }
  
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  
  .section { padding: 60px 0; }
  .modal-gallery { height: 250px; }
  
  /* Ensure modal close button is highly visible on mobile */
  .modal-close {
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(0,0,0,0.8) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 100 !important;
  }
  
  .modal-body { padding: 24px; }
  .contact-form { padding: 24px; }
  
  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-item { padding: 16px 8px; }
  .stat-number { font-size: 1.5rem; }
  
  .about-image img { height: 300px; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 2rem; }
  .btn { padding: 12px 28px; font-size: 0.75rem; }
  .portfolio-filters { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 8px; }
  .filter-btn { white-space: nowrap; }
}

/* Smooth scrollbar for modal */
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 3px; }
