/* ============================================================================
   AQUATEC — Universal "How to Buy" Drawer Stylesheet (Session May 2026)
   Ultra-premium Glassmorphic interface with full desktop + mobile adaptivity.
   ============================================================================ */

/* 1. Backdrop Overlay (Задний размывающий фон) */
.aq-buy-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.aq-buy-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 2. Main Drawer Container (Основной контейнер выдвижной панели) */
.aq-buy-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 99995;
  width: 440px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 45px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  overflow: hidden;
}

/* Light / Dark Theme Adaptivity using document HTML tokens */
html[data-theme='dark'] .aq-buy-drawer {
  background: rgba(18, 22, 30, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  color: #f3f4f6;
}
html[data-theme='light'] .aq-buy-drawer {
  background: rgba(255, 255, 255, 0.85);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  color: #1f2937;
}

.aq-buy-drawer.is-open {
  transform: translateX(0);
}

/* Mobile Drag Handle (Визуальная черточка сверху для мобильных) */
.aq-buy-drawer__handle {
  display: none;
  width: 40px;
  height: 4px;
  background: rgba(156, 163, 175, 0.4);
  border-radius: 2px;
  margin: 12px auto 4px auto;
  flex-shrink: 0;
}

/* 3. Header Section */
.aq-buy-drawer__header {
  padding: 28px 24px 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
  flex-shrink: 0;
}
.aq-buy-drawer__title-wrap {
  flex-grow: 1;
  padding-right: 12px;
}
.aq-buy-drawer__subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0088cc;
  margin-bottom: 6px;
}
.aq-buy-drawer__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  font-family: 'Manrope', sans-serif;
}
.aq-buy-drawer__close {
  background: rgba(128, 128, 128, 0.15);
  border: 1px solid transparent;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: inherit;
  opacity: 0.9;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
html[data-theme='dark'] .aq-buy-drawer__close {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
html[data-theme='light'] .aq-buy-drawer__close {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.75);
}
.aq-buy-drawer__close:hover {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
html[data-theme='dark'] .aq-buy-drawer__close:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
html[data-theme='light'] .aq-buy-drawer__close:hover {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.15);
  color: #000;
}

/* 4. Body Content (Scrollable) */
.aq-buy-drawer__body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  scrollbar-width: thin;
}

/* Dynamic Intro Text */
.aq-buy-drawer__intro {
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 24px;
  opacity: 0.85;
}

/* Form Styles */
.aq-buy-drawer__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.aq-buy-drawer__form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aq-buy-drawer__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}
.aq-buy-drawer__input, .aq-buy-drawer__textarea {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.2);
  background: rgba(128, 128, 128, 0.05);
  color: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.aq-buy-drawer__textarea {
  min-height: 80px;
  resize: vertical;
}

/* Interactive Focus Glows */
html[data-theme='dark'] .aq-buy-drawer__input:focus,
html[data-theme='dark'] .aq-buy-drawer__textarea:focus {
  border-color: #00aeee;
  box-shadow: 0 0 0 3px rgba(0, 174, 238, 0.2);
}
html[data-theme='light'] .aq-buy-drawer__input:focus,
html[data-theme='light'] .aq-buy-drawer__textarea:focus {
  border-color: #0072ff;
  box-shadow: 0 0 0 3px rgba(0, 114, 255, 0.15);
}

/* Premium Submit CTA (Matching original yellow-orange gradient) */
.aq-buy-drawer__submit {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  padding: 14px 20px;
  border-radius: 50px;
  border: 1.5px solid white;
  background: linear-gradient(135deg, #ff9900, #ff5500);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 100, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.aq-buy-drawer__submit:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(255, 100, 0, 0.35);
}
.aq-buy-drawer__submit:active {
  transform: translateY(0);
}
.aq-buy-drawer__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 5. Circular Integrations (Telegram / AI direct access) */
.aq-buy-drawer__divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 32px 0 24px 0;
  opacity: 0.4;
}
.aq-buy-drawer__divider::before, .aq-buy-drawer__divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid currentColor;
}
.aq-buy-drawer__divider:not(:empty)::before {
  margin-right: 12px;
}
.aq-buy-drawer__divider:not(:empty)::after {
  margin-left: 12px;
}
.aq-buy-drawer__divider-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.aq-buy-drawer__socials {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aq-buy-drawer__social-btn {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}
.aq-buy-drawer__social-btn:hover {
  transform: translateY(-1px);
}

.aq-buy-drawer__social-btn--tg {
  background: #0088cc;
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}
.aq-buy-drawer__social-btn--tg:hover {
  box-shadow: 0 6px 15px rgba(0, 136, 204, 0.35);
}

.aq-buy-drawer__social-btn--ai {
  background: #00bfa5;
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 191, 165, 0.2);
}
.aq-buy-drawer__social-btn--ai:hover {
  box-shadow: 0 6px 15px rgba(0, 191, 165, 0.35);
}

/* 6. Success State (Анимация завершения) */
.aq-buy-drawer__success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 10px;
  height: 100%;
}
.aq-buy-drawer__success.is-active {
  display: flex;
  animation: fadeIn 0.4s ease forwards;
}

/* Animated Checkmark ring */
.aq-buy-drawer__checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 191, 165, 0.1);
  color: #00bfa5;
  font-size: 36px;
  margin-bottom: 24px;
  border: 2px solid #00bfa5;
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.aq-buy-drawer__success-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px 0;
}
.aq-buy-drawer__success-text {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.85;
  margin-bottom: 32px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 7. FULL MOBILE RESPONSIVENESS AND SWIPE-TO-CLOSE */
@media (max-width: 767px) {
  .aq-buy-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    max-width: 100%;
    transform: translateY(100%);
    border-left: none;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.25);
  }
  
  html[data-theme='dark'] .aq-buy-drawer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  html[data-theme='light'] .aq-buy-drawer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .aq-buy-drawer.is-open {
    transform: translateY(0);
  }
  
  .aq-buy-drawer__handle {
    display: block;
  }
  
  .aq-buy-drawer__header {
    padding: 12px 24px 18px 24px;
  }
  
  .aq-buy-drawer__body {
    padding: 20px;
  }
}

/* 8. PREMIUM STAGGERED CONTENT ENTRANCE ANIMATION (Apple / Stripe style) */
@media (min-width: 768px) {
  .aq-buy-drawer__intro,
  .aq-buy-drawer__form-group,
  .aq-buy-drawer__submit,
  .aq-buy-drawer__divider,
  .aq-buy-drawer__socials {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .aq-buy-drawer.is-open .aq-buy-drawer__intro,
  .aq-buy-drawer.is-open .aq-buy-drawer__form-group,
  .aq-buy-drawer.is-open .aq-buy-drawer__submit,
  .aq-buy-drawer.is-open .aq-buy-drawer__divider,
  .aq-buy-drawer.is-open .aq-buy-drawer__socials {
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .aq-buy-drawer.is-open .aq-buy-drawer__intro {
    opacity: 0.85;
    transform: translateY(0);
    transition-delay: 0.15s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__form-group:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.22s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__form-group:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.29s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__form-group:nth-child(4) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.36s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__submit {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.43s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__divider {
    opacity: 0.4;
    transform: translateY(0);
    transition-delay: 0.5s;
  }
  .aq-buy-drawer.is-open .aq-buy-drawer__socials {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.57s;
  }
}
