/* ================================================================
   Russian Luxe — Shipping Calculator Modal
   VisionOS Glassmorphism · Premium Luxury Aesthetics
   ================================================================ */

:root {
  --rlsc-gold:      #A67C00;
  --rlsc-gold-l:    #C9A84C;
  --rlsc-gold-ll:   #E8D5A3;
  --rlsc-cream:     rgba(245, 238, 220, 0.92);
  --rlsc-glass:     rgba(28, 20, 10, 0.55);
  --rlsc-glass-l:   rgba(255, 250, 238, 0.08);
  --rlsc-border:    rgba(180, 140, 60, 0.22);
  --rlsc-border-l:  rgba(200, 160, 80, 0.14);
  --rlsc-text:      rgba(240, 230, 208, 0.92);
  --rlsc-muted:     rgba(200, 185, 150, 0.55);
  --rlsc-shadow:    0 32px 80px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.4);
  --rlsc-blur:      blur(28px) saturate(160%);
  --rlsc-rad:       20px;
  --rlsc-easing:    cubic-bezier(0.32, 0.72, 0, 1);
}

/* ── TRIGGER BUTTON ──────────────────────────────────────────── */
.rlsc-trigger {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--text-muted, #7A6E63);
  text-decoration: none;
  transition: color .2s, gap .2s;
  white-space: nowrap;
}
.rlsc-trigger:hover { color: var(--rlsc-gold); gap: .6rem; }
.rlsc-trigger svg   { flex-shrink: 0; transition: transform .2s; }
.rlsc-trigger:hover svg { transform: translateX(2px); }
.rlsc-trigger-globe {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s;
}
.rlsc-trigger-globe::before {
  content: '';
  position: absolute;
  width: 5.5px; height: 100%;
  border-left: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  border-radius: 50%;
}
.rlsc-trigger-globe::after {
  content: '';
  position: absolute;
  width: 100%; height: 0;
  border-top: 1.5px solid currentColor;
}

/* ── OVERLAY ─────────────────────────────────────────────────── */
.rlsc-overlay {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.rlsc-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 6, 2, 0.6);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  opacity: 0;
  transition: opacity .45s var(--rlsc-easing);
}
.rlsc-overlay.open .rlsc-backdrop { opacity: 1; }
.rlsc-overlay.closing .rlsc-backdrop { opacity: 0; }

/* ── MODAL ───────────────────────────────────────────────────── */
.rlsc-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  border-radius: var(--rlsc-rad);
  overflow: hidden;

  /* VisionOS Glass */
  background: var(--rlsc-glass);
  backdrop-filter: var(--rlsc-blur);
  -webkit-backdrop-filter: var(--rlsc-blur);
  border: 1px solid var(--rlsc-border);
  box-shadow: var(--rlsc-shadow),
              inset 0 1px 0 rgba(255,240,180,.1),
              inset 0 -1px 0 rgba(0,0,0,.3);

  /* Entrance animation */
  transform: scale(.92) translateY(20px);
  opacity: 0;
  transition: transform .45s var(--rlsc-easing), opacity .35s var(--rlsc-easing);
  max-height: min(640px, 90dvh);
}
.rlsc-overlay.open .rlsc-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.rlsc-overlay.closing .rlsc-modal {
  transform: scale(.94) translateY(14px);
  opacity: 0;
}

/* Inner glass highlight — top edge shimmer */
.rlsc-modal::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212,175,55,.5) 35%,
    rgba(245,230,180,.85) 50%,
    rgba(212,175,55,.5) 65%,
    transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* ── HEADER ──────────────────────────────────────────────────── */
.rlsc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.35rem .9rem;
  border-bottom: 1px solid var(--rlsc-border-l);
  flex-shrink: 0;
}
.rlsc-header-left { display: flex; align-items: center; gap: .75rem; }

