/* ============================================
   ROMAPAINT DESIGN SYSTEM - MINIMALISTA INDUSTRIAL
   Versión 1.0 - 2025
   ============================================ */

/* Import Google Fonts - Poppins for headings (matching logo), Inter for body */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   ROOT VARIABLES - Typography System
   ============================================ */
:root {
  /* Font Families - Matching logo style */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Font Sizes - Responsive Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
}

/* ============================================
   ROOT VARIABLES - Color Palette
   ============================================ */
:root {
  /* Primary Taupe/Brown - Elegant & Professional (from logo) */
  --color-primary-50: #F7F5F3;
  --color-primary-100: #E8E5E1;
  --color-primary-200: #D4CEC7;
  --color-primary-300: #BEB5AB;
  --color-primary-400: #ADA090;
  --color-primary-500: #9B8B7E;  /* Main Taupe from logo */
  --color-primary-600: #8A7A6D;
  --color-primary-700: #79695C;
  --color-primary-800: #68584B;
  --color-primary-900: #57483A;

  /* Warm Grays - Cohesive with taupe palette */
  --color-gray-50: #FAFAF9;
  --color-gray-100: #F5F5F4;
  --color-gray-200: #E7E5E4;
  --color-gray-300: #D6D3D1;
  --color-gray-400: #A8A29E;
  --color-gray-500: #78716C;
  --color-gray-600: #57534E;
  --color-gray-700: #44403C;
  --color-gray-800: #292524;
  --color-gray-900: #1C1917;

  /* Secondary Beige - Complementary warm tones */
  --color-secondary-400: #D4C4B0;
  --color-secondary-500: #C4B5A0;
  --color-secondary-600: #B3A48F;
  --color-secondary-700: #A2937E;

  /* Accent Gold/Caramel for CTAs - Warm & Inviting */
  --color-accent-400: #E5B685;
  --color-accent-500: #D4A574;
  --color-accent-600: #C39463;
  --color-accent-700: #B28352;

  /* Success/WhatsApp Green - Mantener */
  --color-success-400: #34D399;
  --color-success-500: #25D366;
  --color-success-600: #20BA5A;

  /* Neutral Backgrounds - Warm whites */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #FAFAF9;
  --color-bg-tertiary: #F5F5F4;

  /* Shadows - Warm elevation system with Taupe tint */
  --shadow-xs: 0 1px 2px 0 rgba(155, 139, 126, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(155, 139, 126, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(155, 139, 126, 0.1), 0 2px 4px -1px rgba(155, 139, 126, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(155, 139, 126, 0.1), 0 4px 6px -2px rgba(155, 139, 126, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(155, 139, 126, 0.1), 0 10px 10px -5px rgba(155, 139, 126, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(155, 139, 126, 0.25);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

/* Apply typography to body */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-gray-900);
}

/* Headings - Using Poppins to match logo */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: 0.02em;
  color: var(--color-gray-900);
}

/* ============================================
   BUTTON SYSTEM - Industrial Style
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: var(--font-primary);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
  background: var(--color-primary-500);
  color: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--color-primary-600);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* WhatsApp Button */
.btn-whatsapp {
  background: var(--color-success-500);
  color: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
}

.btn-whatsapp:hover {
  background: var(--color-success-600);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
  padding: 1rem 2rem;
}

.btn-outline:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-400);
}

.btn-outline:active {
  background: var(--color-gray-100);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-accent-500);
  color: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background: var(--color-accent-600);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Button sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 1.25rem 2.5rem;
  font-size: var(--text-lg);
}

/* CTA Buttons - Prominent call-to-action */
.btn-cta {
  background: var(--color-accent-500);
  color: white;
  padding: 1.25rem 2.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 139, 139, 0.3);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.btn-cta:hover {
  background: var(--color-accent-600);
  box-shadow: 0 8px 20px rgba(0, 139, 139, 0.4);
  transform: translateY(-2px);
}

.btn-cta:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 139, 139, 0.2);
}

