/**
 * Swipe Cards - Apple Pro Design
 * Premium glassmorphic UI
 */

:root {
  --sg-gold: #f9cb00;
  --sg-gold-glow: rgba(249, 203, 0, 0.35);
  --sg-red: #ff3b5c;
  --sg-dark: #1c1c1e;
  --sg-surface: #2c2c2e;
}

/* Desktop: Hidden */
.swipe-cards-container,
.favorites-drawer,
.swipe-intro-overlay {
  display: none;
}

/* ============================================
   GRID HEART BUTTONS
   ============================================ */
.grid-heart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.grid-heart-btn:active {
  transform: scale(0.9);
}

.grid-heart-btn.is-favorited {
  color: var(--sg-red);
}

/* Double-tap heart */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 100px;
  color: var(--sg-red);
  pointer-events: none;
  z-index: 100;
  animation: heartPop 0.8s cubic-bezier(0.17, 0.67, 0.21, 1.25) forwards;
  filter: drop-shadow(0 0 40px rgba(255, 59, 92, 0.7));
}

@keyframes heartPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ============================================
   MOBILE STYLES
   ============================================ */
@media (max-width: 767px) {

  /* INTRO OVERLAY - Solid & Visible */
  .swipe-intro-overlay {
    display: flex !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .swipe-intro-content {
    text-align: center;
    max-width: 340px;
    width: 100%;
    background: var(--sg-surface);
    border-radius: 32px;
    padding: 44px 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  }

  .swipe-intro-logo {
    display: none;
  }

  .swipe-intro-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
  }

  .swipe-intro-brand .intro-brand-icon {
    width: 56px;
    height: 56px;
  }

  .swipe-intro-brand .intro-brand-logo {
    height: 48px;
    width: auto;
    /* Yellow/gold tint for dark background */
    filter: brightness(0) saturate(100%) invert(78%) sepia(68%) saturate(725%) hue-rotate(6deg) brightness(103%) contrast(101%);
  }

  .swipe-intro-brand .intro-brand-icon {
    width: 80px;
    height: 80px;
    /* Icon is already gold */
  }

  .swipe-intro-brand .intro-brand-text {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
  }

  .swipe-intro-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 36px;
    font-weight: 500;
  }

  .swipe-intro-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    text-align: center;
  }

  .swipe-intro-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 340px;
  }

  .swipe-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .swipe-option-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(249, 203, 0, 0.3);
  }

  .swipe-option-card:active {
    transform: scale(0.98);
  }

  .option-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .option-icon.swipe-icon {
    background: linear-gradient(135deg, var(--sg-gold) 0%, #e6b800 100%);
    color: #1a1a2e;
  }

  .option-icon.grid-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }

  .option-content {
    flex: 1;
    text-align: left;
  }

  .option-title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
  }

  .option-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
  }

  .option-arrow {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
  }

  /* Legacy button styles (fallback) */
  .swipe-intro-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px 28px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .swipe-mode-btn {
    background: var(--sg-gold);
    color: #000;
  }

  .scroll-mode-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  /* HIDE PAGE IN SWIPE MODE */
  body.swipe-mode {
    overflow: hidden !important;
  }

  body.swipe-mode .page-wrapper {
    display: none !important;
  }

  body.swipe-mode #chatbase-bubble-button,
  body.swipe-mode [id*="chatbase"] {
    display: none !important;
  }

  /* MAIN CONTAINER */
  .swipe-cards-container {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #000 0%, #0d0d0d 100%);
    z-index: 999999;
  }

  /* TOP BAR */
  .swipe-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    position: relative;
    min-height: 56px;
  }

  /* SCROLL BUTTON - Pill with icon and text */
  .swipe-scroll-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .swipe-scroll-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.18);
  }

  .swipe-scroll-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
  }

  .swipe-scroll-btn span {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
  }

  /* Hide old back button if exists */
  .swipe-back-btn {
    display: none;
  }

  .swipe-topbar-title {
    display: none;
  }

  .swipe-topbar-logo {
    display: none;
  }

  /* Branded Logo in Header */
  .swipe-topbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .swipe-topbar-brand .brand-icon {
    width: 28px;
    height: 28px;
    /* Icon is already gold */
  }

  .swipe-topbar-brand .brand-logo {
    height: 28px;
    width: auto;
    max-width: 160px;
    /* Yellow/gold tint for dark background */
    filter: brightness(0) saturate(100%) invert(78%) sepia(68%) saturate(725%) hue-rotate(6deg) brightness(103%) contrast(101%);
    object-fit: contain;
  }

  .swipe-topbar-brand .brand-text {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--sg-gold);
    letter-spacing: -0.3px;
  }

  /* FAVORITES BUTTON - Thumbnail with heart badge */
  .swipe-favorites-btn {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .swipe-favorites-btn:active {
    transform: scale(0.95);
  }

  .fav-thumb-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: visible;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(249, 203, 0, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .fav-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
  }

  .fav-thumb-empty {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .fav-thumb-empty::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23ff4757' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
    opacity: 0.4;
  }

  .fav-thumb-heart {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    fill: var(--sg-red);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    z-index: 5;
    background: #1a1a2e;
    border-radius: 50%;
    padding: 4px;
    box-sizing: content-box;
  }

  /* Counter badge - small pill showing total favorites */
  .swipe-favorites-btn .fav-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--sg-gold);
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  }

  /* CARD STACK - PERFECTLY CENTERED */
  .swipe-card-stack {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    min-height: 0;
  }

  /* CARDS - Centered with proper transform */
  .swipe-card {
    position: absolute;
    width: calc(100% - 40px);
    max-width: 360px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .swipe-card:active {
    cursor: grabbing;
  }

  /* Stack effect */
  .swipe-card:nth-child(2) {
    transform: translate(-50%, calc(-50% + 10px)) scale(0.95);
    z-index: -1;
    filter: brightness(0.88);
  }

  .swipe-card:nth-child(3) {
    transform: translate(-50%, calc(-50% + 20px)) scale(0.90);
    z-index: -2;
    filter: brightness(0.76);
  }

  .swipe-card:nth-child(n+4) {
    visibility: hidden;
  }

  .swipe-card.dragging {
    transition: none !important;
    z-index: 100;
  }

  /* CARD IMAGE */
  .swipe-card-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  }

  /* VIEW BUTTON */
  .swipe-card-view-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 100px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .swipe-card-view-btn:active {
    transform: scale(0.95);
  }

  .swipe-card-view-btn svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 2;
  }

  .swipe-card-view-btn::after {
    content: 'View';
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
  }

  /* CARD CONTENT */
  .swipe-card-content {
    padding: 20px 22px 24px;
    background: #fff;
  }

  .swipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .swipe-card-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--sg-dark);
    line-height: 1.2;
    flex: 1;
    letter-spacing: -0.4px;
  }

  .swipe-card-material {
    background: var(--sg-dark);
    color: var(--sg-gold);
    padding: 6px 14px;
    border-radius: 100px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  /* SPECS - Rounded Pills */
  .swipe-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .swipe-card-spec {
    display: inline-flex;
    flex-direction: column;
    padding: 12px 18px;
    background: #f2f2f7;
    border-radius: 16px;
  }

  .spec-label {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10px;
    color: #8e8e93;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
  }

  .spec-value {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--sg-dark);
    font-weight: 600;
  }

  /* SWIPE INDICATORS */
  .swipe-indicator {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 20;
  }

  .swipe-indicator svg {
    width: 32px;
    height: 32px;
  }

  .swipe-indicator.like {
    right: 20px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: var(--sg-gold);
    box-shadow: 0 8px 30px var(--sg-gold-glow);
  }

  .swipe-indicator.like svg {
    fill: #000;
  }

  .swipe-indicator.nope {
    left: 20px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: var(--sg-red);
    box-shadow: 0 8px 30px rgba(255, 59, 92, 0.4);
  }

  .swipe-indicator.nope svg {
    stroke: #fff;
    stroke-width: 3;
  }

  /* Hide super like indicator - only left/right now */
  .swipe-indicator.super {
    display: none;
  }

  .swipe-card.swiping-right .swipe-indicator.like,
  .swipe-card.swiping-left .swipe-indicator.nope {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  /* SWIPE ANIMATIONS */
  .swipe-card.swipe-out-left {
    animation: swipeLeft 0.35s ease-out forwards;
  }

  .swipe-card.swipe-out-right {
    animation: swipeRight 0.35s ease-out forwards;
  }

  @keyframes swipeLeft {
    to { transform: translate(-150%, -50%) rotate(-25deg); opacity: 0; }
  }

  @keyframes swipeRight {
    to { transform: translate(50%, -50%) rotate(25deg); opacity: 0; }
  }

  /* FLOATING ACTION BUTTONS - Tinder Style */
  .swipe-action-buttons {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
  }

  .swipe-action-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .swipe-action-btn:active {
    transform: scale(0.9);
  }

  /* Action buttons - base styles */
  .swipe-action-btn {
    position: relative;
  }

  /* Tooltip styles */
  .swipe-action-btn .btn-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
  }

  .swipe-action-btn:active .btn-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  /* Undo button - Yellow/Gold with dark icon */
  .swipe-action-btn.undo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--sg-gold);
    border: 3px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 20px var(--sg-gold-glow), inset 0 2px 0 rgba(255,255,255,0.2);
  }

  .swipe-action-btn.undo svg {
    width: 30px;
    height: 30px;
    color: #1a1a2e;
    stroke-width: 2.5;
  }

  .swipe-action-btn.undo:active {
    background: #e6b800;
    transform: scale(0.92);
  }

  /* Nope button - Solid Red with white X */
  .swipe-action-btn.nope {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757 0%, #ff3b5c 100%);
    border: 3px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 24px rgba(255, 59, 92, 0.5), inset 0 2px 0 rgba(255,255,255,0.2);
  }

  .swipe-action-btn.nope svg {
    width: 38px;
    height: 38px;
    color: #fff;
    stroke-width: 3;
  }

  .swipe-action-btn.nope:active {
    background: linear-gradient(135deg, #e6325a 0%, #d42d4f 100%);
    transform: scale(0.92);
  }

  /* Like button - Bright Green with white heart */
  .swipe-action-btn.like {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ed573 0%, #26c666 100%);
    border: 3px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 24px rgba(46, 213, 115, 0.5), inset 0 2px 0 rgba(255,255,255,0.2);
  }

  .swipe-action-btn.like svg {
    width: 38px;
    height: 38px;
    color: #fff;
    fill: #fff;
  }

  .swipe-action-btn.like:active {
    background: linear-gradient(135deg, #26b365 0%, #1fa855 100%);
    transform: scale(0.92);
  }

  /* Hide old elements */
  .swipe-bottom-bar,
  .swipe-counter,
  .swipe-undo-btn {
    display: none !important;
  }

  /* ==========================================
     SWIPE INSTRUCTIONS - SOLID & VISIBLE
     ========================================== */
  .swipe-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--sg-surface);
    padding: 28px 40px;
    border-radius: 28px;
    display: flex;
    gap: 36px;
    z-index: 10000;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
  }

  .swipe-instructions.fade-out {
    animation: fadeOut 0.3s ease forwards;
  }

  @keyframes fadeOut {
    to { opacity: 0; transform: translate(-50%, -55%); }
  }

  .swipe-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .swipe-hint svg {
    width: 36px;
    height: 36px;
  }

  .swipe-hint span {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .swipe-hint.left svg { stroke: var(--sg-red); stroke-width: 2.5; }
  .swipe-hint.left span { color: var(--sg-red); }

  .swipe-hint.up svg { stroke: var(--sg-gold); stroke-width: 2.5; }
  .swipe-hint.up span { color: var(--sg-gold); }

  .swipe-hint.right svg { fill: var(--sg-gold); }
  .swipe-hint.right span { color: var(--sg-gold); }

  /* LOGIN PROMPT */
  .swipe-login-prompt {
    position: fixed;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sg-surface);
    color: #fff;
    padding: 24px 28px;
    border-radius: 24px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    width: calc(100% - 48px);
  }

  .swipe-login-prompt p {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0 0 18px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
  }

  .swipe-login-btn {
    display: inline-block;
    background: var(--sg-gold);
    color: #000;
    padding: 14px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 24px var(--sg-gold-glow);
  }

  /* FAVORITES DRAWER */
  .favorites-drawer {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--sg-dark);
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1000001;
    max-height: 65vh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .favorites-drawer.open {
    transform: translateY(0);
  }

  .favorites-drawer-handle {
    padding: 16px 20px;
    text-align: center;
    cursor: pointer;
  }

  .favorites-drawer-handle::before {
    content: '';
    display: block;
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin: 0 auto 14px;
  }

  .favorites-drawer-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-weight: 600;
    color: #fff;
    font-size: 18px;
  }

  .favorites-count {
    background: var(--sg-gold);
    color: #000;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 10px;
  }

  .favorites-empty {
    text-align: center;
    padding: 36px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
  }

  .favorites-list {
    display: flex;
    gap: 14px;
    padding: 0 20px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .favorites-list::-webkit-scrollbar {
    display: none;
  }

  .favorite-item {
    flex-shrink: 0;
    width: 100px;
    text-align: center;
    text-decoration: none;
  }

  .favorite-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid rgba(249, 203, 0, 0.3);
  }

  .favorite-item span {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .favorite-item {
    position: relative;
  }

  .favorite-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sg-red);
    border: 2px solid var(--sg-dark);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .favorite-remove:active {
    transform: scale(0.9);
  }

  .favorites-actions {
    padding: 12px 20px 24px;
    display: flex;
    justify-content: center;
  }

  .favorites-view-all {
    background: var(--sg-gold);
    color: #000;
    padding: 14px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 24px var(--sg-gold-glow);
    border: none;
    cursor: pointer;
  }

  /* Hint text for drag to close */
  .favorites-drawer-handle::after {
    content: 'Drag down to close';
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
  }

  /* EMPTY STATE */
  .swipe-empty {
    text-align: center;
    padding: 48px 32px;
    max-width: 320px;
    margin: 0 auto;
  }

  .swipe-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
  }

  .swipe-empty h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 26px;
    color: #fff;
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }

  .swipe-empty p {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 32px;
    font-size: 16px;
    line-height: 1.5;
  }

  .swipe-reset-btn {
    background: var(--sg-gold);
    color: #000;
    border: none;
    padding: 16px 36px;
    border-radius: 100px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 30px var(--sg-gold-glow);
  }

  .swipe-view-saved-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    padding: 16px 36px;
    border-radius: 100px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: 16px;
    margin-top: 14px;
    cursor: pointer;
  }
}

/* ============================================
   LOCAL FAVORITES OVERLAY
   ============================================ */
.local-favorites-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 1000000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.local-favorites-content {
  width: 100%;
  max-width: 480px;
  background: var(--sg-surface);
  border-radius: 28px;
  padding: 28px;
  margin: 20px 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.local-favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.local-favorites-header h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.3px;
}

.local-favorites-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.local-favorites-note {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-bottom: 24px;
  padding: 16px 18px;
  background: rgba(249, 203, 0, 0.12);
  border-radius: 16px;
  border-left: 4px solid var(--sg-gold);
  line-height: 1.5;
}

.local-favorites-note a {
  color: var(--sg-gold);
  font-weight: 600;
  text-decoration: none;
}

.local-favorites-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.local-favorite-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.local-favorite-card:active {
  transform: scale(0.97);
}

.local-favorite-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.local-favorite-info {
  padding: 14px 16px;
}

.local-favorite-title {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.local-favorite-material {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}
