/*
 * JO-Dealz - Consolidated Desktop Premium Styles
 * Merged from desktop-redesign.css + premium-desktop.css + desktop-premium-v2.css
 * Scoped to md/lg breakpoints; do not apply to mobile.
 */

/* 
 * JO-Dealz - Desktop Premium Redesign (WebView / Desktop Only)
 * DO NOT apply to mobile elements or breakpoints.
 */

:root {
  --ds-desktop-radius-sm: 12px;
  --ds-desktop-radius-md: 18px;
  --ds-desktop-radius-lg: 28px;
  --ds-desktop-radius-xl: 36px;

  --ds-desktop-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
  --ds-desktop-shadow-float: 0 20px 50px rgba(245, 42, 59, 0.08), 0 4px 12px rgba(245, 42, 59, 0.02);
  --ds-desktop-shadow-glow: 0 0 25px rgba(245, 42, 59, 0.25);
  --ds-desktop-shadow-card: 0 20px 48px -10px rgba(15, 23, 42, 0.08), 0 4px 12px -4px rgba(15, 23, 42, 0.02);
  --ds-desktop-shadow-header: 0 12px 36px rgba(15, 23, 42, 0.04);
  --ds-desktop-shadow-dropdown: 0 24px 64px -12px rgba(15, 23, 42, 0.12), 0 8px 24px -4px rgba(15, 23, 42, 0.04);

  --ds-desktop-transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ds-desktop-transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  
  --premium-primary: #F52A3B;
  --premium-primary-hover: #B50045;
  --premium-secondary: #FF7A2F;
  --premium-gradient-main: linear-gradient(135deg, #F52A3B 0%, #B50045 100%);
  --premium-gradient-warm: linear-gradient(135deg, #FF7A2F 0%, #F52A3B 100%);
  --premium-gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
}

/* Dark mode overrides */
.dark {
  --ds-desktop-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
  --ds-desktop-shadow-float: 0 20px 50px rgba(0, 0, 0, 0.3);
  --ds-desktop-shadow-card: 0 20px 48px -10px rgba(0, 0, 0, 0.4);
  --ds-desktop-shadow-header: 0 12px 36px rgba(0, 0, 0, 0.2);
  --ds-desktop-shadow-dropdown: 0 24px 64px -12px rgba(0, 0, 0, 0.5);
  --premium-gradient-glass: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
}

@media (min-width: 1024px) {
  /* =========================================
     1. GLOBAL TYPOGRAPHY, SCROLLBAR & BASE
     ========================================= */
  body {
    letter-spacing: -0.015em;
    background-color: #F8FAFC;
    color: #0F172A;
    font-family: 'Plus Jakarta Sans', 'Cairo', system-ui, sans-serif;
  }
  
  .dark body {
    background-color: #0B0F19;
    color: #F1F5F9;
  }
  
  h1, h2, h3, h4, .font-display {
    letter-spacing: -0.025em !important;
    font-family: 'Plus Jakarta Sans', 'Cairo', system-ui, sans-serif;
  }

  .max-w-7xl, .max-w-6xl {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }

  /* Custom elegant scrollbar for web view */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.25);
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  .dark ::-webkit-scrollbar-thumb {
    background: rgba(241, 245, 249, 0.1);
  }
  .dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(241, 245, 249, 0.25);
  }

  /* =========================================
     2. STICKY HEADER & NAV Redesign
     ========================================= */
  #main-header {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04) !important;
    transition: background 0.3s var(--ds-desktop-transition-smooth), 
                box-shadow 0.3s var(--ds-desktop-transition-smooth),
                border-color 0.3s var(--ds-desktop-transition-smooth) !important;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01) !important;
  }

  .dark #main-header {
    background: rgba(11, 15, 25, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  }

  #main-header.scrolled {
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: var(--ds-desktop-shadow-header) !important;
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
  }
  
  .dark #main-header.scrolled {
    background: rgba(11, 15, 25, 0.94) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  }

  /* Header Navigation Links with modern underline slider */
  #main-header nav a {
    position: relative;
    color: #475569;
    transition: color 0.25s var(--ds-desktop-transition-smooth);
    padding: 0.5rem 0.2rem;
  }
  .dark #main-header nav a {
    color: #94A3B8;
  }

  #main-header nav a:hover {
    color: var(--premium-primary);
  }
  .dark #main-header nav a:hover {
    color: #FFF;
  }

  #main-header nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--premium-gradient-main);
    transition: width 0.3s var(--ds-desktop-transition-bounce);
    border-radius: 99px;
  }

  #main-header nav a:hover::after,
  #main-header nav a.active::after {
    width: 100%;
  }

  /* Rounded Minimal Search in Header */
  #header-search-input {
    border-radius: 99px !important;
    background: #F1F5F9 !important;
    border: 1px solid rgba(15, 23, 42, 0.02) !important;
    transition: all 0.3s var(--ds-desktop-transition-smooth) !important;
    color: #0F172A;
  }
  
  .dark #header-search-input {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.02) !important;
    color: #F1F5F9;
  }

  #header-search-input:focus {
    background: #FFFFFF !important;
    border-color: rgba(245, 42, 59, 0.2) !important;
    box-shadow: var(--ds-desktop-shadow-glow) !important;
  }
  .dark #header-search-input:focus {
    background: #0B0F19 !important;
  }

  /* Dropdown Styles (City dropdown, user dashboard dropdown) */
  #city-selector-dropdown {
    border-radius: var(--ds-desktop-radius-md) !important;
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
    box-shadow: var(--ds-desktop-shadow-dropdown) !important;
    animation: dsPopIn 0.3s var(--ds-desktop-transition-bounce) forwards;
    background: #FFFFFF;
  }
  .dark #city-selector-dropdown {
    background: #151B2C;
    border-color: rgba(255, 255, 255, 0.05) !important;
  }
  
  @keyframes dsPopIn {
    from { opacity: 0; transform: translate(-50%, 10px) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }

  /* =========================================
     3. HIGH-END HERO SECTION
     ========================================= */
  #hero-section {
    position: relative;
    overflow: hidden;
  }
  
  .dark #hero-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  }

  /* Redesigned Hero Search Bar (supports both .hero-search-glass and .premium-hero-search) */
  #hero-section .hero-search-glass,
  #hero-section .premium-hero-search {
    background: #FFFFFF;
    border-radius: 99px !important;
    box-shadow: var(--ds-desktop-shadow-float) !important;
    border: 1.5px solid rgba(245, 42, 59, 0.12);
    transition: all 0.3s var(--ds-desktop-transition-smooth);
    display: flex;
    align-items: center;
  }

  .dark #hero-section .hero-search-glass,
  .dark #hero-section .premium-hero-search {
    background: #141A28;
    border-color: rgba(255, 255, 255, 0.08);
  }

  #hero-section .hero-search-glass:focus-within,
  #hero-section .premium-hero-search:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 25px 60px -10px rgba(245, 42, 59, 0.18), 0 0 0 4px rgba(245, 42, 59, 0.08) !important;
    border-color: rgba(245, 42, 59, 0.45);
  }

  /* =========================================
     4. PREMIUM DEAL CARDS
     ========================================= */
  .deal-card {
    border-radius: var(--ds-desktop-radius-lg) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    box-shadow: var(--ds-desktop-shadow-soft) !important;
    transition: all 0.4s var(--ds-desktop-transition-smooth) !important;
    background: #FFFFFF !important;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .dark .deal-card {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
  }

  .deal-card:hover {
    transform: translateY(-8px) scale(1.01) !important;
    box-shadow: var(--ds-desktop-shadow-card) !important;
    border-color: rgba(245, 42, 59, 0.15) !important;
  }

  /* Image Wrap within card */
  .deal-card .relative.overflow-hidden {
    border-radius: var(--ds-desktop-radius-lg) var(--ds-desktop-radius-lg) 0 0 !important;
    aspect-ratio: 16/10;
  }

  .deal-card img {
    transition: transform 0.8s var(--ds-desktop-transition-smooth) !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .deal-card:hover img {
    transform: scale(1.06) !important;
  }

  /* Favorite Button Styling on Card */
  .deal-card button.absolute {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.3s var(--ds-desktop-transition-bounce);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
  .dark .deal-card button.absolute {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94A3B8;
  }

  .deal-card button.absolute:hover {
    transform: scale(1.1);
    background: #FFFFFF;
    color: var(--premium-primary);
  }
  .dark .deal-card button.absolute:hover {
    background: #151B2C;
  }

  /* Discount Badge Style */
  .deal-card .absolute.top-3.left-3,
  .deal-card .absolute.top-3.right-3 {
    background: var(--premium-gradient-main);
    color: #FFFFFF !important;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(245, 42, 59, 0.25);
  }

  /* Deal Card Content Details styling */
  .deal-card-content {
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .deal-card .font-display {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #0F172A;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.2rem;
  }
  .dark .deal-card .font-display {
    color: #F1F5F9;
  }

  .deal-card-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.03);
    margin-top: auto;
    padding-top: 1rem;
  }
  .dark .deal-card-footer {
    border-top-color: rgba(255, 255, 255, 0.03);
  }

  /* =========================================
     5. CATEGORIES & BRANDS REDESIGN
     ========================================= */
  .category-card, .premium-cat-card {
    border-radius: var(--ds-desktop-radius-lg, 24px) !important;
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 1.75rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(0) !important;
  }

  .dark .category-card, .dark .premium-cat-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8)) !important;
    border-color: rgba(51, 65, 85, 0.5) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  }

  .category-card:hover, .premium-cat-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(245, 42, 59, 0.15) !important;
  }

  .premium-cat-icon-container {
    width: 76px !important;
    height: 76px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #f1f5f9, #ffffff) !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 4px 8px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(241, 245, 249, 0.9) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
  }
  .dark .premium-cat-icon-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(51, 65, 85, 0.4)) !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(71, 85, 105, 0.5) !important;
  }

  .category-card:hover .premium-cat-icon-container,
  .premium-cat-card:hover .premium-cat-icon-container {
    transform: scale(1.1) rotate(5deg);
    background: var(--premium-gradient-main) !important;
    color: #FFFFFF !important;
  }
  
  .category-card:hover .premium-cat-icon-container i,
  .premium-cat-card:hover .premium-cat-icon-container i {
    color: #FFFFFF !important;
  }

  .premium-cat-icon-container i {
    font-size: 1.85rem !important;
    color: var(--premium-primary);
    transition: color 0.3s ease;
  }

  /* =========================================
     6. BUTTONS & MICRO-INTERACTIONS
     ========================================= */
  .btn-premium,
  .btn-premium-primary {
    background: var(--premium-gradient-main) !important;
    color: #FFFFFF !important;
    border: none;
    border-radius: 99px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 25px -4px rgba(245, 42, 59, 0.35) !important;
    transition: all 0.3s var(--ds-desktop-transition-bounce) !important;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
  }

  .btn-premium::before,
  .btn-premium-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #FF7A2F 0%, #F52A3B 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: inherit;
  }

  .btn-premium span, .btn-premium-primary span,
  .btn-premium i, .btn-premium-primary i {
    position: relative;
    z-index: 2;
  }

  .btn-premium:hover::before,
  .btn-premium-primary:hover::before {
    opacity: 1;
  }

  .btn-premium:hover,
  .btn-premium-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px -4px rgba(245, 42, 59, 0.5) !important;
  }

  .btn-premium-outline {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 99px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    transition: all 0.3s var(--ds-desktop-transition-bounce) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dark .btn-premium-outline {
    background: rgba(21, 27, 44, 0.85);
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94A3B8 !important;
  }

  .btn-premium-outline:hover {
    background: #FFFFFF;
    color: var(--premium-primary) !important;
    border-color: rgba(245, 42, 59, 0.25) !important;
    transform: translateY(-3px);
    box-shadow: var(--ds-desktop-shadow-soft);
  }
  .dark .btn-premium-outline:hover {
    background: #151B2C;
  }

  /* =========================================
     7. SECTIONS & LAYOUT (GRID)
     ========================================= */
  .section-header h2 {
    font-size: 2.3rem !important;
    font-weight: 800 !important;
    position: relative;
    display: inline-block;
    color: #0F172A;
  }
  .dark .section-header h2 {
    color: #F1F5F9;
  }
  
  .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--premium-gradient-main);
    border-radius: 99px;
  }
  
  [dir="rtl"] .section-header h2::after {
    left: auto;
    right: 0;
  }
  
  /* (Removed blanket `section { padding: 5rem !important }` — it overrode every
     page's own section spacing and produced large dead gaps. Rhythm is now set
     per-context in section 10 below.) */

  /* =========================================
     8. FOOTER OVERHAUL
     ========================================= */
  #main-footer {
    background: linear-gradient(to bottom, #0B0F19, #05070B) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.02) !important;
    padding-top: 6rem !important;
    padding-bottom: 4rem !important;
  }

  #main-footer h3 {
    color: #FFFFFF !important;
    font-size: 1.15rem !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.75rem !important;
  }

  #main-footer .footer-col-links a {
    color: #94A3B8 !important;
    font-size: 0.95rem !important;
    transition: all 0.25s var(--ds-desktop-transition-smooth) !important;
    display: inline-block;
    padding: 0.25rem 0;
  }

  #main-footer .footer-col-links a:hover {
    color: var(--premium-primary) !important;
    transform: translateX(6px);
  }
  
  [dir="rtl"] #main-footer .footer-col-links a:hover {
    transform: translateX(-6px);
  }

  /* =========================================================================
     9. COMPREHENSIVE OVERRIDES FOR ALL INNER PAGES (DEAL, CATEGORIES, STORE, ETC.)
     ========================================================================= */

  /* A. Deal Details Page overrides (deal.php) */
  .deal-hero {
    border-radius: var(--ds-desktop-radius-lg) !important;
    box-shadow: var(--ds-desktop-shadow-card) !important;
    border: 1px solid rgba(15, 23, 42, 0.04);
    overflow: hidden;
  }
  
  .deal-merchant-card, .deal-stat-card, .deal-tabs-wrapper {
    border-radius: var(--ds-desktop-radius-md) !important;
    box-shadow: var(--ds-desktop-shadow-soft) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    transition: all 0.3s var(--ds-desktop-transition-smooth) !important;
  }
  
  .deal-merchant-card:hover, .deal-stat-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--ds-desktop-shadow-card) !important;
    border-color: rgba(245, 42, 59, 0.15) !important;
  }
  
  .deal-tab-btn {
    border-radius: 99px !important;
    transition: all 0.25s ease !important;
    font-weight: 700 !important;
  }
  
  .deal-tab-btn.active {
    background: var(--premium-gradient-main) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(245, 42, 59, 0.2) !important;
  }

  /* B. Categories & Search Filter Cards (categories.php, search.php) */
  .filter-sidebar, .search-filter-card {
    border-radius: var(--ds-desktop-radius-md) !important;
    background: #FFFFFF !important;
    box-shadow: var(--ds-desktop-shadow-soft) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    padding: 1.5rem !important;
  }
  
  .dark .filter-sidebar, .dark .search-filter-card {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
  }
  
  .filter-chip, .keyword-chip {
    border-radius: 99px !important;
    padding: 0.5rem 1.2rem !important;
    font-weight: 600 !important;
    transition: all 0.25s var(--ds-desktop-transition-smooth) !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    cursor: pointer;
    background: transparent;
  }
  
  .filter-chip:hover, .keyword-chip:hover {
    border-color: rgba(245, 42, 59, 0.2) !important;
    color: var(--premium-primary) !important;
    background: rgba(245, 42, 59, 0.02) !important;
  }
  
  .filter-chip.active, .keyword-chip.active {
    background: var(--premium-gradient-main) !important;
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(245, 42, 59, 0.2) !important;
  }

  /* C. Store Page layout (store.php) */
  .store-header-card {
    border-radius: var(--ds-desktop-radius-lg) !important;
    background: #FFFFFF !important;
    box-shadow: var(--ds-desktop-shadow-card) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    overflow: hidden;
  }
  
  .dark .store-header-card {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
  }
  
  .store-banner-wrap {
    aspect-ratio: 21/6 !important;
    overflow: hidden;
    position: relative;
  }

  /* D. Authentication & User Profile Cards (login.php, register.php, profile.php) */
  .auth-card, .profile-card, .dashboard-widget-card {
    border-radius: var(--ds-desktop-radius-lg) !important;
    background: #FFFFFF !important;
    box-shadow: var(--ds-desktop-shadow-dropdown) !important;
    border: 1px solid rgba(15, 23, 42, 0.04) !important;
    padding: 2.5rem !important;
    transition: all 0.3s ease;
  }
  
  .dark .auth-card, .dark .profile-card, .dark .dashboard-widget-card {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
  }
  
  /* Modern clean form inputs */
  .auth-input, .profile-input, select.form-select, textarea.form-textarea {
    border-radius: var(--ds-desktop-radius-sm) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    padding: 0.75rem 1rem !important;
    background: #F8FAFC !important;
    color: #0F172A !important;
    transition: all 0.25s var(--ds-desktop-transition-smooth) !important;
    font-weight: 500;
  }
  
  .dark .auth-input, .dark .profile-input, .dark select.form-select, .dark textarea.form-textarea {
    background: #1C2333 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #F1F5F9 !important;
  }
  
  .auth-input:focus, .profile-input:focus, select.form-select:focus, textarea.form-textarea:focus {
    border-color: rgba(245, 42, 59, 0.3) !important;
    box-shadow: var(--ds-desktop-shadow-glow) !important;
    background: #FFFFFF !important;
    outline: none !important;
  }
  
  .dark .auth-input:focus, .dark .profile-input:focus, .dark select.form-select:focus, .dark textarea.form-textarea:focus {
    background: #0B0F19 !important;
  }
}

