/* ==================== MR SHOP - COMPLETE MOBILE CSS ==================== */
/* Shared across ALL pages for consistent mobile experience */

/* ==================== GLOBAL MOBILE RESET ==================== */
@media (max-width: 768px) {
  html { overflow-x: hidden !important; }
  body { overflow-x: hidden !important; width: 100% !important; max-width: 100vw !important; }
  * { box-sizing: border-box; }
  img, video, iframe, table, pre { max-width: 100% !important; }
  .dark-mode-toggle { display: none !important; }
  .back-to-top { display: none !important; }
  .amz-back-to-top { display: none !important; }
  .footer-quick-links { display: none !important; }

  /* Hide desktop elements */
  .header, .header-top, .nav-bar { display: none !important; }
  .amz-header, .amz-header-top, .amz-nav-bar { display: none !important; }
  .amz-features-bar { display: none !important; }
  .features-bar { display: none !important; }
  .amz-footer { display: none !important; }
  .hero { display: none !important; }

  /* Show mobile elements */
  .m-header, .m-search-wrap, .m-categories, .m-hero, .m-bottom-nav { display: flex !important; }
  .m-features, .m-feat { display: flex !important; }
  .m-page-footer, .m-quick-links, .m-footer-brand { display: block !important; }
  body { padding-bottom: 70px; }
}

