/* =============================================
   DR. SMILE - RETRO MODERNO 70s
   Mostaza, Terracota, Verde Oliva
   ============================================= */

/* CSS Custom Properties */
:root {
  --mostaza: #D4A234;
  --mostaza-light: #E8C66A;
  --mostaza-dark: #B08520;
  --terracota: #C25E3A;
  --terracota-light: #D97B5A;
  --terracota-dark: #9E4425;
  --oliva: #5E7A3B;
  --oliva-light: #7A9A54;
  --oliva-dark: #45592B;
  --crema: #FFF8EC;
  --crema-dark: #F5ECD8;
  --oscuro: #2C2416;
  --texto: #3D3425;
}

/* =============================================
   BASE & TYPOGRAPHY
   ============================================= */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--mostaza);
  color: var(--oscuro);
}

/* =============================================
   NAVIGATION
   ============================================= */

#main-nav {
  background: rgba(255, 248, 236, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#main-nav.scrolled {
  background: rgba(255, 248, 236, 0.95);
  box-shadow: 0 4px 30px rgba(44, 36, 22, 0.1);
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero-section {
  background:
    radial-gradient(circle at 20% 80%, rgba(212, 162, 52, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(194, 94, 58, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(94, 122, 59, 0.05) 0%, transparent 70%);
}

/* Rotated title */
.hero-rotated-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  height: fit-content;
}

/* Hero image frame - retro rounded shape */
.hero-image-frame {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4/3;
  border-radius: 60px 20px 60px 20px;
  overflow: hidden;
  box-shadow:
    0 25px 50px rgba(44, 36, 22, 0.2),
    0 0 0 6px var(--mostaza),
    0 0 0 12px rgba(212, 162, 52, 0.2);
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .hero-image-frame {
    margin: 0;
    margin-left: auto;
  }
}

/* Floating badge */
.hero-float-badge {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Hero CTA button glow */
.hero-cta {
  position: relative;
}

.hero-cta::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--terracota), var(--mostaza));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-cta:hover::after {
  opacity: 0.3;
}

/* =============================================
   RETRO DECORATIVE ELEMENTS
   ============================================= */

.retro-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.retro-circle-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 162, 52, 0.12) 0%, transparent 70%);
  top: -100px;
  right: -100px;
}

.retro-circle-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(94, 122, 59, 0.1) 0%, transparent 70%);
  bottom: -50px;
  left: -80px;
}

.retro-circle-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(194, 94, 58, 0.08) 0%, transparent 70%);
  top: -150px;
  left: -150px;
}

.retro-circle-dark-1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(212, 162, 52, 0.08) 0%, transparent 70%);
  top: -100px;
  right: -80px;
}

.retro-circle-dark-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(194, 94, 58, 0.06) 0%, transparent 70%);
  bottom: -80px;
  left: -60px;
}

/* Retro arc decoration */
.retro-arc {
  position: absolute;
  width: 600px;
  height: 600px;
  border: 3px solid rgba(212, 162, 52, 0.1);
  border-radius: 50%;
  bottom: -300px;
  right: -200px;
  pointer-events: none;
}

/* Retro dots background pattern */
.retro-dots-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(212, 162, 52, 0.06) 1.5px, transparent 1.5px);
  background-size: 30px 30px;
  pointer-events: none;
}

/* Retro pattern overlay for star service & CTA */
.retro-pattern-overlay {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.retro-pattern-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* =============================================
   STAR SERVICE CARD
   ============================================= */

.star-service-card {
  position: relative;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.star-service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(194, 94, 58, 0.3);
}

/* =============================================
   ABOUT SECTION
   ============================================= */

.about-image-container {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  max-height: 500px;
}

.about-image-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid rgba(212, 162, 52, 0.3);
  border-radius: 24px;
  pointer-events: none;
}

/* =============================================
   TESTIMONIALS
   ============================================= */

.testimonial-card {
  transition: transform 0.4s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
}

/* =============================================
   GALLERY
   ============================================= */

.gallery-item {
  position: relative;
  overflow: hidden;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(44, 36, 22, 0.4) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* =============================================
   LIGHTBOX
   ============================================= */

#lightbox {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox-img {
  transition: transform 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  transform: scale(1.15);
}

.lightbox-prev,
.lightbox-next {
  transition: transform 0.2s ease, color 0.2s ease;
}

/* =============================================
   FAQ ACCORDION
   ============================================= */

.faq-item {
  transition: box-shadow 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 8px 30px rgba(44, 36, 22, 0.1);
}

.faq-question {
  cursor: pointer;
  transition: color 0.3s ease;
}

.faq-question:hover span {
  color: var(--terracota);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-bottom: 0;
}

/* =============================================
   CHAT WIDGET
   ============================================= */

/* Pulse animation - only transform and opacity */
.chat-pulse {
  animation: chatPulse 2.5s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

/* Remove pulse when chat is open */
#chat-widget.open .chat-pulse {
  animation: none;
}

/* Chat panel animation */
#chat-panel {
  transform-origin: bottom right;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#chat-panel.visible {
  display: flex;
  transform: scale(1);
  opacity: 1;
}

/* Chat tooltip */
#chat-tooltip {
  pointer-events: none;
}

#chat-widget.open #chat-tooltip {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Chat messages */
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: msgSlide 0.3s ease;
}

@keyframes msgSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg-user {
  background: var(--terracota);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-msg-assistant {
  background: var(--crema-dark);
  color: var(--oscuro);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.chat-msg-assistant a {
  color: var(--terracota);
  text-decoration: underline;
}

.chat-msg-assistant a:hover {
  color: var(--terracota-dark);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  background: var(--oscuro);
  opacity: 0.3;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 0.8; }
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveals for grid children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal:nth-child(6) { transition-delay: 0.5s; }
.reveal:nth-child(7) { transition-delay: 0.6s; }
.reveal:nth-child(8) { transition-delay: 0.7s; }

/* =============================================
   FORM ELEMENTS
   ============================================= */

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(194, 94, 58, 0.15);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232C2416' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

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

@media (max-width: 640px) {
  .hero-image-frame {
    border-radius: 30px 10px 30px 10px;
    box-shadow:
      0 15px 30px rgba(44, 36, 22, 0.15),
      0 0 0 4px var(--mostaza),
      0 0 0 8px rgba(212, 162, 52, 0.15);
  }

  .hero-float-badge {
    animation: none;
  }

  #chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  #chat-tooltip {
    display: none;
  }

  .retro-circle,
  .retro-arc {
    display: none;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .retro-arc {
    width: 400px;
    height: 400px;
  }
}

/* =============================================
   SCROLLBAR STYLING
   ============================================= */

#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: var(--crema-dark);
  border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--mostaza);
}

/* =============================================
   MAP RESPONSIVE
   ============================================= */

footer iframe {
  width: 100%;
  border-radius: inherit;
}

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

@media print {
  #chat-widget,
  #main-nav,
  #lightbox {
    display: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}