/* =========================================
   1. CONTAINER PRINCIPAL & POZIȚIONARE
   ========================================= */
.ro-overlay {
    position: fixed;
    /* Desktop Position */
    bottom: 60px; 
    right: 60px; 
    
    width: 120px; 
    height: 140px; 
    z-index: 2147483647; 
    background: transparent; 
    
    opacity: 0;
    pointer-events: none; 
}

/* Activation Class (Added by JS) */
.ro-overlay.ro-reveal {
    pointer-events: all;
    /* Animație mai scurtă și mai fluidă, fără „agățare” la final */
    animation: roCinematicIn 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes roCinematicIn {
    0% {
        opacity: 0;
        transform: translateY(140px) scale(0.85) rotateZ(-25deg);
    }
    55% {
        opacity: 1;
        transform: translateY(-12px) scale(1.04) rotateZ(4deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

/* =========================================
   PREMIUM CLOSE BUTTON (Updated Style)
   ========================================= */
.ro-close-btn {
    position: absolute; 
    top: -90px; right: -45px; /* Desktop: Floating top-right */
    
    width: 44px; height: 44px; 
    border-radius: 50%;
    
    /* Glassy Dark Background */
    background-color: rgba(0,0,0,0.6); 
    /* Gold Border - Matching Site Style */
    border: 1px solid rgba(245, 230, 177, 0.4);
    
    /* Hide default text */
    color: transparent; 
    
    cursor: pointer;
    z-index: 201; /* Highest priority */
    opacity: 0;
    transition: opacity .7s ease-out, background-color .2s, transform .15s;
    
    /* Gold X Icon (SVG) - Uses site gold hex #F5E6B1 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 24 24' fill='none' stroke='%23F5E6B1' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='16' y1='8' x2='8' y2='16'/%3e%3cline x1='8' y1='8' x2='16' y2='16'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 22px 22px;
    
    /* Fără animație implicită; controlăm apariția din JS */
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

@keyframes roFadeBtn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

.ro-close-btn:hover {
    background-color: rgba(0,0,0,0.9);
    transform: scale(1.1);
    border-color: #F5E6B1;
}
.ro-close-btn:active {
    transform: scale(0.92);
}


/* =========================================
   2. TEXT & SĂGEȚI (CALL TO ACTION)
   ========================================= */
.ro-promo-label {
    position: absolute;
    bottom: 150px; 
    
    /* Align relative to RIGHT to match box center */
    right: 50px; 
    transform: translateX(50%);
    left: auto;
    
    width: 160px; text-align: center;
    
    /* High Z-Index to sit ON TOP of the box */
    z-index: 200; 
    
    pointer-events: none;
    opacity: 0;
    will-change: opacity;
    /* Fără animație implicită pe container; controlăm doar opacitatea din JS */
    animation: none;
}

/* Burst Animation (Text Explodes on Open) */
.ro-promo-label.ro-open {
    animation: roTextBurst 0.5s ease-out forwards !important;
}

@keyframes roTextBurst {
    0% { opacity: 1; transform: translateX(50%) scale(1); filter: blur(0); }
    100% { opacity: 0; transform: translateX(50%) translateY(-20px) scale(2.5); filter: blur(8px); }
}

.ro-promo-text {
    display: inline-block;
    font-family: sans-serif; font-weight: 700; font-size: 12px;
    line-height: 1.2; text-transform: uppercase; letter-spacing: 1px;
    /* Text solid auriu, deasupra badge-ului întunecat, pentru contrast maxim */
    color: #F5E6B1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.85);
    margin-bottom: 5px;
    padding: 4px 10px;
    position: relative;
}

.ro-promo-text::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Ușor mai puțin rotunjit, pentru un look mai „card-like” */
    border-radius: 10px;
    background: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.85), rgba(0,0,0,0.55));
    box-shadow: 0 4px 12px rgba(0,0,0,0.7);
    z-index: -1;
}

/* Plutirea textului se activează separat, după ce facem fade-in din JS */
.ro-promo-label.ro-visible {
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.ro-promo-label.ro-visible .ro-promo-text {
    animation: roFloatText 3.4s cubic-bezier(0.42, 0, 0.58, 1) infinite 0.3s;
}

.ro-promo-arrows {
    /* Dezactivat: săgețile nu se mai afișează */
    display: none;
    flex-direction: column; align-items: center;
    line-height: 0.6; margin-top: -5px;
}
.ro-promo-arrows span {
    font-size: 24px; font-weight: bold; 
    color: #F5E6B1; /* Site Gold */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    opacity: 0; animation: roArrowFlow 1.5s infinite;
}
.ro-promo-arrows span:nth-child(1) { animation-delay: 0s; }
.ro-promo-arrows span:nth-child(2) { animation-delay: 0.2s; }
.ro-promo-arrows span:nth-child(3) { animation-delay: 0.4s; }

@keyframes roFloatText { 
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(0, -10px, 0); }
    100% { transform: translate3d(0, 0, 0); } 
}
@keyframes roArrowFlow { 0% { opacity: 0; transform: translateY(-5px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(5px); } }


/* =========================================
   3. SCENA 3D & CUTIE
   ========================================= */
.ro-stage {
    perspective: 1000px;
    width: 200px; height: 200px;
    transform: scale(0.5); 
    transform-origin: bottom right;
    position: absolute; bottom: 0; right: 0;
    z-index: 50; 
}

.ro-box-container {
    width: 100%; height: 100%;
    position: relative; transform-style: preserve-3d; cursor: pointer;
    transform: rotateX(-20deg) rotateY(35deg);
    /* Tranziție mai lină pentru mișcarea cutiei (hover) */
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    /* Elimină highlight-ul albastru de tap pe mobile */
    -webkit-tap-highlight-color: transparent;
}

/* Mic „lean” la hover pe desktop; idle shake-ul este controlat separat printr-o clasă dedicată */
@media (min-width: 769px) {
    .ro-stage:hover .ro-box-container {
        transform: rotateX(-20deg) rotateY(15deg) translateY(-6px);
    }
}

.ro-face {
    position: absolute;
    border: 1px solid rgba(0,0,0,0.2);
    backface-visibility: hidden;
    /* Fără radius pe fețele 3D pentru a evita separarea vizuală dintre laturi */
    border-radius: 0;
    overflow: visible;
}


/* =========================================
   4. CAPACUL (LID) — PALETĂ BURGUNDY
   (înainte: lid în degrade auriu #F5E6B1 → #CFB98A, panglică aurie)
   ========================================= */
.ro-lid {
    position: absolute; width: 210px; height: 50px; top: -50px; left: -5px;
    transform-style: preserve-3d; transform-origin: bottom back;
    transition: transform 0.5s ease; z-index: 10;
}
/* Top Face - capac burgundy (degrade subtil) */
.ro-lid-top {
  width: 210px; height: 210px;
  /* Burgundi ușor mai închis pentru capac */
  background: linear-gradient(135deg, #6F0F27, #30040C);
  transform: rotateX(90deg) translateZ(105px);
  /* Topul rămâne drept pentru a nu crea „fante” între fețe */
  border-radius: 0;
}
/* Panglică orizontală + verticală pe capac, în crem/auriu pentru contrast */
.ro-lid-top::before {
  content: ''; position: absolute; width: 40px; height: 100%;
  left: 50%; transform: translateX(-50%);
  background: linear-gradient(to bottom, #F5E6B1, #D8C789);
}
.ro-lid-top::after  {
  content: ''; position: absolute; height: 40px; width: 100%;
  top: 50%; transform: translateY(-50%);
  background: linear-gradient(to right, #C49E4E, #F5E6B1, #8C6B2E);
}

/* Side Faces - margini capac, burgundy ușor mai închis */
.ro-lid-side {
  width: 210px; height: 50px;
  background: linear-gradient(to bottom, #5A0C1A, #3A0711);
  border-radius: 0;
}
/* Panglică verticală pe laterale - ribbon crem/auriu */
.ro-lid-side::before { 
    content: ''; position: absolute; height: 100%; width: 40px; left: 50%; transform: translateX(-50%); 
  background: linear-gradient(to right, #C49E4E, #F5E6B1, #8C6B2E); 
}
.ro-lid-side.ro-front { transform: translateZ(105px); }
.ro-lid-side.ro-back  { transform: rotateY(180deg) translateZ(105px); }
.ro-lid-side.ro-right { transform: rotateY(90deg) translateZ(105px); }
.ro-lid-side.ro-left  { transform: rotateY(-90deg) translateZ(105px); }

/* Inner Faces - Very Dark Red */
.ro-lid-inner-top { width: 210px; height: 210px; background: #4A0510; transform: rotateX(90deg) translateZ(103px) rotateY(180deg); backface-visibility: visible !important; }
.ro-lid-inner-side { width: 210px; height: 50px; background: #2B0206; backface-visibility: visible !important; }
.ro-lid-inner-side.ro-front { transform: translateZ(103px) rotateY(180deg); }
.ro-lid-inner-side.ro-back  { transform: rotateY(180deg) translateZ(103px) rotateY(180deg); } 
.ro-lid-inner-side.ro-right { transform: rotateY(90deg) translateZ(103px) rotateY(180deg); }
.ro-lid-inner-side.ro-left  { transform: rotateY(-90deg) translateZ(103px) rotateY(180deg); }


/* =========================================
   5. CORPUL (BODY) — CUTIE BURGUNDY CU PANGLICĂ BURGUNDY MAI DESCHISĂ
   (înainte: corp maro închis #1E1B13 → #2B2618, panglică aurie)
   ========================================= */
.ro-box-body { width: 200px; height: 200px; position: absolute; transform-style: preserve-3d; }
/* Fețele exterioare — burgundy închis */
.ro-box-body .ro-face {
  width: 200px; height: 200px;
  /* Burgundi mai întunecat pe corp, dar cu același feeling de profunzime */
  background: linear-gradient(135deg, #4B0817, #1C0208);
  border-radius: 0;
}
.ro-box-body .ro-front::before, .ro-box-body .ro-back::before, .ro-box-body .ro-right::before, .ro-box-body .ro-left::before, .ro-box-body .ro-bottom::before { 
    content: ''; position: absolute; height: 100%; width: 40px; left: 50%; transform: translateX(-50%); 
  background: linear-gradient(to right, #C49E4E, #F5E6B1, #8C6B2E);
}
.ro-box-body .ro-front { transform: translateZ(100px); }
.ro-box-body .ro-back { transform: rotateY(180deg) translateZ(100px); }
.ro-box-body .ro-right { transform: rotateY(90deg) translateZ(100px); }
.ro-box-body .ro-left { transform: rotateY(-90deg) translateZ(100px); }
.ro-box-body .ro-bottom {
  transform: rotateX(-90deg) translateZ(100px);
  background: #14100B;
}

/* Inner Walls - foarte închise, pentru profunzime (maro aproape negru) */
.ro-inner-back   { width: 198px; height: 198px; background: #15110A !important; transform: translateZ(-98px); }
.ro-inner-front  { width: 198px; height: 198px; background: #15110A !important; transform: rotateY(180deg) translateZ(-98px); }
.ro-inner-left   { width: 198px; height: 198px; background: #15110A !important; transform: rotateY(90deg) translateZ(-98px); }
.ro-inner-right  { width: 198px; height: 198px; background: #15110A !important; transform: rotateY(-90deg) translateZ(-98px); }
.ro-inner-bottom { width: 198px; height: 198px; background: #0C0905 !important; transform: rotateX(90deg) translateZ(-98px); }

.ro-shadow { position: absolute; width: 200px; height: 200px; background: radial-gradient(rgba(0,0,0,0.6), transparent 70%); transform: rotateX(90deg) translateZ(-150px); border-radius: 50%; }

/* LOGO */
.ro-box-body .ro-front::after, .ro-box-body .ro-back::after, .ro-box-body .ro-left::after, .ro-box-body .ro-right::after {
    content: '';
    position: absolute;
    /* Dimensiunea totală a „medalionului” (cerc crem + favicon) pe fața cutiei */
    width: 52%;
    height: 52%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Favicon pe deasupra unui disc crem circular, pentru contrast */
    background-image:
      url('../favicons/favicon-192x192.png'),
      radial-gradient(circle,
        #F5E6B1 0%,
        #F5E6B1 40%,
        #D8C789 70%,
        rgba(216,199,137,0.85) 78%,
        transparent 95%
      );
    background-repeat: no-repeat, no-repeat;
    background-position: center center, center center;
    /* Favicon ușor mai mare, cerc crem la dimensiunea pseudo-elementului (cerc perfect) */
    background-size: 74% 74%, 100% 100%;
    /* Colțuri mai discrete, aproape dreptunghiulare */
    border-radius: 5;
    z-index: 5;
}


/* =========================================
   6. ANIMAȚII & CONFETTI
   ========================================= */
.ro-box-container.ro-open { animation: roBoxShakeOpen 0.4s forwards !important; cursor: default; }

/* Idle shake subtil – declanșat ocazional din JS prin clasa .ro-idle-shake */
.ro-box-container.ro-idle-shake {
    animation: roIdleShake 1.8s ease-in-out;
}
.ro-box-container.ro-open .ro-lid { transform-origin: top; animation: roLidFlip 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.2s; }

@keyframes roBoxShakeOpen {
    0% { transform: rotateX(-20deg) rotateY(35deg) translateY(0); } 50% { transform: rotateX(-20deg) rotateY(35deg) translateY(10px); } 100% { transform: rotateX(-20deg) rotateY(35deg) translateY(0); }
}
@keyframes roLidFlip { 0% { transform: rotateX(0) translateY(0) translateZ(0); } 100% { transform: translateY(-100px) translateZ(-50px) rotateX(120deg); } }
@keyframes roIdleShake {
    0%, 100% { transform: rotateX(-20deg) rotateY(35deg); } 5% { transform: rotateX(-20deg) rotateY(35deg) rotateZ(3deg); } 10% { transform: rotateX(-20deg) rotateY(35deg) rotateZ(-3deg); } 15% { transform: rotateX(-20deg) rotateY(35deg) rotateZ(3deg); } 20% { transform: rotateX(-20deg) rotateY(35deg) rotateZ(0); }
}

.ro-confetti {
    position: absolute; width: 8px; height: 8px; top: 60%; left: 50%; opacity: 0; z-index: 20; pointer-events: none;
    border-radius: 2px; box-shadow: 0 0 2px rgba(0,0,0,0.1);
}
@keyframes roConfettiBlast {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.5); }
}


/* =========================================
   7. OPTIMIZĂRI MOBILE
   ========================================= */
@media (max-width: 768px) {
    /* Poziționare Container Mobil */
    .ro-overlay {
        right: 40px; 
        bottom: 40px; 
    }
    
    .ro-stage { transform: scale(0.35); }
    
    /* Poziționare Buton Close Mobil - puțin mai sus și mai mic pentru a nu se intercala cu textul */
    .ro-close-btn { 
        top: -30px; 
        right: -24px;
        width: 34px;
        height: 34px;
        background-size: 18px 18px;
    }
    
    /* Poziționare Text Mobil - puțin mai jos, să nu se suprapună cu textul landing-ului */
    .ro-promo-label { 
        bottom: 80px; 
        width: 140px; 
        right: 35px; 
    }
    .ro-promo-text { font-size: 12px; }
}