/* Pulsing AI dot */
.rlsc-ai-dot {
  position: relative;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.rlsc-dot-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(166, 124, 0, .4);
  animation: rlscRingPulse 2.4s ease-in-out infinite;
}
.rlsc-dot-core {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(245,220,120,1) 0%,
    rgba(166,124,0,1) 60%);
  box-shadow: 0 0 8px rgba(166,124,0,.7), 0 0 20px rgba(166,124,0,.3);
  animation: rlsCorePulse 2.4s ease-in-out infinite;
}
@keyframes rlscRingPulse {
  0%,100% { transform: scale(1);   opacity: .5; }
  50%      { transform: scale(1.6); opacity: 0;  }
}
@keyframes rlsCorePulse {
  0%,100% { box-shadow: 0 0 8px rgba(166,124,0,.7), 0 0 20px rgba(166,124,0,.3); }
  50%      { box-shadow: 0 0 12px rgba(212,175,55,.9), 0 0 32px rgba(166,124,0,.5); }
}

.rlsc-header-title {
  display: block;
  font-family: 'Cinzel', 'Optima', 'Palatino', Georgia, serif;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--rlsc-gold-ll);
  line-height: 1;
}
.rlsc-header-sub {
  display: block;
  font-size: .6rem; letter-spacing: .1em;
  color: var(--rlsc-muted);
  margin-top: 2px;
  font-family: 'Inter', system-ui, sans-serif;
}

.rlsc-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--rlsc-muted);
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.rlsc-close:hover {
  background: rgba(255,80,60,.18);
  color: rgba(255,120,100,.9);
  border-color: rgba(255,80,60,.25);
  transform: scale(1.08);
}

/* ── PRODUCT BADGE ───────────────────────────────────────────── */
.rlsc-product-badge {
  display: flex; align-items: center; gap: .4rem;
  margin: .6rem 1.35rem 0;
  padding: .4rem .85rem;
  border-radius: 100px;
  background: rgba(166,124,0,.1);
  border: 1px solid rgba(166,124,0,.2);
  font-size: .68rem; letter-spacing: .06em;
  color: var(--rlsc-gold-l);
  width: fit-content;
  max-width: calc(100% - 2.7rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Cinzel', Georgia, serif;
}
.rlsc-product-badge svg { flex-shrink: 0; opacity: .7; }

/* ── MESSAGES ────────────────────────────────────────────────── */
.rlsc-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: .65rem;
  scroll-behavior: smooth;
  min-height: 180px;
}
.rlsc-messages::-webkit-scrollbar { width: 2px; }
.rlsc-messages::-webkit-scrollbar-thumb {
  background: rgba(166,124,0,.3); border-radius: 1px;
}

.rlsc-msg { display: flex; animation: rlscFadeUp .3s var(--rlsc-easing) both; }
@keyframes rlscFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rlsc-msg--ai   { justify-content: flex-start; }
.rlsc-msg--user { justify-content: flex-end; }

.rlsc-bubble {
  max-width: 86%;
  padding: .7rem 1rem;
  border-radius: 14px;
  font-size: .8rem;
  line-height: 1.7;
}
.rlsc-msg--ai .rlsc-bubble {
  background: rgba(166,124,0,.1);
  border: 1px solid rgba(166,124,0,.18);
  border-bottom-left-radius: 4px;
  color: var(--rlsc-text);
}
.rlsc-msg--user .rlsc-bubble {
  background: linear-gradient(135deg,
    rgba(140,100,0,.55) 0%,
    rgba(180,138,60,.45) 100%);
  border: 1px solid rgba(200,160,80,.25);
  border-bottom-right-radius: 4px;
  color: rgba(255,245,215,.95);
}

