/* ==========================================================================
   FLORES AMARILLAS - ANIMACIONES & ESTILOS DE GIRASOLES
   Diseño botánico estético con capas de pétalos en CSS puro
   ========================================================================== */

.bouquet-container {
  position: relative;
  width: 320px;
  height: 380px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform-origin: bottom center;
  transition: transform 0.3s ease;
}

@media (max-width: 480px) {
  .bouquet-container {
    width: 280px;
    height: 340px;
    transform: scale(0.9);
  }
}

/* Base iluminada del ramo */
.garden-ground-glow {
  position: absolute;
  bottom: 0;
  width: 240px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(255, 215, 0, 0.4) 0%, rgba(46, 125, 50, 0.2) 60%, transparent 80%);
  filter: blur(10px);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 4s infinite ease-in-out alternate;
}

@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   ESTRUCTURA DE CADA FLOR (SUNFLOWER)
   ========================================================================== */
.flower-wrapper {
  position: absolute;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: bottom center;
  transform: scale(var(--scale, 1)) rotate(var(--rotate, 0deg));
  animation: flowerGrow 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay, 0s) both,
             flowerSway 5s ease-in-out infinite alternate calc(var(--delay, 0s) + 1.6s);
  z-index: 2;
}

.flower-center { z-index: 5; }
.flower-left { left: 20px; z-index: 4; }
.flower-right { right: 20px; z-index: 4; }
.flower-back-left { left: -25px; bottom: 40px; z-index: 1; opacity: 0.9; }
.flower-back-right { right: -25px; bottom: 40px; z-index: 1; opacity: 0.9; }

@keyframes flowerGrow {
  0% {
    transform: scale(0) rotate(var(--rotate, 0deg)) translateY(120px);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: scale(var(--scale, 1)) rotate(var(--rotate, 0deg)) translateY(0);
    opacity: 1;
  }
}

@keyframes flowerSway {
  0% {
    transform: scale(var(--scale, 1)) rotate(var(--rotate, 0deg));
  }
  50% {
    transform: scale(var(--scale, 1)) rotate(calc(var(--rotate, 0deg) + 3deg)) translateY(-2px);
  }
  100% {
    transform: scale(var(--scale, 1)) rotate(calc(var(--rotate, 0deg) - 3deg)) translateY(0);
  }
}

/* ==========================================================================
   TALLOS Y HOJAS ORGÁNICAS
   ========================================================================== */
.stem {
  position: relative;
  width: 10px;
  height: 180px;
  background: linear-gradient(to right, #1b5e20 0%, #2e7d32 50%, #43a047 100%);
  border-radius: 6px;
  box-shadow: inset 1px 0 3px rgba(0, 0, 0, 0.3);
  margin-top: -10px;
}

.stem-curved-left {
  border-radius: 20px 4px 4px 20px;
  transform: rotate(-4deg);
}

.stem-curved-right {
  border-radius: 4px 20px 20px 4px;
  transform: rotate(4deg);
}

.stem-back {
  height: 150px;
  width: 8px;
  background: linear-gradient(to right, #144d18, #236927);
}

/* Hojas Verdes */
.leaf {
  position: absolute;
  width: 32px;
  height: 18px;
  background: radial-gradient(ellipse at center, #4caf50 0%, #2e7d32 70%, #1b5e20 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.leaf-left {
  left: -26px;
  top: 45%;
  border-radius: 30px 4px 30px 4px;
  transform: rotate(-35deg);
  transform-origin: right center;
  animation: leafFlutter 4s ease-in-out infinite alternate;
}

.leaf-right {
  right: -26px;
  top: 60%;
  border-radius: 4px 30px 4px 30px;
  transform: rotate(35deg);
  transform-origin: left center;
  animation: leafFlutter 4.5s ease-in-out infinite alternate 0.5s;
}

@keyframes leafFlutter {
  0% { transform: rotate(-35deg) scale(0.95); }
  100% { transform: rotate(-25deg) scale(1.05); }
}

/* ==========================================================================
   CABEZA DEL GIRASOL & CAPAS DE PÉTALOS
   ========================================================================== */
.flower-head {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flower-head.mini {
  width: 100px;
  height: 100px;
}

/* Capa de Pétalos */
.petals-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: petalsBloom 1.8s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--delay, 0s) + 0.3s) both;
}

@keyframes petalsBloom {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Pétalo Individual */
.petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 65px;
  margin-top: -65px;
  margin-left: -11px;
  transform-origin: bottom center;
  transform: rotate(var(--angle)) translateY(0);
  background: linear-gradient(to top, 
    #e65100 0%, 
    #ff9800 20%, 
    #ffb300 50%, 
    #ffd54f 85%, 
    #fff59d 100%
  );
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.6), 
              inset 0 2px 4px rgba(255, 255, 255, 0.6),
              inset 0 -5px 10px rgba(230, 81, 0, 0.5);
  transition: transform 0.3s ease;
}

