/* ==========================================================================
   BazarAll — Multi-Device Responsive System
   Strictly preserves 100% of existing Mobile UI for phones (<= 767px)
   Provides world-class UI for Tablet (768px - 1023px) & Desktop/Laptop (1024px+)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MOBILE SHIELDING (Screen <= 767px)
   Ensure desktop headers, footers & desktop-only elements are completely hidden
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .desktop-header,
  .desktop-footer,
  .desktop-only {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   2. GLOBAL TABLET & DESKTOP RESET & CONTAINER (Screen >= 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  /* Remove 480px width clamp from body */
  body {
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    background-color: #F8FAFC !important;
  }

  /* App Shell responsive container */
  .app-wrapper {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding-bottom: 0 !important;
    min-height: calc(100vh - 200px);
  }

  /* Hide mobile-specific bars on tablet & desktop */
  .bottom-nav,
  .mobile-only,
  .top-nav,
  .location-row,
  .mobile-search-wrapper,
  .mobile-product-action-bar {
    display: none !important;
  }

  /* Show desktop header & footer */
  .desktop-header,
  .desktop-footer {
    display: block !important;
  }

  /* Section header typography */
  .section-header {
    padding: 0 !important;
    margin: 28px 0 16px !important;
  }
  .section-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    letter-spacing: -0.3px !important;
  }
  .section-link {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    transition: color 0.15s ease !important;
  }
  .section-link:hover {
    color: var(--primary-dark) !important;
    text-decoration: underline !important;
  }

  .section-divider {
    height: 1px !important;
    background: #E2E8F0 !important;
    margin: 32px 0 !important;
  }

  /* Page Header for inner pages (stores.php, cart.php, category.php, etc.) */
  .page-header {
    background: transparent !important;
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 20px 0 16px 0 !important;
    position: static !important;
    margin-bottom: 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
  }
  .page-header .page-title {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    letter-spacing: -0.4px !important;
  }
  .page-header .back-btn {
    background: #FFFFFF !important;
    border: 1.5px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    transition: all 0.2s ease !important;
  }
  .page-header .back-btn:hover {
    background: #EEF2FF !important;
    border-color: #C7D2FE !important;
    color: #4F46E5 !important;
    transform: translateX(-2px) !important;
  }
}

