/* ==========================================================================
   HEADER COMPONENT STYLES
   Floating Top Bar, Morphing Brand Logo, Menu Button & VIP Card Button
   ========================================================================== */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-header, 100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 14px 14px 14px;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none;
  transition: transform var(--transition-fast, 0.25s ease);
  will-change: transform;
}

.top-bar.white-mode-scrolled {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.brand-block,
.brand-logo-link,
.top-bar-right,
.header-menu-btn,
.header-close-btn,
.rewards-card-btn {
  pointer-events: auto;
}

@media (min-width: 769px) {
  .top-bar {
    top: 0;
    padding: 34px 40px 24px 40px;
    transform: none !important;
  }
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  animation: heroFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
  will-change: transform, opacity;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.9));
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.3s ease;
  will-change: filter;
}

@media (min-width: 520px) {
  .brand-logo {
    height: 44px;
  }
}

@media (min-width: 769px) {
  .brand-block {
    gap: 7px;
  }
  .brand-logo {
    height: 52px;
  }
}

.brand-logo-link:hover .brand-logo {
  opacity: 0.9;
  transform: scale(1.02);
}

/* TOP BAR RIGHT WRAPPER */
.top-bar-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* EDITORIAL HEADER MENU BUTTON (FADES IN ON WHITE SCREEN) */
.header-menu-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: #FFFFFF;
  color: #111317;
  border: 1.5px solid #111317;
  border-radius: var(--radius-full, 9999px);
  padding: 8px 16px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
  will-change: opacity, transform;
  user-select: none;
  z-index: 15;
}

.header-menu-btn:hover {
  background: #111317;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transform: translateY(-50%) scale(1.02);
}

.header-menu-btn:hover .menu-btn-label {
  color: #FFFFFF;
}

.header-menu-btn:hover .menu-line {
  background-color: #FFFFFF;
}

.header-menu-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.menu-btn-label {
  font-family: var(--font-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #111317;
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.2s ease;
}

.menu-btn-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 14px;
  height: 10px;
}

.menu-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: #111317;
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

/* MINIMALIST CIRCULAR CLOSE BUTTON */
.header-close-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(17, 19, 23, 0.15);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  color: #111317;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.header-close-btn:hover {
  background: #111317;
  color: #FFFFFF;
  border-color: #111317;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.header-close-btn:hover svg {
  stroke: #FFFFFF;
}

.header-close-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* MENU ACTIVE STATE */
.top-bar.menu-active {
  z-index: 1005 !important;
  pointer-events: none !important;
}

.top-bar.menu-active .header-menu-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-50%) scale(0.85) !important;
}

.top-bar.menu-active .rewards-card-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.85) !important;
}

.top-bar.menu-active .brand-logo {
  filter: brightness(1) drop-shadow(0 2px 12px rgba(0, 0, 0, 0.9)) !important;
}

.top-bar.menu-active .header-close-btn {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(-50%) scale(1) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #FFFFFF !important;
}

.top-bar.menu-active .header-close-btn svg {
  stroke: #FFFFFF !important;
}

/* REALISTIC VIP BLACK DEBIT CARD */
.rewards-card-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 108px;
  height: 68px; /* 1.586:1 ISO ratio */
  display: inline-block;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  flex-shrink: 0;
  perspective: 800px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  animation: heroFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
  will-change: transform, opacity;
}

.card-face {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px 5px;
  background: linear-gradient(135deg, #242730 0%, #121419 45%, #0B0C0E 100%);
  border: 1px solid rgba(230, 0, 46, 0.55);
  border-radius: 6.5px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.chip-and-wave {
  display: flex;
  align-items: center;
  gap: 3.5px;
}

.debit-chip {
  width: 15px;
  height: 11px;
  background: linear-gradient(135deg, #FF4D6D 0%, #E6002E 50%, #8B0019 100%);
  border-radius: 2px;
  position: relative;
  border: 0.5px solid #6E4F0D;
  display: block;
  box-shadow: inset 0 0.5px 0.5px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.chip-line-h1 {
  position: absolute;
  left: 0;
  top: 36%;
  width: 100%;
  height: 0.5px;
  background: rgba(0, 0, 0, 0.45);
}

.chip-line-h2 {
  position: absolute;
  left: 0;
  top: 64%;
  width: 100%;
  height: 0.5px;
  background: rgba(0, 0, 0, 0.45);
}

.chip-line-v {
  position: absolute;
  top: 0;
  left: 45%;
  height: 100%;
  width: 0.5px;
  background: rgba(0, 0, 0, 0.45);
}

.contactless-wave {
  width: 8px;
  height: 8px;
  stroke: rgba(230, 0, 46, 0.8);
  flex-shrink: 0;
}

.card-issuer {
  font-family: var(--font-mono);
  font-size: 0.41rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #E6002E;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  line-height: 1;
  white-space: nowrap;
}

.card-row-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: auto 0;
}

.card-action-text {
  font-family: var(--font-primary);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.card-row-bot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.card-perk-text {
  font-family: var(--font-primary);
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #E6002E;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  line-height: 1;
  white-space: nowrap;
}

.card-glint {
  position: absolute;
  top: -60%;
  left: -120%;
  width: 60%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  animation: cardSweep 6s infinite ease-in-out;
}

@keyframes cardSweep {
  0%, 70% { left: -120%; }
  100% { left: 180%; }
}

.rewards-card-btn:hover .card-face {
  transform: translateY(-2px);
  border-color: rgba(253, 230, 138, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.rewards-card-btn:active .card-face {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Entrance Keyframes */
@keyframes cinematicBrandIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cinematicCardIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