.inner-petals .petal {
  width: 18px;
  height: 52px;
  margin-top: -52px;
  margin-left: -9px;
  background: linear-gradient(to top, 
    #bf360c 0%, 
    #f57c00 30%, 
    #ffc107 70%, 
    #fff9c4 100%
  );
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.8),
              inset 0 2px 4px rgba(255, 255, 255, 0.7);
}

.mini .petal {
  width: 16px;
  height: 44px;
  margin-top: -44px;
  margin-left: -8px;
}

/* Núcleo / Centro del Girasol */
.flower-center-core {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    #2c1505 0%, 
    #3e1f08 40%, 
    #5d2e0c 70%, 
    #b45309 95%, 
    #fbbf24 100%
  );
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6),
              0 0 10px rgba(245, 158, 11, 0.5),
              inset 0 0 12px rgba(0, 0, 0, 0.8);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: corePulse 3s ease-in-out infinite alternate;
}

.mini .flower-center-core {
  width: 42px;
  height: 42px;
}

@keyframes corePulse {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.03); filter: drop-shadow(0 0 8px rgba(255, 204, 0, 0.6)); }
}

/* Textura espiralada de semillas en el núcleo */
.core-texture {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 4px, rgba(255, 183, 77, 0.25) 5px, transparent 6px),
    radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.2) 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 215, 0, 0.2) 2px, transparent 3px),
    radial-gradient(circle at 40% 75%, rgba(255, 215, 0, 0.15) 2px, transparent 3px);
  background-size: 8px 8px, 12px 12px, 14px 14px, 10px 10px;
  opacity: 0.85;
}

/* Halo de chispas brillantes */
.sparkles-halo {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  pointer-events: none;
  animation: haloSpin 12s linear infinite;
}

@keyframes haloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   LAZO / CINTA DEL RAMO
   ========================================================================== */
.bouquet-ribbon {
  position: absolute;
  bottom: 35px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.ribbon-bow {
  width: 32px;
  height: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
  border-radius: 6px;
  position: relative;
}

.ribbon-bow::before, .ribbon-bow::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 20px;
  height: 16px;
  background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
  border-radius: 12px 4px 12px 4px;
}

.ribbon-bow::before {
  left: -16px;
  transform: rotate(-25deg);
}

.ribbon-bow::after {
  right: -16px;
  transform: rotate(25deg) scaleX(-1);
}

.ribbon-tail {
  position: absolute;
  top: 15px;
  width: 10px;
  height: 28px;
  background: linear-gradient(to bottom, #f59e0b, #d97706);
  border-radius: 2px;
}

.ribbon-tail.left {
  left: -6px;
  transform: rotate(18deg);
}

.ribbon-tail.right {
  right: -6px;
  transform: rotate(-18deg);
}

/* ==========================================================================
   FLOR FLOTANTE GENERADA AL TOCAR LA PANTALLA
   ========================================================================== */
.floating-spawned-flower {
  position: fixed;
  pointer-events: none;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transform: translate(-50%, -50%) scale(0);
  animation: spawnFlowerAnim 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes spawnFlowerAnim {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 1;
  }
  40% {
    transform: translate(-50%, -80px) scale(1.3) rotate(20deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -160px) scale(0.6) rotate(45deg);
    opacity: 0;
  }
}