/* --------------------------------------------------------------------------
   3. DESKTOP & TABLET HEADER STYLING (Screen >= 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .desktop-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  }

  .desktop-header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
  }

  /* Brand */
  .desktop-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
  }
  .desktop-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 8px rgba(79, 70, 229, 0.35));
    transition: transform 0.2s ease;
  }
  .desktop-brand:hover .desktop-brand-icon {
    transform: scale(1.05);
  }
  .desktop-brand-info {
    display: flex;
    flex-direction: column;
  }
  .desktop-brand-name {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #4F46E5;
    line-height: 1.1;
  }
  .desktop-brand-tagline {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748B;
    letter-spacing: 0.3px;
  }

  /* Location badge */
  .desktop-loc-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    color: #4F46E5;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .desktop-loc-badge:hover {
    background: #EEF2FF;
    border-color: #818CF8;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
  }
  .desktop-loc-badge:active {
    transform: scale(0.98);
  }
  .desktop-loc-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4F46E5;
    flex-shrink: 0;
  }
  .desktop-loc-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .desktop-loc-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: #6366F1;
    letter-spacing: 0.3px;
  }
  .desktop-loc-value {
    font-size: 12.5px;
    font-weight: 700;
    color: #0F172A;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .desktop-loc-chevron {
    color: #94A3B8;
    transition: transform 0.2s;
    margin-left: 2px;
  }
  .desktop-loc-badge:hover .desktop-loc-chevron {
    color: #4F46E5;
    transform: translateY(1px);
  }

  /* Desktop Location Modal Overlay & Sheet */
  .loc-modal-overlay {
    align-items: center !important;
    justify-content: center !important;
  }
  .loc-modal-sheet {
    border-radius: 24px !important;
    max-width: 520px !important;
    max-height: 85vh !important;
    transform: scale(0.94) translateY(10px) !important;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25) !important;
  }
  .loc-modal-overlay.open .loc-modal-sheet {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
  }
  .loc-drag-handle {
    display: none !important;
  }

  /* Center Search Form - Spacious, Single Line, No Wrapping */
  .desktop-search-form {
    flex: 1 1 auto;
    min-width: 220px;
    max-width: 650px;
    margin: 0 10px;
  }
  .desktop-search-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 999px;
    padding: 3px 4px 3px 14px;
    height: 44px;
    box-sizing: border-box;
    transition: all 0.2s ease;
  }
  .desktop-search-wrapper:focus-within {
    border-color: #4F46E5;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  }
  .desktop-search-icon {
    color: #94A3B8;
    flex-shrink: 0;
    margin-right: 8px;
  }
  .desktop-search-wrapper input {
    flex: 1 1 auto;
    min-width: 0 !important;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: #0F172A;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    height: 100%;
  }
  .desktop-search-wrapper input::placeholder {
    color: #94A3B8;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .desktop-search-submit {
    flex-shrink: 0;
    white-space: nowrap;
    background: #4F46E5;
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 0 20px;
    height: 36px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .desktop-search-submit:hover {
    background: #4338CA;
    transform: translateY(-1px);
  }

  /* Nav Menu */
  .desktop-nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  .desktop-nav-item:hover {
    color: #4F46E5;
    background: #EEF2FF;
  }
  .desktop-nav-item.active {
    color: #4F46E5;
    background: #EEF2FF;
    font-weight: 700;
  }

  /* Utility Actions */
  .desktop-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Language Switcher */
  .desktop-lang-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s;
  }
  .desktop-lang-badge:hover {
    border-color: #C7D2FE;
    background: #F8FAFC;
    color: #4F46E5;
  }

  /* Merchant button */
  .desktop-merchant-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #4338CA;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
  }
  .desktop-merchant-btn:hover {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  }

  /* Cart pill */
  .desktop-cart-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #1E293B;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  .desktop-cart-pill:hover,
  .desktop-cart-pill.active {
    border-color: #4F46E5;
    color: #4F46E5;
    background: #EEF2FF;
  }
  .desktop-cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }
  .desktop-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
  }

  /* User avatar & pill */
  .desktop-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #F1F5F9;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s;
  }
  .desktop-user-pill:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
  }
  .desktop-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4F46E5;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .desktop-username {
    font-size: 12.5px;
    font-weight: 700;
    color: #1E293B;
  }

  /* Login button */
  .desktop-login-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: #4F46E5;
    color: #FFFFFF;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
    transition: all 0.2s ease;
  }
  .desktop-login-button:hover {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.38);
  }

  /* Secondary Category Bar */
  .desktop-subbar {
    border-top: 1px solid #F1F5F9;
    background: #FFFFFF;
  }
  .desktop-subbar-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 6px 24px;
  }
  .desktop-subbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .desktop-subbar-links::-webkit-scrollbar {
    display: none;
  }
  .desktop-sublink {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
  }
  .desktop-sublink:hover {
    color: #4F46E5;
    background: #EEF2FF;
  }
  .desktop-sublink-highlight {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #4F46E5;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
  }
  .desktop-sublink-highlight:hover {
    background: #EEF2FF;
    text-decoration: underline;
  }
}

