/* =========================================================================
   PETAL — NAVBAR ESTILO APPLE (Florería Roberts)
   ========================================================================= */

html {
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html.petal-scroll-locked {
  overflow-y: scroll !important;
  overscroll-behavior: none;
}

body.petal-scroll-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

:root {
  --nav-height: 80px;
  --lime: #b2ff59;
  --lime-glow: rgba(178, 255, 89, 0.45);
  --accent: #121212;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --dropdown-bg: rgba(255, 255, 255, 0.98);
}

/* ── BARRA DE PROGRESO SPA ROUTER ── */
#spa-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime), 0 0 5px var(--lime);
  z-index: 10005;
  transition: width 0.25s ease, opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}

/* ── HEADER NAVBAR FIJO (STICKY/FIXED) ── */
header.petal-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: var(--nav-height) !important;
  background-color: var(--nav-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  z-index: 9999 !important;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

header.petal-navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

/* ── CONTENEDOR PRINCIPAL ── */
.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  position: relative;
}

/* Grupo izquierdo (Hamburguesa + Logo) */
.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Logo Oficial Roberts */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  outline: none;
}

.logo img {
  height: 52px;
  max-height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.logo:hover img {
  transform: scale(1.02);
}

/* ── MENÚ DE ENLACES SUPERIORES (DESKTOP) ── */
.nav-links {
  display: flex;
  height: 100%;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 100%;
  position: static;
}

.nav-link {
  text-decoration: none;
  color: #121212;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.25s ease, text-shadow 0.25s ease;
  white-space: nowrap;
  padding: 8px 0;
  cursor: pointer;
}

/* Efecto resplandor verde juice característico de PETAL */
.nav-link:hover,
.nav-item:hover .nav-link {
  color: #000000;
  text-shadow: 0 0 10px var(--lime-glow);
}

/* ── BOTONES DE ACCIÓN (DERECHA: CARRITO Y USUARIO) ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-shrink: 0;
}

.nav-icon {
  position: relative;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #121212;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: color 0.25s ease, transform 0.2s ease, filter 0.2s ease;
  text-decoration: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-icon:hover {
  color: #000000;
  transform: scale(1.06);
  filter: drop-shadow(0 0 6px var(--lime-glow));
}

.nav-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Badge numérico de carrito */
.cart-count-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--lime);
  color: #000000;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  padding: 0 2px;
}

/* Punto indicador de sesión activa (Usuario logueado) */
.user-status-dot {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px var(--lime);
}

/* =========================================================================
   DESPLEGABLES ESTILO APPLE (Cortina sutil)
   ========================================================================= */
.dropdown-menu {
  position: absolute;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  background-color: var(--dropdown-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);

  /* Oculto por defecto */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
  z-index: 9998;
}

/* Se despliega al pasar el cursor sobre la opción */
.nav-item:hover .dropdown-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Contenido interno del submenú */
.dropdown-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 2.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.dropdown-heading {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #86868b;
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-family: 'Inter', sans-serif;
}

/* Enlaces dentro del desplegable */
.dropdown-content a {
  text-decoration: none;
  color: #121212;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
  display: inline-block;
  width: fit-content;
}

.dropdown-content a:hover {
  color: #000000;
  text-shadow: 0 0 10px var(--lime-glow);
  transform: translateX(5px);
}

/* =========================================================================
   HAMBURGUESA & MENÚ MÓVIL APPLE (<= 860px)
   ========================================================================= */
.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  width: 34px;
  height: 34px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  z-index: 10002;
  outline: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #121212;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animación a X al abrir */
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Cortina Móvil Desplegable */
.nav-mobile-curtain {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--nav-height));
  height: calc(100dvh - var(--nav-height));
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 24px 20px 40px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

.nav-mobile-curtain.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 14px;
}

.mobile-nav-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #121212;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
}

.mobile-nav-sublinks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0 10px 14px;
}

.mobile-nav-sublinks a {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555555;
  text-decoration: none;
  transition: color 0.2s;
}

.mobile-nav-sublinks a:hover {
  color: #000000;
}

/* =========================================================================
   ESTILOS GLOBALES: CARRITO Y PORTAL DE USUARIO
   ========================================================================= */
.cart-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10004 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background: #ffffff;
  z-index: 10005 !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  box-sizing: border-box;
}

.cart-panel.open {
  transform: translateX(0);
  visibility: visible;
}

@media (max-width: 768px) {
  .cart-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
  }
}

.cart-panel-header {
  padding: 24px 24px 16px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #555;
  transition: background 0.2s, color 0.2s;
}

.cart-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

.cart-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
  flex-shrink: 0;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #121212;
  margin-bottom: 16px;
}

