/* ============================================
   ROOMS REELS — Frontend Styles v2.0
   Multi-video per room support
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── Container ─── */
.rr-reels-container {
  --rr-height: 100vh;
  --rr-accent: #c4a882;
  --rr-accent-light: color-mix(in srgb, var(--rr-accent) 70%, white);
  --rr-font-display: 'Cormorant Garamond', Georgia, serif;
  --rr-font-body: 'DM Sans', system-ui, sans-serif;

  /* ⚙️ Ajustable: espacio para el header fijo de tu web */
  --rr-top-offset: 0px;
  /* ⚙️ Ajustable: espacio inferior */
  --rr-bottom-offset: 0px;

  position: relative;
  z-index: 50;
  width: 100%;
  /* Fallback for older browsers */
  height: calc(100vh - var(--rr-top-offset));
  /* Modern browsers: dvh accounts for mobile browser chrome */
  height: calc(100dvh - var(--rr-top-offset));
  max-height: calc(100vh - var(--rr-top-offset));
  max-height: calc(100dvh - var(--rr-top-offset));
  overflow: hidden;
  background: #000;
  font-family: var(--rr-font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;

  /* Reset any inherited styles from theme */
  line-height: 1.4;
  color: #fff;
  font-size: 14px;
}

.rr-reels-container *,
.rr-reels-container *::before,
.rr-reels-container *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Slides Track ─── */
.rr-slides-track {
  display: flex;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.rr-slide {
  position: relative;
  min-width: 100%;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.rr-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rr-slide-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  animation: rrSlowZoom 20s ease-in-out infinite alternate;
}

.rr-slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c2620, #1a1612);
}

.rr-slide-placeholder span {
  font-family: var(--rr-font-display);
  font-size: 24px;
  color: rgba(255,255,255,0.2);
}

@keyframes rrSlowZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Cinematic gradient overlays */
.rr-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.6) 0%,
    transparent 28%,
    transparent 50%,
    rgba(0,0,0,0.65) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.rr-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0,0,0,0.25);
  z-index: 1;
  pointer-events: none;
}

/* ─── Top Layer ─── */
.rr-top-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding-top: calc(16px + var(--rr-top-offset));
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 0;
}

.rr-section-label {
  font-family: var(--rr-font-display);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
  text-align: center;
}

/* ─── Stories Bar ─── */
.rr-stories-bar {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  padding: 0 0 16px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.rr-stories-bar::-webkit-scrollbar { display: none; }

.rr-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.rr-story-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.rr-story-item.active .rr-story-ring {
  background: linear-gradient(135deg, var(--rr-accent), var(--rr-accent-light));
  box-shadow: 0 0 16px rgba(196, 168, 130, 0.3);
}

.rr-story-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  background: linear-gradient(135deg, var(--rr-accent), var(--rr-accent-light));
  transition: opacity 0.4s ease;
}

.rr-story-item:hover .rr-story-ring::before { opacity: 0.5; }
.rr-story-item.active:hover .rr-story-ring::before { opacity: 0; }

.rr-story-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.9);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
}

.rr-story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.rr-story-item:hover .rr-story-thumb img {
  transform: scale(1.1);
}

.rr-story-initial {
  font-family: var(--rr-font-display);
  font-size: 18px;
  color: rgba(255,255,255,0.4);
}

.rr-story-name {
  font-family: var(--rr-font-body);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  transition: color 0.3s ease;
  white-space: nowrap;
  text-align: center;
  text-shadow: 1px 2px 2px rgba(0,0,0,0.9) !important;
}

.rr-story-item.active .rr-story-name {
  color: rgba(255,255,255,0.9);
}

/* ─── Progress Bar ─── */
.rr-progress-bar {
  display: flex;
  gap: 3px;
  padding: 0 4px;
  margin-top: 4px;
}

.rr-progress-segment {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

/* Visual separator between room groups */
.rr-progress-segment + .rr-progress-segment[data-room-index] {
  margin-left: 0;
}
.rr-progress-segment + .rr-progress-segment:not([data-room-index]) {
  margin-left: 0;
}
.rr-progress-segment.rr-room-first {
  margin-left: 6px;
}

.rr-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
}