/* --------------------------------------------------------------------------
   4. DESKTOP & TABLET FOOTER STYLING (Screen >= 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .desktop-footer {
    background: #0B1120;
    color: #94A3B8;
    margin-top: 60px;
    border-top: 1px solid #1E293B;
  }
  .desktop-footer-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 50px 24px 28px;
  }
  .desktop-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 36px;
    margin-bottom: 40px;
  }

  /* Brand Column */
  .footer-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .footer-brand-title {
    font-size: 22px;
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    display: block;
    line-height: 1.1;
  }
  .footer-brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: #818CF8;
    letter-spacing: 0.3px;
  }
  .footer-mission-text {
    font-size: 13px;
    line-height: 1.6;
    color: #94A3B8;
    margin-bottom: 18px;
  }
  .footer-trust-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #CBD5E1;
  }
  .trust-chip svg {
    color: #10B981;
  }

  /* Column Titles & Lists */
  .footer-col-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #F8FAFC;
    margin-bottom: 16px;
  }
  .footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .footer-links-list li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
  }
  .footer-links-list li a:hover {
    color: #FFFFFF;
    transform: translateX(3px);
  }

  /* Merchant Column */
  .merchant-desc-text {
    font-size: 12.5px;
    color: #94A3B8;
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .footer-merchant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }
  .footer-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #4F46E5;
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
  }
  .footer-btn-primary:hover {
    background: #4338CA;
    transform: translateY(-1px);
  }
  .footer-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #1E293B;
    border: 1px solid #334155;
    color: #F8FAFC;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
  }
  .footer-btn-secondary:hover {
    background: #334155;
    color: #FFFFFF;
  }
  .footer-pos-features {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
    color: #64748B;
  }

  /* Bottom Copyright Bar */
  .desktop-footer-bottom {
    border-top: 1px solid #1E293B;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748B;
  }
  .footer-bottom-copy strong {
    color: #CBD5E1;
  }
  .footer-bottom-tags {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   5. TABLET SPECIFIC LAYOUT ADJUSTMENTS (768px - 1023px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-wrapper {
    padding: 0 20px 40px !important;
  }
  .desktop-header-container {
    padding: 10px 16px;
    gap: 12px;
  }
  .desktop-search-form {
    max-width: 280px;
  }
  .desktop-nav-menu {
    gap: 2px;
  }
  .desktop-nav-item span {
    font-size: 12px;
  }
  .desktop-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  /* Tablet Hero Banner */
  .hero-banner {
    margin: 16px 0 24px !important;
    padding: 28px 32px !important;
    border-radius: 20px !important;
  }
  .hero-banner h2 {
    font-size: 24px !important;
  }
  .hero-banner p {
    font-size: 14px !important;
  }

  /* Tablet Categories: 4 columns */
  #cat-scroll {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    overflow-x: visible !important;
    padding: 0 !important;
  }
  .cat-chip {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    padding: 14px 8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03) !important;
  }

  /* Tablet Shops: 2 columns */
  #stores-scroll {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    overflow-x: visible !important;
    padding: 0 !important;
  }
  #stores-scroll > a {
    min-width: 0 !important;
  }
  #stores-scroll .card {
    min-width: 0 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    padding: 14px !important;
  }
  #stores-scroll .card img,
  #stores-scroll .card > div:first-child {
    height: 100px !important;
  }

  /* Tablet Products: 3 columns */
  .grid-2 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    padding: 0 !important;
  }
  .product-card {
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03) !important;
  }
  .product-card .img-wrap {
    height: 170px !important;
  }
}

/* --------------------------------------------------------------------------
   6. DESKTOP & LAPTOP LAYOUT SYSTEM (Screen >= 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Main Container */
  .app-wrapper {
    max-width: 1320px !important;
    margin: 0 auto !important;
    padding: 0 24px 60px !important;
  }

  /* Hero Banner Desktop */
  .hero-banner {
    margin: 20px 0 32px !important;
    padding: 44px 52px !important;
    border-radius: 24px !important;
    background: linear-gradient(135deg, #3730A3 0%, #4F46E5 50%, #6366F1 100%) !important;
    box-shadow: 0 12px 36px rgba(79, 70, 229, 0.22) !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .hero-banner h2 {
    font-size: 32px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    margin-bottom: 10px !important;
    letter-spacing: -0.5px !important;
  }
  .hero-banner p {
    font-size: 15.5px !important;
    line-height: 1.6 !important;
    max-width: 600px !important;
    opacity: 0.92 !important;
    margin-bottom: 22px !important;
  }
  .hero-banner .btn {
    padding: 12px 28px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  }
  .hero-banner .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  }

  /* Categories: Responsive 8-column Interactive Grid */
  #cat-scroll {
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 16px !important;
    overflow-x: visible !important;
    padding: 0 !important;
  }
  .cat-chip {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 18px 10px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    min-width: 0 !important;
  }
  .cat-chip:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12) !important;
    border-color: #C7D2FE !important;
  }
  .cat-chip .cat-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 14px !important;
    font-size: 26px !important;
    margin-bottom: 6px !important;
    transition: transform 0.2s ease !important;
  }
  .cat-chip:hover .cat-icon {
    transform: scale(1.1) !important;
  }
  .cat-chip .cat-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
  }

  /* Nearby Shops: 4 Columns */
  #stores-scroll {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 22px !important;
    overflow-x: visible !important;
    padding: 0 !important;
  }
  #stores-scroll > a {
    min-width: 0 !important;
    text-decoration: none !important;
  }
  #stores-scroll .card {
    min-width: 0 !important;
    padding: 16px !important;
    border-radius: 16px !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  #stores-scroll .card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08) !important;
    border-color: #CBD5E1 !important;
  }
  #stores-scroll .card img,
  #stores-scroll .card > div:first-child {
    height: 120px !important;
    border-radius: 12px !important;
  }

  /* All Products: 4 Columns (>=1024px) / 5 Columns (>=1280px) */
  .grid-2 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 22px !important;
    padding: 0 !important;
  }
  .product-card {
    border-radius: 16px !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
    background: #FFFFFF !important;
  }
  .product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.12) !important;
    border-color: #C7D2FE !important;
  }
  .product-card .img-wrap {
    height: 200px !important;
    background: #F8FAFC !important;
    overflow: hidden !important;
  }
  .product-card .img-wrap img {
    transition: transform 0.35s ease !important;
  }
  .product-card:hover .img-wrap img {
    transform: scale(1.06) !important;
  }
  .product-card .card-body {
    padding: 14px 16px 16px !important;
  }
  .product-card .product-name {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    line-height: 1.4 !important;
    margin-bottom: 4px !important;
  }
  .product-card .store-name {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }
  .product-card .price {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #4F46E5 !important;
  }
}

