/**
 * ASSIST Store - Master Mobile & Responsive Stylesheet
 * 100% Pixel-Perfect UI/UX for iOS & Android Mobile Devices, Tablets, and Desktops.
 */

/* ==========================================================================
   1. TABLET & MEDIUM SCREENS (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }

  .header-search-wrap {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .category-circles-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px 10px;
  }

  .products-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .split-sections-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .shop-layout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .shop-sidebar {
    display: none;
  }

  .btn-mobile-filter-trigger {
    display: inline-flex;
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

/* ==========================================================================
   2. MOBILE PHONES (max-width: 768px) - Complete Touch Optimization
   ========================================================================== */
@media (max-width: 768px) {
  .shop-header-banner {
    padding: 20px 0 16px;
    margin-bottom: 20px;
  }

  .shop-page-title {
    font-size: 1.45rem;
  }

  .shop-page-subtitle {
    font-size: 0.82rem;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
  }

  .toolbar-controls-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .sort-selector-wrap {
    flex: 1;
  }

  .sort-select-box {
    width: 100%;
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .btn-mobile-filter-trigger {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  /* --- Reset Horizontal Overflow & Container Padding --- */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* --- 1. Top Bar --- */
  .top-bar-section {
    padding: 6px 0;
  }

  .top-bar-inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    align-items: center;
  }

  .top-bar-announcement {
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .top-bar-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .top-selector {
    padding: 3px 8px;
    font-size: 0.74rem;
  }

  .top-selector select {
    font-size: 0.72rem;
  }

  /* --- 2. Main Header --- */
  .main-header {
    padding: 10px 0 12px;
  }

  .header-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
  }

  /* Top Row of Header: Logo on Left, Action Icons on Right */
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px;
  }

  .brand-logo-wrap {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
  }

  .brand-logo-img {
    height: 44px;
    width: auto;
    max-width: 140px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Compact Circular Action Buttons on Mobile */
  .action-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
    position: relative;
    transition: all var(--transition-fast);
  }

  .action-item:hover {
    border-color: var(--gold-primary);
    background: var(--bg-card-hover);
  }

  .action-icon-box {
    font-size: 1.05rem;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .action-badge-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
  }

  [dir="rtl"] .action-badge-count {
    right: auto;
    left: -3px;
  }

  /* Hide verbose text labels in header buttons on mobile */
  .action-text-meta {
    display: none !important;
  }

  /* Bottom Row of Header: Full-Width Search */
  .header-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    margin-top: 2px;
  }

  .search-bar-form {
    height: 42px;
    border-radius: var(--radius-full);
  }

  .search-input {
    font-size: 0.84rem;
    padding: 0 16px;
  }

  .search-submit-btn {
    padding: 0 16px;
    font-size: 0.95rem;
  }

  .live-search-dropdown {
    top: calc(100% + 6px);
    max-height: 65vh;
    border-radius: var(--radius-sm);
  }

  .popular-trends-grid {
    grid-template-columns: 1fr;
  }

  /* --- 3. All Categories Trigger Bar --- */
  .categories-nav-bar {
    padding: 0;
    margin-bottom: 8px;
    position: relative;
    z-index: 1000;
  }

  .nav-bar-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .all-categories-trigger-btn {
    flex: 1;
    min-width: 0;
    width: auto;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    gap: 6px;
  }

  .all-categories-trigger-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-quick-links {
    flex-shrink: 0;
    margin: 0;
    gap: 6px;
  }

  .nav-shop-direct-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    gap: 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(223, 186, 104, 0.25);
  }

  /* Fullscreen Mega Menu on Mobile */
  .categories-nav-bar.mega-menu-open,
  .categories-nav-bar:has(.mega-menu-flyout.show) {
    z-index: 100100 !important;
  }

  .mega-menu-overlay {
    z-index: 100090 !important;
  }

  .mega-menu-flyout {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    overflow-y: auto;
    z-index: 100100 !important;
    background: var(--bg-surface);
    display: none;
  }

  .mega-menu-flyout.show {
    display: flex;
    flex-direction: column;
  }

  .mega-menu-top-header {
    padding: 10px 14px;
    background: linear-gradient(180deg, #0d1730 0%, #060a14 100%);
    border-bottom: 1.5px solid var(--gold-border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  }

  .mega-menu-header-title {
    gap: 8px;
    font-size: 0.88rem;
    min-width: 0;
    flex: 1;
  }

  .mega-menu-title-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .mega-menu-title-text {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .mega-menu-close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-white);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
  }

  .mega-menu-close-btn .mega-menu-close-text,
  .mega-menu-close-btn span {
    display: none !important; /* Hide 'إغلاق / Close' text on mobile completely! */
  }

  .mega-menu-close-btn:active {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: scale(0.92);
  }

  .mega-menu-grid-wrap {
    flex-direction: column;
    min-height: auto;
  }

  .mega-menu-sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    background: var(--bg-darkest);
    border-left: none;
    border-bottom: 2px solid var(--gold-border);
    padding: 0;
    scrollbar-width: none;
  }

  .mega-sidebar-item {
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 0.86rem;
    border-right: none;
    border-bottom: 3px solid transparent;
  }

  .mega-sidebar-item.active {
    border-right-color: transparent;
    border-bottom-color: var(--gold-primary);
    background: var(--bg-card);
  }

  .mega-menu-content {
    padding: 16px;
  }

  .mega-leagues-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-height: none;
  }

  /* --- 4. Hero Slider Minimalist Luxury Mobile Layout --- */
  .hero-slider-section {
    min-height: 330px;
    background: #060a14;
    border-bottom: 1px solid var(--border-subtle);
  }

  .hero-slider-track {
    height: 350px;
  }

  .hero-slide {
    background: radial-gradient(circle at 50% 30%, rgba(223, 186, 104, 0.12) 0%, rgba(8, 13, 26, 0.95) 75%), #060a14 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .slide-content {
    padding: 16px 14px 24px;
    max-width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* Clean minimal: Remove messy background sketches on mobile */
  .slide-player-sketch,
  .slide-player-sketch.player-left,
  .slide-player-sketch.player-right,
  .player-glow-aura,
  .player-tag-pill {
    display: none !important;
  }

  .slide-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    margin-bottom: 8px;
    background: rgba(223, 186, 104, 0.1);
    border: 1px solid rgba(223, 186, 104, 0.35);
    border-radius: var(--radius-full);
    color: var(--gold-light);
  }

  .duel-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 2px;
    color: var(--gold-light);
    text-transform: uppercase;
  }

  .duel-headline {
    font-size: 2.3rem;
    gap: 8px;
    direction: ltr !important;
    margin: 2px 0 6px;
    justify-content: center;
    font-family: 'Bebas Neue', 'Cairo', sans-serif;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(223, 186, 104, 0.25);
  }

  [dir="rtl"] .duel-headline {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.3;
    padding-bottom: 4px;
    direction: ltr !important;
  }

  .duel-vs-badge {
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--gold-gradient);
    color: #060a14;
    font-weight: 900;
  }

  .slide-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
    margin-bottom: 16px;
    max-width: 320px;
  }

  .slide-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: auto;
    justify-content: center;
    align-items: center;
  }

  .slide-actions .btn {
    height: 40px;
    padding: 0 18px;
    font-size: 0.82rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    justify-content: center;
    flex: initial;
    max-width: none;
  }

  .slide-actions .slide-cta {
    background: var(--gold-gradient);
    color: #060a14;
    box-shadow: 0 4px 16px rgba(223, 186, 104, 0.35);
  }

  .slide-actions .btn-glass {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 0 14px;
    font-size: 0.78rem;
  }

  .hero-slider-dots {
    bottom: 10px;
  }

  .slider-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
  }

  .slider-dot.active {
    width: 18px;
    background: var(--gold-primary);
  }

  /* --- 5. Category Circles (ASSIST STORE) - Clean 3x3 Grid --- */
  .category-circles-section {
    padding: 28px 0 16px;
  }

  .section-headline-center {
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 1.35rem;
    letter-spacing: 1px;
  }

  .category-circles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
    justify-items: center;
    width: 100%;
  }

  .category-circle-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .category-circle-icon {
    width: 76px;
    height: 76px;
    min-width: 76px;
    min-height: 76px;
    border-radius: 50%;
    margin-bottom: 6px;
  }

  .category-circle-title {
    font-size: 0.76rem;
    max-width: 90px;
    line-height: 1.25;
    text-align: center;
  }

  [dir="rtl"] .category-circle-title {
    font-size: 0.78rem;
  }

  /* --- 6. New Arrivals (2 Cards Per Row - World Class Standard) --- */
  .store-section {
    padding: 28px 0;
  }

  .section-header-row {
    margin-bottom: 18px;
  }

  .section-heading-lg {
    font-size: 1.45rem;
  }

  .products-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }

  .product-card {
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .product-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    margin-bottom: 8px;
  }

  .product-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    top: 6px;
    left: 6px;
  }

  [dir="rtl"] .product-badge {
    left: auto;
    right: 6px;
  }

  .product-wishlist-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    top: 6px;
    right: 6px;
  }

  [dir="rtl"] .product-wishlist-btn {
    right: auto;
    left: 6px;
  }

  .product-title {
    font-size: 0.82rem;
    line-height: 1.35;
    min-height: 34px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-rating {
    display: none !important;
  }

  .product-price-row {
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: baseline;
  }

  .current-price {
    font-size: 0.95rem;
    font-weight: 900;
  }

  .old-price {
    font-size: 0.76rem;
  }

  .product-card-actions .qty-stepper {
    display: none !important;
  }

  .btn-add-cart {
    width: 100%;
    padding: 8px 4px;
    font-size: 0.75rem;
    border-radius: 6px;
    justify-content: center;
  }

  /* --- 7. Featured Products & Mystery Packs Split Section --- */
  .split-sections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    width: 100%;
    max-width: 100%;
  }

  .split-column {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .split-column-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    word-break: break-word;
    text-align: center;
  }

  .featured-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .featured-product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .featured-thumb {
    width: 68px;
    height: 68px;
    min-width: 68px;
    max-width: 68px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .featured-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .featured-title {
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .featured-price .price-val {
    font-size: 0.92rem;
  }

  .bestsellers-pack-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .bestseller-pack-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .pack-circle-thumb {
    width: 64px;
    height: 64px;
    margin: 0 auto 6px;
  }

  .pack-size-title {
    font-size: 0.82rem;
    margin-bottom: 2px;
  }

  .pack-curr {
    font-size: 0.9rem;
  }

  /* Show All / View All Section Buttons Mobile */
  .section-footer-action {
    margin-top: 18px;
    width: 100%;
  }

  .column-footer-action {
    margin-top: 14px;
    width: 100%;
  }

  .btn-view-all-section {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.82rem;
    justify-content: center;
  }

  /* --- 8. Quick View Bottom-Sheet Modal --- */
  .assist-modal {
    padding: 0;
    align-items: flex-end;
    z-index: 99999;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    margin: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    padding: 14px 18px;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 16px 18px 28px;
  }

  .quick-view-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .qv-main-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 280px;
    border-radius: 10px;
    margin: 0 auto;
  }

  .qv-thumbnails-track {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
  }

  .qv-thumb-item {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 6px;
  }

  .qv-title {
    font-size: 1.15rem;
  }

  .qv-current-price {
    font-size: 1.25rem;
  }

  .size-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .size-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .print-inputs-row {
    flex-direction: column;
    gap: 6px;
  }

  .qv-actions {
    gap: 8px;
    margin-top: 8px;
  }

  .qv-actions .btn-gold {
    padding: 12px;
    font-size: 0.88rem;
    font-weight: 800;
  }

  /* --- 9. Cart Drawer on Mobile --- */
  .cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .cart-drawer-header {
    padding: 14px 18px;
  }

  .cart-drawer-body {
    padding: 14px 18px;
  }

  .cart-drawer-footer {
    padding: 14px 18px 24px;
  }

  /* --- 10. Store Footer --- */
  .store-footer {
    padding: 36px 0 20px;
    margin-top: 36px;
    text-align: center;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    text-align: center;
    margin-bottom: 28px;
  }

  .footer-brand-col {
    align-items: center;
    text-align: center;
  }

  .footer-logo-img {
    height: 50px;
    margin: 0 auto;
  }

  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  .footer-links {
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-contact-list .contact-link {
    justify-content: center;
    font-size: 0.95rem;
  }

  .support-status-badge {
    margin: 0 auto;
  }

  .location-item {
    justify-content: center;
  }

  .footer-bottom-row {
    flex-direction: column;
    gap: 14px;
    text-align: center;
    padding-top: 18px;
  }

  .payment-badges-row {
    justify-content: center;
  }

  /* --- 11. Floating Social Buttons --- */
  .floating-social-buttons {
    bottom: 16px;
    right: 14px;
    gap: 8px;
    z-index: 990;
  }

  [dir="rtl"] .floating-social-buttons {
    right: auto;
    left: 14px;
  }

  .floating-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
}

/* ==========================================================================
   3. EXTRA SMALL PHONES (< 400px) - iPhone SE & Compact Androids
   ========================================================================== */
@media (max-width: 400px) {
  .duel-headline {
    font-size: 1.85rem;
  }

  [dir="rtl"] .duel-headline {
    font-size: 1.55rem;
  }

  .slide-actions {
    flex-direction: column;
    gap: 8px;
  }

  .slide-actions .btn {
    max-width: 100%;
    width: 100%;
  }

  .category-circle-icon {
    width: 66px;
    height: 66px;
    min-width: 66px;
    min-height: 66px;
  }

  .category-circle-title {
    font-size: 0.7rem;
  }

  .products-grid-4 {
    gap: 8px;
  }

  .product-card {
    padding: 8px;
  }

  .product-title {
    font-size: 0.76rem;
  }

  .current-price {
    font-size: 0.88rem;
  }

  .btn-add-cart {
    font-size: 0.7rem;
    padding: 7px 4px;
  }

  .mega-menu-top-header {
    padding: 8px 12px;
  }

  .mega-menu-title-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.75rem;
  }

  .mega-menu-title-text {
    font-size: 0.8rem;
  }

  .mega-menu-close-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 1rem;
  }
}