/* ─── Bottom Layer (NEW LAYOUT) ─── */
.rr-bottom-layer {
  position: absolute;
  bottom: var(--rr-bottom-offset);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Row: Sound (left) + Room info */
.rr-bottom-top-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.rr-room-info {
  flex: 1;
  min-width: 0;
  opacity: 0;
  transform: translateY(18px);
  animation: rrFadeUp 0.6s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rr-room-info.transitioning {
  animation: rrFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes rrFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.rr-room-name {
  font-family: var(--rr-font-display) !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  color: #fff !important;
  line-height: 1.15 !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  letter-spacing: 0.5px;
}

.rr-room-subtitle {
  font-family: var(--rr-font-body) !important;
  font-size: 12px !important;
  font-weight: 300 !important;
  color: rgba(255,255,255,0.5) !important;
  letter-spacing: 0.3px;
  line-height: 1.45 !important;
  max-width: 240px;
  margin: 0 !important;
  padding: 0 !important;
}

/* ─── Sound Button (left in row) ─── */
.rr-sound-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  outline: none;
}

.rr-sound-btn:hover { background: rgba(255,255,255,0.15); }

.rr-sound-btn svg {
  width: 17px;
  height: 17px;
  color: rgba(255,255,255,0.7);
  transition: color 0.3s ease;
}

.rr-sound-btn:hover svg { color: rgba(255,255,255,1); }

.rr-sound-btn.muted .rr-icon-muted   { display: block; }
.rr-sound-btn.muted .rr-icon-unmuted { display: none; }

.rr-sound-btn:not(.muted) .rr-icon-muted   { display: none; }
.rr-sound-btn:not(.muted) .rr-icon-unmuted { display: block; }

.rr-sound-btn:active svg { transform: scale(0.85); }

/* ─── CTA Button (compact, right-aligned) ─── */
.rr-cta-btn {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  color: #fff !important;
  font-family: var(--rr-font-body) !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1 !important;
}

.rr-cta-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
  color: #fff !important;
  text-decoration: none !important;
}

.rr-cta-btn:active { transform: scale(0.97); }

.rr-cta-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}

.rr-cta-btn:hover svg {
  transform: translateX(3px);
  opacity: 1;
}

/* ─── Flash Overlay ─── */
.rr-flash {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.rr-flash.active { opacity: 0.3; }

/* ─── Tap Zones ─── */
.rr-tap-left, .rr-tap-right {
  position: absolute;
  top: 160px;
  bottom: 160px;
  z-index: 10;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rr-tap-left { left: 0; width: 30%; }
.rr-tap-right { right: 0; width: 30%; }

/* ─── RESPONSIVE ─── */

/* Override Elementor section/column padding when wrapping the reels */
.elementor-section:has(.rr-reels-container),
.elementor-column:has(.rr-reels-container),
.elementor-widget:has(.rr-reels-container),
.elementor-widget-wrap:has(.rr-reels-container) {
  padding: 0 !important;
  margin: 0 !important;
}

.elementor-section:has(.rr-reels-container) > .elementor-container {
  max-width: 100% !important;
  padding: 0 !important;
}

/* Small phones */
@media (max-width: 380px) {
  .rr-stories-bar { gap: 10px; }
  .rr-story-ring { width: 80px; height: 80px; }
  .rr-story-name { font-size: 8.5px; }
  .rr-room-name { font-size: 24px !important; }
  .rr-room-subtitle { font-size: 11px !important; }
  .rr-cta-btn { padding: 8px 14px; font-size: 9.5px !important; }
}

/* Regular phones */
@media (max-width: 480px) {
  .rr-section-label { font-size: 11px; margin-bottom: 10px; }
}

/* Tablets and up */
@media (min-width: 768px) {
  .rr-story-ring { width: 90px; height: 90px; }
  .rr-stories-bar { gap: 20px; }
  .rr-room-name { font-size: 34px !important; }
  .rr-cta-btn { padding: 11px 22px; font-size: 11.5px !important; }
}

/* ─── Flechas de navegación — solo desktop ─── */
@media (min-width: 1024px) {

  .rr-tap-left,
  .rr-tap-right {
    width: 60px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .rr-tap-left  { left: 20px; }
  .rr-tap-right { right: 20px; }

  .rr-tap-left::after,
  .rr-tap-right::after {
    content: '';
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
  }

  .rr-tap-right::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
  }

  .rr-tap-left:hover::after,
  .rr-tap-right:hover::after {
    background-color: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
    transform: scale(1.08);
  }
}