/* ============================================================================
   FLAME STORE - RESPONSIVE DESIGN
   جميع Media Queries للتجاوب مع الشاشات المختلفة
   ============================================================================ */

/* ============= TABLET & DESKTOP OPTIMIZATIONS (640px+) ============= */
@media (min-width: 640px) {
  .tier1-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
  }

  .filter-price {
    grid-column: 1 / -1;
  }

  .filter-sort {
    grid-column: 1 / -1;
  }

  .advanced-filters-toggle-inline {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .filter-actions-tier1 {
    grid-column: 1 / -1;
  }
}

/* ============= TABLET (768px+) ============= */
@media (min-width: 768px) {
  .filters-tier1 {
    padding: 20px;
    margin: 20px auto;
  }

  .tier1-container {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .filter-price {
    grid-column: auto;
  }

  .filter-sort {
    grid-column: auto;
  }
  
  .filter-primary-label {
    font-size: 16px;
  }

  .filter-actions-tier1 {
    grid-column: 1 / -1;
    max-width: 400px;
    margin-left: auto;
  }
  
  .sort-pill {
    font-size: 15px;
    padding: 11px 20px;
  }

  .advanced-filters-toggle-inline {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .btn-advanced-toggle {
    padding: 12px 18px;
    width: auto;
  }

  .btn-advanced-toggle .btn-text {
    font-size: 14px;
  }

  .btn-advanced-toggle .filter-icon {
    width: 22px;
    height: 22px;
  }

  .btn-advanced-toggle .chevron-icon {
    width: 21px;
    height: 21px;
  }
}

/* ============= MOBILE (max 768px) ============= */
@media (max-width: 768px) {
  /* Logo & Header */
  .logo { 
    max-width: 200px; 
  }
  
  header { 
    padding: 1rem 1rem;
  }
  
  .header-actions {
    gap: 0.5rem;
  }

  /* Container */
  .container {
    padding: 1.5rem 1rem;
  }
  
  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
  }
  
  .footer-brand {
    order: -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .footer-center {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .footer-social {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  /* Back to Top */
  .back-to-top {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
  }

  /* Back Button */
  .back-btn {
    font-size: 14px;
    padding: 10px 16px;
  }

  /* Account Cards */
  .account-card-top { 
    flex-wrap: wrap; 
  }
  
  .account-price { 
    font-size: 20px; 
  }
  
  .quick-info-item { 
    font-size: 11px; 
    padding: 10px 8px; 
  }

  /* Product Header (Account Details) */
  .product-header {
    padding: 1.5rem;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .product-image {
    width: 70px;
    height: 70px;
  }
  
  .product-title {
    font-size: 1.25rem;
  }
  
  .product-price {
    font-size: 1.75rem;
  }

  /* Sections */
  .section-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .summary-number {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.125rem;
  }

  /* Account Info */
  .account-info {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }
  
  .account-info > div {
    padding: 0.875rem 0.75rem;
  }
  
  .account-info strong {
    font-size: 0.6rem;
    margin-bottom: 0.35rem;
  }
  
  .account-info div span {
    font-size: 0.8rem;
  }

  /* Items Grid */
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .skin-box,
  .pickaxe-box,
  .dance-box,
  .glider-box {
    padding: 0.5rem;
  }
  
  .skin-box img,
  .pickaxe-box img,
  .dance-box img,
  .glider-box img {
    width: 70px;
    height: 70px;
  }
  
  .items-section .section-title {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }
  
  .vbucks-info {
    padding: 0.4rem 0.75rem;
  }
  
  .vbucks-info img {
    width: 20px;
    height: 20px;
  }
  
  .vbucks-info span {
    font-size: 0.95rem;
  }
  
  .items-content {
    padding: 1rem;
  }

  /* Filters */
  .filter-inputs-row { 
    flex-direction: column; 
  }
  
  .filter-input-group { 
    width: 100%; 
  }
  
  .advanced-filters input[type="text"],
  .advanced-filters input[type="number"],
  .advanced-filters select { 
    width: 100%; 
    min-width: 0; 
  }
  
  .sort-options { 
    flex-direction: column; 
  }
  
  .sort-btn { 
    width: 100%; 
  }

  /* Hero Section - responsive handled in hero.css */

  /* Results Badge */
  .results-badge-pill {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }

  /* Error Page */
  .error-card {
    padding: 2rem 1.5rem;
  }
  
  .error-icon {
    width: 100px;
    height: 100px;
  }
  
  .error-icon svg {
    width: 50px;
    height: 50px;
  }
  
  .error-code {
    font-size: 3rem;
  }
  
  .error-title {
    font-size: 1.5rem;
  }
  
  .error-message {
    font-size: 1rem;
  }
  
  .error-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============= LARGER MOBILE (480px - 768px) ============= */
@media (min-width: 480px) and (max-width: 768px) {
  .items-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============= MEDIUM TABLET/DESKTOP (769px - 1024px) ============= */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Hero responsive handled in hero.css */
}

/* ============= LARGE SCREENS (1400px+) ============= */
@media (min-width: 1400px) {
  .container {
    max-width: 1500px;
  }
  
  .footer-content {
    max-width: 1500px;
  }
}

/* ============= VERY SMALL SCREENS (max 400px) ============= */
@media (max-width: 400px) {
  .logo {
    max-width: 160px;
  }
  
  header {
    padding: 0.75rem 0.75rem;
  }
  
  .account-card-top {
    padding: 16px 18px;
    gap: 12px;
  }
  
  .account-icon {
    width: 48px;
    height: 48px;
  }
  
  .account-title {
    font-size: 15px;
  }
  
  .account-price {
    font-size: 18px;
  }
  
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .categoryLinks .link {
    width: 60px;
    height: 60px;
  }
  
  .categoryLinks .link img {
    width: 32px;
    height: 32px;
  }
}

/* ============= PRINT STYLES ============= */
@media print {
  .header-actions,
  .back-to-top,
  .footer,
  .filters-container,
  .pagination,
  .categoryLinks {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .account-card,
  .product-header,
  .summary-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* ============= LANDSCAPE MOBILE ============= */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: 3rem 2rem;
  }
  
  .floating-icon:nth-child(n+7) {
    display: none;
  }
}

/* ============= HIGH DPI SCREENS ============= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo,
  .product-image,
  .account-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ============= DARK MODE (Always Active) ============= */
/* Dark mode is the only mode - no light mode needed */

/* ============= REDUCED MOTION ============= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .back-to-top,
  .account-card,
  .feature-card,
  .categoryLinks .link {
    transition: none !important;
  }
}

/* ============= TOUCH DEVICES ============= */
@media (hover: none) and (pointer: coarse) {
  /* تحسينات للأجهزة اللمسية */
  .btn,
  .sort-pill,
  .sort-btn,
  .page-btn {
    min-height: 44px; /* حد أدنى للمس */
  }
  
  .categoryLinks .link:hover::after {
    display: none; /* إخفاء Tooltip في الأجهزة اللمسية */
  }
}

/* ============= KEYBOARD NAVIGATION ============= */
@media (prefers-reduced-motion: no-preference) {
  :focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
  }
}