/* ==================== MOBILE HEADER ==================== */
.m-header { background: var(--darker, #131921); padding: 12px 16px; align-items: center; gap: 12px; display: none; }
.m-logo-link { display: flex; flex-direction: column; text-decoration: none; flex-shrink: 0; }
.m-logo-text { color: var(--white, #fff); font-size: 20px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.m-logo-sub { color: var(--orange, #ff9900); font-size: 9px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.m-header-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.m-icon { color: var(--white, #fff); font-size: 20px; position: relative; cursor: pointer; text-decoration: none; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.m-icon .badge { position: absolute; top: 2px; right: 2px; background: var(--orange, #ff9900); color: var(--dark, #0f1111); font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.m-cart-icon { color: var(--white, #fff); font-size: 20px; position: relative; cursor: pointer; text-decoration: none; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.m-cart-icon .badge { position: absolute; top: 2px; right: 2px; background: var(--orange, #ff9900); color: var(--dark, #0f1111); font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.badge:empty, .badge[data-count="0"] { display: none !important; }

/* Mobile Dark Mode Toggle */
.m-dark-toggle { background: none; border: none; padding: 0; cursor: pointer; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.m-toggle-track { width: 44px; height: 24px; background: #374151; border-radius: 12px; position: relative; transition: background 0.3s; display: flex; align-items: center; }
.m-toggle-thumb { width: 20px; height: 20px; background: var(--white, #fff); border-radius: 50%; position: absolute; left: 2px; transition: transform 0.3s; z-index: 2; }
.m-toggle-icon-sun, .m-toggle-icon-moon { position: absolute; font-size: 11px; transition: opacity 0.3s; }
.m-toggle-icon-sun { color: #fbbf24; right: 5px; opacity: 1; }
.m-toggle-icon-moon { color: #94a3b8; left: 5px; opacity: 0; }
[data-theme="dark"] .m-toggle-track { background: #6366f1; }
[data-theme="dark"] .m-toggle-thumb { transform: translateX(22px); }
[data-theme="dark"] .m-toggle-icon-sun { opacity: 0; }
[data-theme="dark"] .m-toggle-icon-moon { opacity: 1; }

/* ==================== MOBILE SEARCH ==================== */
.m-search-wrap { background: var(--darker, #131921); padding: 0 12px 14px 12px; display: none; }
.m-search { display: flex; align-items: center; height: 44px; width: 100%; border-radius: 10px; overflow: hidden; background: #232f3e; border: 1px solid #3a4553; }
.m-search-icon { color: #888; padding: 0 12px; font-size: 14px; }
.m-search input { flex: 1; background: transparent; border: none; padding: 0 8px; color: var(--white, #fff); font-size: 14px; outline: none; }
.m-search input::placeholder { color: #888; }
.m-search-filter { background: transparent; border: none; border-left: 1px solid #3a4553; padding: 0 14px; color: #888; font-size: 16px; cursor: pointer; height: 100%; min-width: 44px; }

/* ==================== MOBILE CATEGORY CHIPS ==================== */
.m-categories { background: var(--darker, #131921); padding: 0 16px 14px; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; display: none; touch-action: pan-x; }
.m-categories::-webkit-scrollbar { display: none; }
.m-cat-chip { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 20px; background: rgba(255,255,255,0.08); color: var(--white, #fff); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; flex-shrink: 0; text-decoration: none; min-height: 40px; }
.m-cat-chip.active { background: var(--orange, #ff9900); color: var(--dark, #0f1111); border-color: var(--orange, #ff9900); }
.m-cat-chip i { font-size: 14px; }

/* ==================== MOBILE HERO ==================== */
.m-hero { background-color: #0f1111; background: linear-gradient(rgba(15,17,17,0.5), rgba(15,17,17,0.5)), url('assets/images/hero-bg.png'); background-size: cover; background-position: center; border-radius: 16px; margin: 16px; padding: 28px 20px; position: relative; overflow: hidden; min-height: 220px; display: none; flex-direction: column; justify-content: center; }
.m-hero-tag { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,153,0,0.15); border: 1px solid rgba(255,153,0,0.3); padding: 5px 12px; border-radius: 20px; color: var(--orange, #ff9900); font-size: 11px; font-weight: 600; margin-bottom: 14px; width: fit-content; }
.m-hero h2 { color: var(--white, #fff); font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.m-hero h2 span { color: var(--orange, #ff9900); }
.m-hero p { color: #bbb; font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.m-hero-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--orange, #ff9900); color: var(--dark, #0f1111); padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; border: none; cursor: pointer; width: fit-content; text-decoration: none; min-height: 44px; }
.m-hero-dots { display: flex; gap: 6px; margin-top: 14px; }
.m-hero-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.m-hero-dot.active { background: var(--orange, #ff9900); width: 20px; border-radius: 4px; }

/* ==================== MOBILE FEATURES ROW ==================== */
.m-features { background: var(--darker, #131921); margin: 16px; border-radius: 12px; padding: 16px 10px; display: none; justify-content: space-around; gap: 4px; }
.m-feat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex: 1; }
.m-feat-icon { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,153,0,0.12); display: flex; align-items: center; justify-content: center; color: var(--orange, #ff9900); font-size: 15px; }
.m-feat-title { color: var(--white, #fff); font-size: 11px; font-weight: 600; line-height: 1.3; }
.m-feat-sub { color: #888; font-size: 10px; line-height: 1.3; }

/* ==================== MOBILE BOTTOM NAV ==================== */
.m-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--darker, #131921); border-top: 1px solid #2a3441; padding-top: 8px; padding-bottom: env(safe-area-inset-bottom, 8px); display: none; justify-content: space-around; align-items: center; z-index: 1000; }
.m-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #888; font-size: 10px; font-weight: 500; cursor: pointer; padding: 8px 12px; text-decoration: none; transition: color 0.2s; min-width: 44px; min-height: 44px; justify-content: center; flex: 1; }
.m-nav-item.active, .m-nav-item:hover { color: var(--orange, #ff9900); }
.m-nav-item i { font-size: 20px; }
.m-nav-item span { font-size: 10px; }
.m-nav-sell { background: var(--orange, #ff9900) !important; color: var(--dark, #0f1111) !important; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: -20px; box-shadow: 0 4px 12px rgba(255,153,0,0.4); flex: 0 0 50px; min-width: 50px; }
.m-nav-sell i { font-size: 22px; color: var(--dark, #0f1111) !important; }

/* ==================== MOBILE PAGE FOOTER (Quick Options) ==================== */
.m-page-footer { display: none; background: var(--light, #f5f5f5); padding: 20px 16px 80px; }
.m-page-footer .m-features { background: var(--darker, #131921); margin: 0 0 16px; border-radius: 12px; padding: 16px 10px; }
.m-quick-links { background: var(--white, #fff); border-radius: 12px; border: 1px solid var(--border, #d5d9d9); padding: 8px; margin-bottom: 16px; display: none; flex-wrap: wrap; gap: 6px; }
.m-quick-links a { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 8px; font-size: 13px; color: var(--text, #0f1111); text-decoration: none; transition: all 0.2s; flex: 1; min-width: 44px; min-height: 44px; justify-content: center; }
.m-quick-links a:hover { background: #f0f6ff; color: var(--orange, #ff9900); }
.m-quick-links a i { font-size: 16px; }
.m-footer-brand { text-align: center; padding: 20px 16px; color: var(--text, #0f1111); }
.m-footer-logo { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 12px; }
.m-footer-pay { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.m-footer-pay i { font-size: 22px; }
.m-footer-copy { font-size: 12px; color: #777; }

/* ==================== MOBILE RESPONSIVE - COMMON ELEMENTS ==================== */
@media (max-width: 1024px) {
  .hero-content { padding: 60px 20px; }
  .hero-title { font-size: 42px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-item:nth-child(2), .feature-item:nth-child(4) { border-right: none; }
  .hero-float { display: none; }
}

@media (max-width: 768px) {
  .category-grid { display: flex; overflow-x: auto; gap: 12px; padding: 0 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .category-grid::-webkit-scrollbar { display: none; }
  .cat-card { min-width: 160px; scroll-snap-align: start; flex-shrink: 0; }
  .hero-title { font-size: 36px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  /* Section padding */
  .section { padding: 20px 16px; }
  .section-title { font-size: 18px; }

  /* Product cards mobile */
  .product-img-wrap { height: 160px; padding: 12px; }
  .price-whole { font-size: 18px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-img-wrap { height: 140px; padding: 10px; }
  .price-whole { font-size: 16px; }
}

/* ==================== CART PAGE MOBILE ==================== */
@media (max-width: 768px) {
  .cart-layout { grid-template-columns: 1fr !important; }
  .cart-item { flex-direction: column; align-items: flex-start; }
  .cart-item-img { width: 100% !important; height: auto !important; aspect-ratio: 1; max-width: 200px; margin: 0 auto; }
  .cart-item-details { width: 100%; }
  .cart-item-actions { display: flex; gap: 12px; flex-wrap: wrap; }
  .cart-item-actions a { min-height: 44px; display: flex; align-items: center; }
  .cart-summary { position: static; }
}

/* ==================== CHECKOUT PAGE MOBILE ==================== */
@media (max-width: 768px) {
  .checkout-layout { grid-template-columns: 1fr !important; }
  .step-label { display: none !important; }
  .step-indicator { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .step-indicator::-webkit-scrollbar { display: none; }
  .checkout-form input, .checkout-form select { min-height: 44px; font-size: 16px; }
  .checkout-summary { position: static; }
}

/* ==================== PRODUCT DETAILS MOBILE ==================== */
@media (max-width: 768px) {
  .pd-grid { grid-template-columns: 1fr !important; }
  .pd-gallery { position: static !important; }
  .pd-gallery-main { height: 300px; }
  .pd-thumbs { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
  .pd-thumbs::-webkit-scrollbar { display: none; }
  .pd-thumb { min-width: 60px; min-height: 60px; flex-shrink: 0; }
  .pd-info { padding: 0 16px; }
  .pd-btn { width: 100%; min-height: 44px; }
}

/* ==================== WISHLIST PAGE MOBILE ==================== */
@media (max-width: 768px) {
  .wishlist-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wishlist-card { flex-direction: column; }
  .wishlist-card-actions { flex-direction: row; width: 100%; }
  .wishlist-card-actions button { min-height: 44px; flex: 1; }
}

/* ==================== SEARCH RESULTS MOBILE ==================== */
@media (max-width: 768px) {
  .search-results-layout { grid-template-columns: 1fr !important; }
  .search-sidebar { display: none; }
  .sort-bar { flex-wrap: wrap; gap: 8px; }
  .search-results-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ==================== AUTH PAGES MOBILE ==================== */
@media (max-width: 768px) {
  .auth-container { padding: 20px 16px; }
  .auth-form input { min-height: 44px; font-size: 16px; }
  .auth-btn { min-height: 44px; width: 100%; }
}

/* ==================== ORDER PAGES MOBILE ==================== */
@media (max-width: 768px) {
  .order-card { flex-direction: column; }
  .order-timeline { padding-left: 20px; }
}

/* ==================== PROFILE PAGES MOBILE ==================== */
@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr !important; }
  .profile-sidebar { position: static; }
  .profile-menu-item { min-height: 44px; display: flex; align-items: center; }
}

/* ==================== SELLER PAGES MOBILE ==================== */
@media (max-width: 768px) {
  .seller-dashboard { grid-template-columns: 1fr !important; }
  .seller-sidebar { position: static; }
  .seller-stats { grid-template-columns: 1fr 1fr; }
}

/* ==================== FOOTER MOBILE ==================== */
@media (max-width: 768px) {
  .footer { padding: 30px 16px 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-col h4 { font-size: 14px; }
  .footer-col a { font-size: 12px; }
  .footer-bottom { padding: 16px; }
}