.cart-panel-footer .btn-submit {
  width: 100%;
  background: #121212;
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.2s, background 0.2s;
  text-decoration: none;
  display: block;
  text-align: center;
}

.cart-panel-footer .btn-submit:hover {
  background: #000;
  transform: translateY(-2px);
}

/* ── USER SIDEBAR GLOBAL ── */
.user-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10004 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.user-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.user-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100%;
  background: #ffffff;
  z-index: 10005 !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.28s;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .user-sidebar {
    width: 100%;
  }
}

.user-sidebar.active {
  transform: translateX(0);
  visibility: visible;
}

.us-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.us-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #555;
  transition: background 0.2s;
}

.us-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

.us-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-premium-unified {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: #f5f5f3;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #121212;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-premium-unified:hover {
  background: #eaeaea;
  transform: translateY(-1px);
}

.btn-premium-unified.primary {
  background: #121212;
  color: #ffffff;
  border-color: #121212;
}

.btn-premium-unified.primary:hover {
  background: #000000;
}

/* ── RESPONSIVE QUERY ── */
@media (max-width: 860px) {
  :root {
    --nav-height: 72px;
  }

  header.petal-navbar {
    height: var(--nav-height) !important;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    /* Ocultar enlaces de desktop */
  }

  .nav-container {
    padding: 0 1rem;
  }

  .logo img {
    height: 44px;
    max-height: 48px;
  }
}

/* =========================================================================
   MODAL DE FAVORITOS (GLOBAL PETAL)
   ========================================================================= */
.fav-modal-overlay,
.atc-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10005 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
  box-sizing: border-box;
}

.fav-modal-overlay.open,
.atc-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.fav-modal {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 28px;
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
  position: relative;
  box-sizing: border-box;
}

.fav-modal-overlay.open .fav-modal {
  transform: translateY(0) scale(1);
}

.fav-modal-icon {
  width: 68px;
  height: 68px;
  background: rgba(255, 59, 48, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #ff3b30;
}

.fav-modal-icon svg {
  stroke: #ff3b30;
  width: 32px;
  height: 32px;
}

.fav-modal-title {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: #121212;
  letter-spacing: -0.02em;
}

.fav-modal-text {
  color: #666666;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 24px;
}

.fav-modal-btn {
  background: #121212;
  color: #ffffff;
  border: none;
  border-radius: 100px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.fav-modal-btn:hover {
  background: #000000;
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.fav-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #121212;
  font-size: 14px;
  transition: background 0.2s;
}

.fav-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* =========================================================================
   BANNER COLLAGE HERO SCROLL EFFECT (INDEX) — DISEÑO IMPONENTE Y FLUIDO
   ========================================================================= */
.flower-collage {
  --collage-step: 7.5%;
  align-items: start;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3.2vw, 42px);
  max-width: 1440px;
  margin: 40px auto 56px;
  padding: 0 clamp(16px, 4vw, 48px);
  box-sizing: border-box;
  width: 100%;
}

.flower-collage__panel {
  margin: 0;
  overflow: hidden;
  border-radius: clamp(24px, 3.5vw, 42px);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.16), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  background: #f8f6f4;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
}

.flower-collage__panel:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 34px 80px -14px rgba(0, 0, 0, 0.24), 0 14px 36px -4px rgba(0, 0, 0, 0.12);
}

.flower-collage__panel img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: clamp(24px, 3.5vw, 42px);
  will-change: transform;
}

.flower-collage__panel--right {
  margin-top: var(--collage-step);
}

.flower-collage__panel--left img {
  transform: translateX(-105%);
}

.flower-collage__panel--right img {
  transform: translateX(105%);
}

@media (prefers-reduced-motion: no-preference) {
  .flower-collage--ready .flower-collage__panel--left img {
    transition: transform 1200ms cubic-bezier(.16, 1, .3, 1);
  }

  .flower-collage--ready .flower-collage__panel--right img {
    transition: transform 1200ms cubic-bezier(.16, 1, .3, 1) 100ms;
  }
}

.flower-collage--visible .flower-collage__panel--left img,
.flower-collage--visible .flower-collage__panel--right img {
  transform: translateX(0) !important;
}

@media (max-width: 768px) {
  .hero-text-below {
    padding: 36px 16px 24px;
  }

  .hero-text-below h1 {
    font-size: clamp(2.3rem, 8vw, 3.4rem);
    margin-bottom: 20px;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  .flower-collage {
    --collage-step: 6.5%;
    gap: 14px;
    padding: 0 8px;
    margin: 22px auto 36px;
    max-width: 100%;
  }

  .flower-collage__panel {
    border-radius: 24px;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.14);
  }

  .flower-collage__panel img {
    border-radius: 24px;
  }
}