/* 
 * JO-Dealz Premium Desktop Redesign
 * Applied only on md (768px) and above.
 * Ensure to never override mobile styling!
 */

@media (min-width: 768px) {
    :root {
        --premium-primary: #F52A3B;
        --premium-secondary: #FF7A2F;
        --premium-accent: #FFC61A;
        --premium-bg: #F8FAFC;
        --premium-card-bg: #FFFFFF;
        --premium-card-hover: #FFF1F2;
        
        --glass-bg: rgba(255, 255, 255, 0.75);
        --glass-border: rgba(255, 255, 255, 0.4);
        --glass-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
    }

    body {
        font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
        background-color: var(--premium-bg);
        -webkit-font-smoothing: antialiased;
        color: #111827;
        /* Center the app horizontally and add max-width if it's acting as a web view */
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    /* Wrap the entire app content to prevent over-stretching */
    #app-content-wrapper, .main-wrapper {
        width: 100%;
        /* Full-bleed: pages constrain themselves with .max-w-7xl (1280px incl. gutters) so
           header, page content and footer all share one container grid. */
        max-width: none;
        margin: 0 auto;
        position: relative;
    }

    /* Typography */
    .premium-hero-text { font-size: 64px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
    .premium-section-title { font-size: 40px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 2rem; }
    .premium-card-title { font-size: 20px; font-weight: 600; line-height: 1.3; }
    .premium-body-text { font-size: 16px; line-height: 1.6; }

    /* Glassmorphism */
    .premium-glass {
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--glass-border);
        box-shadow: var(--glass-shadow);
    }

    /* Buttons */
    .btn-premium-primary {
        background: linear-gradient(135deg, #F52A3B 0%, #FF7A2F 100%);
        color: white;
        border-radius: 16px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        border: none;
        box-shadow: 0 4px 14px 0 rgba(245, 42, 59, 0.39);
    }
    
    .btn-premium-primary:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 6px 20px rgba(245, 42, 59, 0.5);
    }

    /* Header */
    .premium-header {
        position: sticky;
        top: 0;
        z-index: 100;
        height: 80px;
        transition: all 0.3s ease;
    }
    .premium-header.scrolled {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .premium-nav-link {
        position: relative;
        font-weight: 500;
        color: #374151;
        transition: color 0.2s;
    }
    .premium-nav-link:hover { color: var(--premium-primary); }
    .premium-nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 0;
        background-color: var(--premium-primary);
        transition: width 0.3s ease;
        border-radius: 2px;
    }
    .premium-nav-link:hover::after { width: 100%; }

    /* Categories Grid */
    .premium-cat-grid-desk {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    .premium-cat-card-desk {
        width: 100%;
        height: 160px;
        border-radius: 30px;
        background: linear-gradient(145deg, #ffffff, #f8fafc);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        border: 1px solid rgba(255,255,255,0.8);
        box-shadow: 0 4px 12px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.02);
        cursor: pointer;
        transform: translateY(0);
    }
    .premium-cat-card-desk:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 10px 20px rgba(0,0,0,0.04);
        background: linear-gradient(145deg, #ffffff, #f1f5f9);
        border-color: rgba(245, 42, 59, 0.15);
    }
    .premium-cat-icon {
        font-size: 40px;
        margin-bottom: 12px;
        background: linear-gradient(135deg, var(--premium-primary), var(--premium-secondary));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        transition: all 0.3s ease;
    }
    .premium-cat-card-desk:hover .premium-cat-icon {
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 4px 6px rgba(245, 42, 59,0.3));
    }

    /* Deal Cards Grid */
    .premium-deals-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }

    .premium-deal-card {
        background: white;
        border-radius: 28px;
        overflow: hidden;
        transition: all 0.4s ease;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
        border: 1px solid rgba(0,0,0,0.04);
        position: relative;
    }
    .premium-deal-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    }
    .premium-deal-img-wrap {
        position: relative;
        overflow: hidden;
        aspect-ratio: 4/3;
        border-radius: 28px 28px 0 0;
    }
    .premium-deal-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.7s cubic-bezier(0.2, 0, 0, 1);
    }
    .premium-deal-card:hover .premium-deal-img {
        transform: scale(1.08);
    }
    .premium-claim-btn-wrap {
        position: absolute;
        bottom: -50px;
        left: 0;
        width: 100%;
        padding: 0 16px;
        transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        opacity: 0;
    }
    .premium-deal-card:hover .premium-claim-btn-wrap {
        bottom: 16px;
        opacity: 1;
    }
    .premium-claim-btn {
        width: 100%;
        padding: 12px;
        border-radius: 12px;
        background: var(--glass-bg);
        backdrop-filter: blur(8px);
        color: #111;
        font-weight: 700;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.4);
    }
    .premium-claim-btn:hover {
        background: var(--premium-primary);
        color: white;
        border-color: var(--premium-primary);
    }

    /* ═══════════════════════════════════════════════════════════
       NEW MODERN HERO SECTION STYLING (Desktop Only)
       ═══════════════════════════════════════════════════════════ */
    #hero-section {
        background-color: #F8FAFC !important;
        position: relative;
        overflow: hidden;
    }
    .dark #hero-section {
        background-color: #0A0E17 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    /* Ambient Subtle Grid & Multi-Layer Brand Aurora Glows */
    .hero-grid-pattern {
        background-image: 
            linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
        background-size: 40px 40px;
        mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 85%);
        -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 85%);
    }
    .dark .hero-grid-pattern {
        background-image: 
            linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    }

    .hero-aurora-1 {
        background: radial-gradient(circle, rgba(245, 42, 59, 0.22) 0%, rgba(181, 0, 69, 0.12) 38%, rgba(255, 122, 47, 0.06) 65%, transparent 80%);
        animation: dsAuroraShift 18s ease-in-out infinite alternate;
        filter: blur(100px);
    }
    .hero-aurora-2 {
        background: radial-gradient(circle, rgba(255, 122, 47, 0.20) 0%, rgba(255, 198, 26, 0.10) 45%, rgba(245, 42, 59, 0.04) 68%, transparent 80%);
        animation: dsAuroraShift 22s ease-in-out infinite alternate-reverse;
        filter: blur(110px);
    }
    .hero-aurora-3 {
        background: radial-gradient(circle, rgba(245, 42, 59, 0.16) 0%, rgba(181, 0, 69, 0.08) 50%, transparent 75%);
        filter: blur(90px);
    }
    @keyframes dsAuroraShift {
        0% { transform: translate(0, 0) scale(1); }
        50% { transform: translate(45px, -35px) scale(1.15); }
        100% { transform: translate(-35px, 45px) scale(0.92); }
    }

    /* Live Platform Activity Pill */
    .hero-live-pill {
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(245, 42, 59, 0.18);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 6px 24px -4px rgba(245, 42, 59, 0.10), 0 2px 6px rgba(0, 0, 0, 0.03);
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .dark .hero-live-pill {
        background: rgba(20, 26, 42, 0.85);
        border-color: rgba(255, 255, 255, 0.10);
        box-shadow: 0 6px 24px -4px rgba(0, 0, 0, 0.45);
    }
    .hero-live-pill:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px -4px rgba(245, 42, 59, 0.18);
        border-color: rgba(245, 42, 59, 0.35);
    }
    .hero-pill-badge {
        background: linear-gradient(135deg, rgba(245, 42, 59, 0.14), rgba(255, 122, 47, 0.14));
        color: var(--premium-primary);
        border: 1px solid rgba(245, 42, 59, 0.28);
    }

    /* Typography */
    .hero-main-title {
        font-size: clamp(38px, 4.4vw, 58px);
        font-weight: 900;
        letter-spacing: -0.04em;
        line-height: 1.1;
    }
    .hero-gradient-text {
        background: linear-gradient(135deg, #F52A3B 0%, #FF7A2F 55%, #B50045 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        display: inline-block;
        filter: drop-shadow(0 6px 20px rgba(245, 42, 59, 0.20));
    }
    .hero-sub-text {
        font-size: 19px;
        line-height: 1.65;
    }

    /* Ultra-Modern Floating Search Glass Capsule */
    .hero-search-wrapper {
        position: relative;
    }
    .hero-search-glass {
        background: rgba(255, 255, 255, 0.95);
        border: 1.5px solid rgba(245, 42, 59, 0.16);
        box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(245, 42, 59, 0.04);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .dark .hero-search-glass {
        background: rgba(20, 26, 40, 0.92);
        border-color: rgba(255, 255, 255, 0.10);
        box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.55);
    }
    .hero-search-glass:focus-within {
        transform: translateY(-3px);
        border-color: rgba(245, 42, 59, 0.55);
        box-shadow: 0 28px 65px -10px rgba(245, 42, 59, 0.22), 0 0 0 5px rgba(245, 42, 59, 0.12);
    }
    .hero-search-btn {
        background: linear-gradient(135deg, #F52A3B 0%, #FF7A2F 100%);
        box-shadow: 0 4px 18px rgba(245, 42, 59, 0.38);
        white-space: nowrap;
    }
    .hero-search-btn:hover {
        background: linear-gradient(135deg, #B50045 0%, #F52A3B 100%);
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 8px 26px rgba(245, 42, 59, 0.50);
    }

    /* Trending Quick Tag Chips */
    .hero-tag-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 7px 15px;
        border-radius: 99px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(226, 232, 240, 0.85);
        color: #475569;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    }
    .dark .hero-tag-chip {
        background: rgba(28, 36, 52, 0.70);
        border-color: rgba(255, 255, 255, 0.08);
        color: #94A3B8;
    }
    .hero-tag-chip:hover {
        background: #FFFFFF;
        color: var(--premium-primary);
        border-color: rgba(245, 42, 59, 0.35);
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(245, 42, 59, 0.14);
    }
    .dark .hero-tag-chip:hover {
        background: #242E42;
        color: #FFA588;
        border-color: rgba(245, 42, 59, 0.45);
    }

    /* CTAs */
    .hero-cta-primary {
        background: linear-gradient(135deg, #F52A3B 0%, #FF7A2F 100%);
        box-shadow: 0 12px 32px -4px rgba(245, 42, 59, 0.42);
    }
    .hero-cta-primary:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 18px 45px -4px rgba(245, 42, 59, 0.58);
        color: white;
    }
    .hero-cta-secondary {
        background: rgba(255, 255, 255, 0.90);
        border: 1.5px solid #E2E8F0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .dark .hero-cta-secondary {
        background: rgba(21, 27, 44, 0.85);
        border-color: rgba(255, 255, 255, 0.10);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    }
    .hero-cta-secondary:hover {
        transform: translateY(-3px);
        border-color: rgba(245, 42, 59, 0.35);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    }

    /* Footer */
    .premium-footer {
        background: #0F172A;
        color: white;
        padding-top: 80px;
        padding-bottom: 40px;
    }
}

/* 
  JO-Dealz - Desktop Premium v2 CSS
  Scoped specifically to md (768px) and above to preserve Mobile View completely.
*/

@media (min-width: 768px) {
  :root {
    --premium-primary: #f52a3b;
    --premium-primary-hover: #B50045;
    --premium-primary-light: rgba(245, 42, 59, 0.1);
    --premium-secondary: #0f172a; /* Slate 900 */
    
    --desktop-radius-sm: 0.5rem;
    --desktop-radius-md: 0.75rem;
    --desktop-radius-lg: 1rem;
    --desktop-radius-xl: 1.5rem;
    
    --desktop-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --desktop-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --desktop-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --desktop-shadow-premium: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
  }

  /* Dark mode overrides for desktop variables */
  .dark {
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(30, 41, 59, 0.5);
    --desktop-shadow-premium: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  }

  body {
    background-color: #f8fafc;
  }
  .dark body {
    background-color: #020617; /* Slate 950 */
  }

  /* Premium Buttons */
  .btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--premium-primary);
    color: white;
    font-weight: 700;
    border-radius: var(--desktop-radius-lg);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(245, 42, 59, 0.2);
  }
  .btn-premium:hover {
    background: var(--premium-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 42, 59, 0.3);
    color: white;
  }

  /* Glassmorphism Navigation */
  .glass-nav-desktop {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--desktop-shadow-sm);
  }
  
  /* Desktop Deal Card */
  .desktop-deal-card {
    background: white;
    border-radius: var(--desktop-radius-xl);
    overflow: hidden;
    box-shadow: var(--desktop-shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
  }
  .dark .desktop-deal-card {
    background: var(--premium-secondary);
    border-color: rgba(255,255,255,0.05);
  }
  .desktop-deal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--desktop-shadow-premium);
  }
  
  .desktop-deal-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 65%; /* 16:10 aspect ratio approx */
    overflow: hidden;
  }
  .desktop-deal-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }
  .desktop-deal-card:hover .desktop-deal-image {
    transform: scale(1.05);
  }
  
  .desktop-deal-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }
  
  .desktop-deal-title {
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .dark .desktop-deal-title {
    color: #f8fafc;
  }
  
  .desktop-deal-price-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
  }
  .dark .desktop-deal-price-row {
    border-top-color: rgba(255,255,255,0.05);
  }
  
  /* Layout adjustments */
  .desktop-page-wrapper {
    padding-top: 2rem;
    padding-bottom: 4rem;
  }
}