/* Result card */
.rlsc-result {
  margin-top: .6rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: rgba(140,100,0,.08);
  border: 1px solid rgba(166,124,0,.25);
}
.rlsc-result-destination {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--rlsc-gold-l); margin-bottom: .75rem;
  font-family: 'Cinzel', Georgia, serif;
}
.rlsc-result-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: .5rem; margin-bottom: .8rem;
}
.rlsc-result-cell {
  display: flex; flex-direction: column; gap: 3px;
  padding: .55rem .5rem;
  background: rgba(0,0,0,.2);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.05);
}
.rlsc-result-label {
  font-size: .58rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rlsc-muted);
}
.rlsc-result-val {
  font-size: .84rem; font-weight: 600;
  color: var(--rlsc-text);
  line-height: 1.2;
}
.rlsc-val-price { color: var(--rlsc-gold-l); }
.rlsc-result-note {
  font-size: .68rem; color: var(--rlsc-muted);
  line-height: 1.6; margin-bottom: .75rem;
}
.rlsc-result-cta {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; color: var(--rlsc-gold-l);
  text-decoration: none;
  font-family: 'Cinzel', Georgia, serif;
  transition: gap .2s, color .2s;
}
.rlsc-result-cta:hover { color: var(--rlsc-gold-ll); gap: .5rem; }

/* Typing indicator */
.rlsc-typing {
  display: flex; align-items: center; gap: 5px;
  padding: .6rem .9rem;
}
.rlsc-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rlsc-gold);
  animation: rlscDot .9s ease-in-out infinite;
  opacity: .5;
}
.rlsc-typing span:nth-child(2) { animation-delay: .16s; }
.rlsc-typing span:nth-child(3) { animation-delay: .32s; }
@keyframes rlscDot {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* ── INPUT ───────────────────────────────────────────────────── */
.rlsc-input-wrap {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1.2rem;
  border-top: 1px solid var(--rlsc-border-l);
  flex-shrink: 0;
  background: rgba(0,0,0,.15);
}
.rlsc-input {
  flex: 1;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(180,140,60,.2);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .82rem;
  font-family: inherit;
  color: var(--rlsc-text);
  transition: border-color .25s, background .25s, box-shadow .25s;
  outline: none;
  min-height: 38px;
}
.rlsc-input::placeholder { color: var(--rlsc-muted); }
.rlsc-input:focus {
  border-color: rgba(166,124,0,.5);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px rgba(166,124,0,.1),
              inset 0 1px 0 rgba(255,255,255,.04);
}

.rlsc-send {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #8B6400 0%, #C9A84C 50%, #8B6400 100%);
  background-size: 200% 200%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #1A0E02;
  transition: transform .18s, box-shadow .2s, background-position .4s;
  box-shadow: 0 2px 12px rgba(140,100,0,.35);
}
.rlsc-send:hover {
  transform: scale(1.08);
  background-position: right center;
  box-shadow: 0 4px 20px rgba(166,124,0,.5);
}
.rlsc-send:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* ── FOOTER NOTE ─────────────────────────────────────────────── */
.rlsc-footer-note {
  text-align: center;
  font-size: .6rem; letter-spacing: .06em;
  color: rgba(180,150,90,.35);
  padding: .5rem 1rem .75rem;
  flex-shrink: 0;
}

/* ── MOBILE — BOTTOM SHEET ───────────────────────────────────── */
@media (max-width: 540px) {
  .rlsc-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .rlsc-modal {
    max-width: 100%;
    border-radius: var(--rlsc-rad) var(--rlsc-rad) 0 0;
    transform: translateY(100%);
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Handle bar */
    padding-top: 0;
  }
  .rlsc-modal::after {
    content: '';
    position: absolute; top: .6rem; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 3px; border-radius: 2px;
    background: rgba(200,170,90,.25);
    pointer-events: none;
  }
  .rlsc-overlay.open .rlsc-modal { transform: translateY(0); }
  .rlsc-overlay.closing .rlsc-modal { transform: translateY(100%); }

  .rlsc-modal::before { display: none; }
  .rlsc-messages { min-height: 140px; }
}