@media (min-width: 1280px) {
  .grid-2 {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 24px !important;
  }
}

/* --------------------------------------------------------------------------
   7. PAGE-SPECIFIC DESKTOP ENHANCEMENTS (Screen >= 768px)
   -------------------------------------------------------------------------- */

/* A. Product Detail Page (marketplace/product.php) */
@media (min-width: 1024px) {
  .desktop-product-container {
    display: grid !important;
    grid-template-columns: 460px 1fr !important;
    gap: 40px !important;
    background: #FFFFFF !important;
    border-radius: 24px !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04) !important;
    padding: 32px !important;
    margin-bottom: 36px !important;
  }
  .desktop-product-gallery {
    position: relative !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #F8FAFC !important;
    border: 1px solid #F1F5F9 !important;
  }
  .desktop-product-gallery img {
    height: 380px !important;
    object-fit: contain !important;
  }
  .desktop-product-sidebar {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* B. Cart Page (marketplace/cart.php) */
@media (min-width: 1024px) {
  .desktop-cart-layout {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 32px !important;
    align-items: start !important;
  }
  .desktop-cart-items-panel {
    background: #FFFFFF !important;
    border-radius: 20px !important;
    border: 1px solid #E2E8F0 !important;
    padding: 24px !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03) !important;
  }
  .desktop-cart-summary-sticky {
    position: sticky !important;
    top: 90px !important;
    background: #FFFFFF !important;
    border-radius: 20px !important;
    border: 1px solid #E2E8F0 !important;
    padding: 24px !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
  }
}

/* C. Stores Page (marketplace/stores.php) */
@media (min-width: 768px) {
  .filter-tabs {
    padding: 0 !important;
    margin-bottom: 20px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }
  .filter-tab {
    padding: 8px 18px !important;
    font-size: 13.5px !important;
    border-radius: 10px !important;
  }
}

/* D. Auth Pages (auth/login.php, auth/register.php) */
@media (min-width: 768px) {
  body:has(.auth-page),
  body[style*="background:var(--primary)"] {
    background: linear-gradient(135deg, #EEF2FF 0%, #F1F5F9 50%, #E0E7FF 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 40px 16px !important;
  }
  .auth-page {
    width: 100% !important;
    max-width: 480px !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 48px rgba(79, 70, 229, 0.16) !important;
    overflow: hidden !important;
    min-height: auto !important;
    border: 1px solid #E2E8F0 !important;
    margin: auto !important;
  }
  .auth-body {
    min-height: auto !important;
    padding: 32px 28px 36px !important;
  }
}

/* E. Store Public Page (store/view.php) */
@media (min-width: 1024px) {
  .desktop-store-banner {
    height: 260px !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    margin-bottom: -50px !important;
  }
  .desktop-store-header-card {
    max-width: 1200px !important;
    margin: 0 auto 30px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid #E2E8F0 !important;
  }
}