/* ==========================================================================
   10. DESKTOP POLISH LAYER (>= 1024px, desktop UA only)
   This file is never sent to mobile user agents (see includes/header.php), and
   everything below is additionally scoped to a desktop media query.
   Order: base → forms → header → footer → sections → cards → pages.
   ========================================================================== */
@media (min-width: 1024px) {

  /* ---- 10.1 Base ---------------------------------------------------------- */
  /* (no body min-width: at a 1024px viewport the scrollbar leaves ~1009px, so
     min-width:1024px caused a permanent horizontal scrollbar) */
  main, .main-content { width: 100%; }
  img { max-width: 100%; }
  :focus-visible { outline: 2px solid var(--color-primary, #F52A3B); outline-offset: 2px; }
  button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
  ::selection { background: rgba(245, 42, 59, 0.16); }

  /* ---- 10.2 Form controls ------------------------------------------------- *
   * The tailwind build has no forms plugin, so inputs styled only with
   * `border-gray-300` render with no border at all. :where() keeps specificity
   * at zero so any explicit utility (border-0, border-2, …) still wins.       */
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]), select, textarea) {
    border-width: 1px;
    border-style: solid;
    border-color: #E2E8F0;
    background-color: #FFFFFF;
    color: #0F172A;
    line-height: 1.5;
  }
  .dark :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]), select, textarea) {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: #151B2C;
    color: #F1F5F9;
  }
  :where(input[type="checkbox"], input[type="radio"]) {
    border: 1px solid #CBD5E1;
    accent-color: var(--color-primary, #F52A3B);
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):focus,
  select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary, #F52A3B);
    box-shadow: 0 0 0 4px rgba(245, 42, 59, 0.12);
  }
  input::placeholder, textarea::placeholder { color: #94A3B8; opacity: 1; }
  select { cursor: pointer; }
  button:disabled, input:disabled, select:disabled, textarea:disabled, .disabled, [aria-disabled="true"] {
    cursor: not-allowed;
  }

  /* ---- 10.3 Footer -------------------------------------------------------- */
  #main-footer h3.footer-col-toggle {
    cursor: default;
    white-space: nowrap;
    font-size: 0.8125rem !important;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem !important;
  }
  #main-footer .footer-col-toggle .toggle-chevron { display: none !important; }
  #main-footer .footer-col-links { list-style: none; padding: 0; margin: 0; }
  #main-footer .footer-col-links li + li { margin-top: 0.125rem; }
  #main-footer .footer-col-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.3rem 0;
    font-size: 0.9rem !important;
    line-height: 1.4;
  }
  #main-footer .footer-col-links a i {
    width: 1rem;
    flex: 0 0 1rem;
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.55;
  }
  #main-footer .footer-col-links a:hover i { opacity: 1; }
}

