/* ═══════════════════════════════════════════════════════════════════════════
   AUTH MODAL + NAV ACCOUNT BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ────────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 31, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.auth-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal dialog ───────────────────────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 901;
  width: min(92vw, 440px);
  max-height: 90dvh;
  overflow-y: auto;
  border: none;
  padding: 0;
  background: var(--color-surface, #0D1630);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);

  /* Hidden by default */
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.auth-modal[aria-hidden="false"].is-open {
  display: block;
  opacity: 1;
  transform: none;
}
/* Fix: dialog needs display block not dialog default */
.auth-modal { display: none; }
.auth-modal.is-open { display: block; }

[data-theme="light"] .auth-modal {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

/* ── Close button ───────────────────────────────────────────────────────── */
.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--color-muted, #7A8BAA);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.auth-modal__close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-text, #F0F4FF);
}
[data-theme="light"] .auth-modal__close {
  background: rgba(0,0,0,0.05);
  color: #5a6a85;
}
[data-theme="light"] .auth-modal__close:hover {
  background: rgba(0,0,0,0.1);
  color: #0D1630;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.auth-panel {
  padding: 40px 36px 32px;
}
@media (max-width: 480px) {
  .auth-panel { padding: 32px 24px 28px; }
}

.auth-modal__logo {
  margin-bottom: 20px;
}