.btn-cta-large {
  background: var(--color-accent-500);
  color: white;
  padding: 1.5rem 3rem;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 139, 139, 0.4);
  border-radius: 0.875rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-cta-large:hover {
  background: var(--color-accent-600);
  box-shadow: 0 12px 32px rgba(0, 139, 139, 0.5);
  transform: translateY(-3px);
}

.btn-cta-large:active {
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(0, 139, 139, 0.3);
}

/* ============================================
   CARD SYSTEM - Industrial with subtle borders
   ============================================ */
.card {
  background: var(--color-bg-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--color-gray-300);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-gray-200);
}

/* Card variants */
.card-flat {
  box-shadow: none;
  border: 1px solid var(--color-gray-200);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  border: none;
}

/* ============================================
   FORM SYSTEM
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-gray-300);
  border-radius: 0.5rem;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  transition: all 0.2s ease;
  background: var(--color-bg-primary);
  color: var(--color-gray-900);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--color-gray-400);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-gray-400);
}

/* Error state */
.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: var(--color-primary-500);
}

.form-error-message {
  display: block;
  color: var(--color-primary-500);
  font-size: var(--text-sm);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Success state */
.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: var(--color-success-500);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary-500);
  color: white;
  padding: 1rem 2rem;
  z-index: 10000;
  transition: top 0.3s;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}

.skip-to-content:focus {
  top: 0;
}

/* Improved contrast for text */
.text-muted {
  color: var(--color-gray-600);
}

/* Link states */
a:focus-visible {
  outline: 2px solid var(--color-accent-500);
  outline-offset: 4px;
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Portfolio animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-item {
  animation: fadeInUp 0.5s ease forwards;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Margin utilities */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* Padding utilities */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Container */
.container-narrow {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Screen reader only - Hide visually but keep for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
  /* Adjust button padding for mobile */
  .btn {
    padding: 0.875rem 1.5rem;
  }

  .btn-lg {
    padding: 1rem 2rem;
  }

  /* Adjust card padding for mobile */
  .card-body,
  .card-header,
  .card-footer {
    padding: 1rem;
  }
}

/* ============================================
   CARD ENHANCEMENTS
   ============================================ */

/* Card with accent border top */
.card-accent {
  border-top: 4px solid var(--color-accent-500);
}

/* Interactive card with gradient animation */
.card-interactive {
  position: relative;
  overflow: hidden;
}

.card-interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent-500), var(--color-secondary-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease, left 0.5s ease;
}

.card-interactive:hover::before {
  left: 0;
  transform: scaleX(1);
}

/* CTA Section - Large background sections */
.cta-section {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700));
  padding: 4rem 2rem;
  border-radius: 1.5rem;
  color: white;
  box-shadow: var(--shadow-2xl);
}

.cta-section h2,
.cta-section h3 {
  color: white;
}

/* ============================================
   BEFORE/AFTER SLIDER COMPONENT
   ============================================ */

.before-after-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  cursor: col-resize;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  user-select: none;
  -webkit-user-select: none;
  aspect-ratio: 4/3;
}

.before-after-container.ba-dragging {
  cursor: grabbing;
}

/* Before image (base layer) */
.ba-before {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ba-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* After image (clipped layer) */
.ba-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.ba-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slider bar */
.ba-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Slider handle */
.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
}

.ba-handle-circle {
  width: 48px;
  height: 48px;
  background: var(--color-accent-500);
  border: 4px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.before-after-container:hover .ba-handle-circle,
.ba-dragging .ba-handle-circle {
  background: var(--color-accent-600);
  transform: scale(1.1);
}

/* Before/After labels */
.ba-label {
  position: absolute;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0.5rem;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ba-label-before {
  left: 1rem;
}

.ba-label-after {
  right: 1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .ba-handle-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .ba-label {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .cta-section {
    padding: 3rem 1.5rem;
    border-radius: 1rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .btn,
  .skip-to-content {
    display: none;
  }
}