@media (min-width: 1024px) {
  /* ---- 10.4 Page header + breadcrumb (shared by listing / info pages) ------- */
  .dl-page-hero {
    background:
      radial-gradient(900px 260px at 85% -40%, rgba(245, 42, 59, 0.10), transparent 70%),
      linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border-bottom: 1px solid #E2E8F0;
    padding: 1.75rem 0 2rem;
  }
  .dark .dl-page-hero {
    background: linear-gradient(180deg, #111827 0%, #0B0F19 100%);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
  .dl-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748B;
    margin-bottom: 1rem;
  }
  .dl-breadcrumb a { color: #64748B; transition: color 0.2s; }
  .dl-breadcrumb a:hover { color: var(--color-primary, #F52A3B); }
  .dl-breadcrumb i { font-size: 0.6rem; opacity: 0.6; }
  .dl-breadcrumb span { color: #0F172A; font-weight: 600; }
  .dark .dl-breadcrumb span { color: #F1F5F9; }
  .dl-page-hero__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
  }
  .dl-page-hero__text { min-width: 0; }
  .dl-page-hero h1 {
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
  }
  .dark .dl-page-hero h1 { color: #F8FAFC; }
  .dl-page-hero p {
    margin: 0.625rem 0 0;
    max-width: 46rem;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #64748B;
  }
  .dl-count-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0F172A;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
  }
  .dl-count-pill i { color: var(--color-primary, #F52A3B); font-size: 0.75rem; }
  .dark .dl-count-pill { background: #151B2C; border-color: rgba(255, 255, 255, 0.08); color: #F1F5F9; }

  /* ---- 10.5 Deal cards (one consistent structure everywhere) -------------- */
  .deal-card,
  .desktop-deal-card {
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.10) !important;
  }
  .deal-card:hover,
  .desktop-deal-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04), 0 20px 40px -16px rgba(15, 23, 42, 0.18) !important;
    border-color: rgba(245, 42, 59, 0.18) !important;
  }
  .deal-card:hover img { transform: scale(1.04) !important; }

  /* Image well: fill the card edge-to-edge at a fixed 16:10 ratio */
  .deal-card .desktop-deal-image-wrapper {
    padding-top: 0 !important;
    aspect-ratio: 16 / 10 !important;
    border-radius: 0 !important;
    background: #F1F5F9;
  }
  .deal-card .desktop-deal-image-wrapper > div:first-child {
    position: absolute;
    inset: 0;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
  }
  .deal-card .desktop-deal-image-wrapper .desktop-deal-image { position: static; }

  .deal-card .desktop-deal-content { padding: 1.125rem 1.25rem 1.25rem !important; gap: 0; }
  .deal-card .desktop-deal-title {
    font-size: 1.0625rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    min-height: 2.8em;
    height: auto !important;
    margin-bottom: 0.75rem !important;
    color: #0F172A;
  }
  .dark .deal-card .desktop-deal-title { color: #F8FAFC; }
  .deal-card .desktop-deal-price-row { padding-top: 0.875rem; }
  .deal-card .deal-card-noprice { font-size: 0.9375rem; color: var(--color-primary, #F52A3B); }
}

@media (min-width: 1024px) {
  /* ---- 10.6 Container behaviour ------------------------------------------- *
   * Direct children of the (flex-column) page shell that use `mx-auto` lose the
   * default cross-axis stretch and shrink-wrap their content. Restore the
   * "fill up to max-width, centred" behaviour a block container would have.   */
  body > [class*="max-w-"].mx-auto,
  #app-content-wrapper > [class*="max-w-"].mx-auto,
  #app-content-wrapper > main > [class*="max-w-"].mx-auto,
  main > [class*="max-w-"].mx-auto {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  /* ---- 10.7 Categories page: subcategory cards ------------------------------ *
   * The generic `.premium-cat-card` rule earlier in this file (built for a
   * different layout) adds padding/gradients that double-frame these cards and
   * make the title collide with the image. Reset it for the categories grid.  */
  #subcategories-grid { gap: 1.25rem; }
  #subcategories-grid .premium-cat-card {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -14px rgba(15, 23, 42, 0.12) !important;
    min-height: 0 !important;
    height: 100%;
    transform: none;
  }
  .dark #subcategories-grid .premium-cat-card {
    background: #151B2C !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  #subcategories-grid .premium-cat-card:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(245, 42, 59, 0.35) !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04), 0 20px 36px -16px rgba(245, 42, 59, 0.22) !important;
  }
  #subcategories-grid .premium-cat-card .cat-img-wrapper {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #FFF1F2 0%, #FFE1E3 100%);
  }
  .dark #subcategories-grid .premium-cat-card .cat-img-wrapper { background: linear-gradient(135deg, #2A1520, #1A1220); }
  /* Missing artwork falls back to the generic placeholder — hide it and let the tinted well show */
  #subcategories-grid .cat-img-wrapper img[src*="/assets/images/default/"] { display: none; }
  #subcategories-grid .cat-card-overlay { background: linear-gradient(to top, rgba(15, 23, 42, 0.35) 0%, transparent 55%); opacity: 1; }
  #subcategories-grid .cat-card-content {
    padding: 1.75rem 0.75rem 1rem !important;
    gap: 0.25rem;
    justify-content: flex-start;
    background: transparent;
  }
  #subcategories-grid .cat-card-title {
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #subcategories-grid .cat-icon-float {
    top: -20px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: var(--color-primary, #F52A3B);
  }
  #subcategories-grid .cat-card-count { margin-top: 0.5rem; }
}

@media (min-width: 1024px) {
  /* ---- 10.8 Categories hero ------------------------------------------------- */
  .cat-hero-bg h1 { font-size: 2.75rem; line-height: 1.1; }
  .cat-hero-bg { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  /* collapsed advanced-filter panel must not leave its flex `gap` behind as dead space */
  .filter-bar .adv-filters-container:not(.expanded) { margin-top: -16px; }
}

@media (min-width: 1024px) {
  /* no artwork → no dark scrim over the tinted placeholder */
  #subcategories-grid .cat-img-wrapper:has(img[src*="/assets/images/default/"]) .cat-card-overlay { display: none; }
}

@media (min-width: 1024px) {
  /* ---- 10.9 Categories page: deals list → responsive grid ------------------- */
  #deals-section { max-width: none !important; width: 100%; }
  #category-deals-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: none !important;
    margin: 0;
    align-items: stretch;
  }
  #category-deals-grid .deal-card-wrapper { min-width: 0; }
  #category-deals-grid .deal-card { border-radius: 20px !important; }
  /* skeleton placeholders follow the same grid instead of stacking full-width */
  #category-deals-grid > .animate-pulse, #category-deals-grid > [class*="skeleton"] { min-height: 320px; }

  /* ---- 10.10 Cookie notice: non-blocking corner card on desktop ------------- *
   * app.js builds this as a full-screen blurred modal with inline styles, which
   * hides the whole site until a choice is made. On desktop show it as a small
   * card in the corner instead. (Mobile never loads this stylesheet.)          */
  #cookie-consent-overlay {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    padding: 1.5rem !important;
    pointer-events: none;
  }
  #cookie-consent-banner {
    pointer-events: auto;
    max-width: 400px !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(20px);
  }
}

@media (min-width: 1024px) {
  /* ---- 10.11 Header ---------------------------------------------------------- */
  #main-header > div > .flex.items-center { min-height: 4.5rem; }
  #main-header .premium-header-content nav { gap: 1.75rem; }
  #main-header .premium-header-content > div:last-child { gap: 1.125rem; }
  #main-header .btn-premium {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.25;
    border-radius: 999px !important;
    box-shadow: 0 6px 16px -6px rgba(245, 42, 59, 0.55) !important;
    white-space: nowrap;
  }
  #main-header .btn-premium:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(245, 42, 59, 0.6) !important; }
  #main-header nav a.is-active { color: var(--color-primary, #F52A3B); }
  #main-header nav a.is-active::after { width: 100%; }
  #main-header #header-search-input { width: 13.5rem; }
  #main-header #header-search-input:focus { width: 16rem; }
}
/* Squeeze gracefully on smaller desktop windows instead of overflowing */
@media (min-width: 1024px) and (max-width: 1365px) {
  #main-header .premium-header-content nav { gap: 1.25rem; }
  #main-header .premium-header-content nav a { font-size: 0.875rem; }
  #main-header .premium-header-content > div:last-child { gap: 0.875rem; }
  #main-header #header-search-input { width: 10.5rem; }
  #main-header #header-search-input:focus { width: 12rem; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  #main-header .premium-header-content > div:last-child > .group { display: none; }
}

@media (min-width: 1024px) {
  /* ---- 10.12 Brand palette alignment ------------------------------------------ *
   * Heroes/CTAs use Tailwind's generic reds and amber for gradient stops. Map
   * them onto the JO-Dealz palette (#F52A3B / #B50045 / #900037 / #FF7A2F).
   * Semantic colours (errors, success, info) are intentionally left alone.      */
  .from-red-500 { --tw-gradient-from: #F52A3B var(--tw-gradient-from-position); --tw-gradient-to: rgb(245 42 59 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
  .from-red-600 { --tw-gradient-from: #B50045 var(--tw-gradient-from-position); --tw-gradient-to: rgb(181 0 69 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
  .via-red-500, .via-red-600 { --tw-gradient-to: rgb(181 0 69 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), #B50045 var(--tw-gradient-via-position), var(--tw-gradient-to); }
  .to-red-500 { --tw-gradient-to: #F52A3B var(--tw-gradient-to-position); }
  .to-red-600 { --tw-gradient-to: #B50045 var(--tw-gradient-to-position); }
  .to-red-700, .hover\:to-red-700:hover { --tw-gradient-to: #900037 var(--tw-gradient-to-position); }
  .hover\:to-red-600:hover { --tw-gradient-to: #B50045 var(--tw-gradient-to-position); }
  .to-amber-500 { --tw-gradient-to: #FF7A2F var(--tw-gradient-to-position); }
  .to-orange-500 { --tw-gradient-to: #FF7A2F var(--tw-gradient-to-position); }

  /* Terms of Service hero was near-black while every other info page is brand-red.
     Only the hero has the three-stop gray gradient, so this does not touch #tos-8. */
  .bg-gradient-to-br.from-gray-800.via-gray-900.to-black {
    background-image: linear-gradient(135deg, #F52A3B 0%, #B50045 60%, #900037 100%);
  }

  /* Hero subtitles on the red gradient were rendering at ~60% opacity (hard to read) */
  .bg-gradient-to-br.from-brand-500.via-red-600 p,
  .bg-gradient-to-br.from-brand-500.via-red-500 p,
  .bg-gradient-to-br.from-gray-800.via-gray-900.to-black p { color: rgba(255, 255, 255, 0.92); }
}

@media (min-width: 1024px) {
  /* ---- 10.13 Deal card text details --------------------------------------------- */
  /* Titles are user-entered and often the "wrong" script for the page direction. `plaintext`
     lets each title pick its own base direction so punctuation lands on the correct side. */
  .deal-card .desktop-deal-title { unicode-bidi: plaintext; }
  [dir="rtl"] .deal-card .desktop-deal-title { text-align: right; }
  /* merchant name vs location: give the location a fairer share of the row */
  .deal-card .max-w-\[70\%\] { max-width: 58%; }
  .deal-card .max-w-\[30\%\] { max-width: 42%; }
}

@media (min-width: 1440px) {
  #main-header #header-search-input { width: 15rem; }
  #main-header #header-search-input:focus { width: 17rem; }
}

/* ---- Mega menu drawer: keep it out of the layout while closed ---------------- *
 * style.min.css sets `.mega-menu-drawer{display:flex}` and loads after Tailwind,
 * so the `.hidden` utility lost and the closed drawer stayed rendered off-screen
 * (focusable, hit-testable, painted during resize). toggleMegaMenu() toggles
 * `.hidden`, so honour it here.                                               */
.mega-menu-drawer.hidden { display: none; }

/* Long placeholders: truncate with an ellipsis instead of a hard clip */
#header-search-input,
#main-hero-search { text-overflow: ellipsis; min-width: 0; }

/* Keyboard focus must stay visible (WCAG 2.4.7). Many templates add Tailwind's
   `focus:outline-none` to selects/links/buttons, which beat the global
   :focus-visible rule above; restore the ring for keyboard focus only. */
select.focus\:outline-none:focus-visible,
a.focus\:outline-none:focus-visible,
button.focus\:outline-none:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--color-primary, #F52A3B);
  outline-offset: 2px;
}
/* Search fields without their own ring: show focus on the pill that wraps them */
div:has(> #main-hero-search:focus-visible) {
  box-shadow: 0 0 0 2px var(--color-primary, #F52A3B);
}

/* Deal cards: the title link is stretched over the whole card so the card is a
   real <a> for keyboards, screen readers and crawlers (the card's onclick stays
   as a fallback). The favourite button (z-10) stays above the overlay. */
.jd-card-link { color: inherit; text-decoration: none; }
.jd-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.jd-card-link:focus-visible { outline: none; }
.desktop-deal-card:has(.jd-card-link:focus-visible) { outline: 2px solid var(--color-primary, #F52A3B); outline-offset: 3px; }

/* Tablet widths with a desktop UA (iPad Safari requests the desktop site):
   the full desktop header does not fit below 1024px, so tighten it and drop the
   secondary items (About link, app CTA) instead of overflowing the viewport. */
@media (max-width: 1023.98px) {
  #main-header .premium-header-content nav { gap: 1.25rem; margin-inline: 1rem; }
  #main-header .premium-header-content nav a { white-space: nowrap; }
  #main-header .premium-header-content nav a[href^="/about-us"],
  #main-header .premium-header-content .btn-premium { display: none; }
  #main-header .premium-header-content > .flex-shrink-0:last-child { gap: 1rem; }
}