.auth-modal__title {
  font-family: var(--font-display, 'Cabinet Grotesk', sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text, #F0F4FF);
  margin: 0 0 6px;
}
[data-theme="light"] .auth-modal__title { color: #0D1630; }

.auth-modal__subtitle {
  font-size: 0.9rem;
  color: var(--color-muted, #7A8BAA);
  margin: 0 0 28px;
}

/* ── Form fields ────────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted, #7A8BAA);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-hint {
  font-weight: 400;
  text-transform: none;
  font-size: 0.78rem;
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--color-text, #F0F4FF);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.95rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.auth-input::placeholder { color: var(--color-muted, #7A8BAA); opacity: 0.6; }
.auth-input:focus {
  outline: none;
  border-color: var(--color-accent, #00C8E0);
}

[data-theme="light"] .auth-input {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #0D1630;
}
[data-theme="light"] .auth-input:focus {
  border-color: #007A8A;
}

/* ── Checkbox row ───────────────────────────────────────────────────────── */
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-muted, #7A8BAA);
  line-height: 1.5;
  margin-top: -4px;
}
.auth-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-accent, #00C8E0);
}
[data-theme="light"] .auth-checkbox-row { color: #5a6a85; }

/* ── Error / success messages ───────────────────────────────────────────── */
.auth-error {
  font-size: 0.875rem;
  color: #f87171;
  padding: 8px 12px;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  margin: 0;
}

.auth-success {
  font-size: 0.875rem;
  color: #4ade80;
  padding: 8px 12px;
  background: rgba(74, 222, 128, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  margin: 0;
}

/* ── Primary button ─────────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent, #00C8E0);
  color: #070D1F;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 4px;
}
.auth-btn:hover  { background: #00A3BB; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

[data-theme="light"] .auth-btn { background: #007A8A; color: #fff; }
[data-theme="light"] .auth-btn:hover { background: #005f6b; }

/* ── Divider ────────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
  color: var(--color-muted, #7A8BAA);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
[data-theme="light"] .auth-divider::before,
[data-theme="light"] .auth-divider::after {
  background: rgba(0,0,0,0.08);
}

/* ── Link button ────────────────────────────────────────────────────────── */
.auth-link {
  background: none;
  border: none;
  color: var(--color-accent, #00C8E0);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: 100%;
  text-align: center;
}
.auth-link:hover { color: #00A3BB; }
[data-theme="light"] .auth-link { color: #007A8A; }

/* ── Success panel ──────────────────────────────────────────────────────── */
.auth-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAV ACCOUNT BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-account-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--color-text, #F0F4FF);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-account-btn:hover {
  border-color: var(--color-accent, #00C8E0);
  background: rgba(0, 200, 224, 0.06);
}
[data-theme="light"] .nav-account-btn {
  color: #0D1630;
  border-color: rgba(0,0,0,0.15);
}

/* Logout button in nav */
.nav-logout-btn {
  background: none;
  border: none;
  color: var(--color-muted, #7A8BAA);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}
.nav-logout-btn:hover { color: #f87171; }

/* ═══════════════════════════════════════════════════════════════════════════
   WISHLIST HEART BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(7, 13, 31, 0.65);
  backdrop-filter: blur(6px);
  color: var(--color-muted, #7A8BAA);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  z-index: 2;
}
.wishlist-btn:hover {
  background: rgba(7, 13, 31, 0.85);
  color: #f87171;
  transform: scale(1.1);
}
.wishlist-btn.is-wishlisted {
  color: #f87171;
}
.wishlist-btn.is-wishlisted svg {
  fill: #f87171;
}
.wishlist-btn svg { transition: fill 0.15s; }

/* ═══════════════════════════════════════════════════════════════════════════
   COLOR SWATCH UNAVAILABLE OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.color-swatch-wrap {
  position: relative;
  display: inline-block;
}

.color-swatch-wrap.is-unavailable .color-swatch,
.color-swatch-wrap.is-unavailable [class*="color-swatch"] {
  opacity: 0.35;
}

.color-unavailable-x {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.color-unavailable-x svg {
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.6));
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHECKOUT GUEST/ACCOUNT MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.checkout-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 902;
  width: min(92vw, 480px);
  max-height: 90dvh;
  overflow-y: auto;
  border: none;
  padding: 40px 36px 32px;
  background: var(--color-surface, #0D1630);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  display: none;
}
.checkout-modal.is-open { display: block; }

[data-theme="light"] .checkout-modal {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}

.checkout-modal__title {
  font-family: var(--font-display, 'Cabinet Grotesk', sans-serif);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.checkout-modal__sub {
  font-size: 0.9rem;
  color: var(--color-muted, #7A8BAA);
  margin: 0 0 28px;
  line-height: 1.6;
}

.checkout-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-option-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--color-text, #F0F4FF);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.checkout-option-btn:hover {
  border-color: var(--color-accent, #00C8E0);
  background: rgba(0,200,224,0.06);
}
.checkout-option-btn.primary {
  background: var(--color-accent, #00C8E0);
  color: #070D1F;
  border-color: transparent;
}
.checkout-option-btn.primary:hover { background: #00A3BB; }
.checkout-option-btn small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 2px;
}

[data-theme="light"] .checkout-option-btn {
  border-color: rgba(0,0,0,0.1);
  color: #0D1630;
}
[data-theme="light"] .checkout-option-btn.primary {
  background: #007A8A;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCOUNT DROPDOWN MENU
   ═══════════════════════════════════════════════════════════════════════════ */

.account-menu-wrap {
  position: relative;
  display: inline-flex;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--color-surface, #0D1630);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  padding: 6px;
  z-index: 500;
  display: none;
  animation: dropdown-in 0.15s ease;
}

.account-dropdown.is-open { display: block; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.account-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--color-text, #F0F4FF);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s;
  white-space: nowrap;
}
.account-dropdown__item:hover {
  background: rgba(255,255,255,0.06);
}
.account-dropdown__item--danger {
  color: #f87171;
}
.account-dropdown__item--danger:hover {
  background: rgba(248,113,113,0.1);
}
.account-dropdown__item--admin {
  color: #a855f7;
}
.account-dropdown__item--admin:hover {
  background: rgba(168,85,247,0.1);
}

.account-dropdown__divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 6px;
}

/* Mobile: account menu in hamburger menu instead of dropdown */
.mobile-account-section {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px;
  padding-top: 8px;
  display: none;
}
.mobile-account-section.is-visible { display: block; }

.mobile-account-section a,
.mobile-account-section button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--color-text, #F0F4FF);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.mobile-account-section .danger { color: #f87171; }
.mobile-account-section .admin-link { color: #a855f7; }
