/* ═══════════════════════════════════════════
   RBXTRADE — Layouts específicos
   Desktop / Tablet / Mobile
   ═══════════════════════════════════════════ */

/* ── Tablet (768–1023) ── */
@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 2rem;
  }

  .hero-visual {
    min-height: 320px;
    order: 2;
  }

  .hero-content { order: 1; }

  .hero-product-card {
    transform: none;
    max-width: 300px;
  }

  .stats-cards { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-value { font-size: 1.25rem; }

  .steps-flow {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 420px;
  }

  .step-connector {
    display: none;
  }

  .steps { grid-template-columns: 1fr; gap: 1rem; max-width: 400px; margin: 0 auto; }

  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages { grid-template-columns: repeat(2, 1fr); }

  .section-header-games {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .cta-banner .btn { width: 100%; }

  .footer-grid,
  .footer-grid-landing {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  /* Sell: 2-col tablet layout */
  .sell-page-wrap { padding: 1rem; }

  .sell-layout {
    grid-template-columns: 200px 1fr;
    grid-template-rows: 1fr auto;
  }

  .nav-links-center {
    position: static;
    transform: none;
  }

  .sell-summary-panel {
    grid-column: 1 / -1;
    max-height: 220px;
  }

  .sell-summary-panel .sell-panel-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
  }

  .sell-summary-panel .summary-list {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1;
  }

  .sell-summary-panel .summary-item {
    min-width: 160px;
    flex-shrink: 0;
  }

  .sell-summary-panel .summary-footer {
    min-width: 200px;
    border-top: none;
    border-left: 1px solid var(--border);
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  /* Chat tablet */
  .chat-layout {
    grid-template-columns: 260px 1fr;
  }

  .msg { max-width: 85%; }

  /* Admin responsive: ver admin.css */
}

/* ── Mobile (< 768) ── */
@media (max-width: 767px) {
  :root {
    --nav-h: 56px;
  }

  body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)); }

  .menu-toggle { display: flex; }

  .nav-links,
  .nav-links-center {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    transform: none;
    background: rgba(9, 9, 11, 0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
    z-index: 99;
  }

  .nav-links.open,
  .nav-links-center.open { display: flex; }

  .nav-link {
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .nav-link.nav-pill.active {
    text-align: center;
  }

  .sell-page-wrap,
  .chat-page-shell {
    padding: 0.75rem;
  }

  .chat-layout {
    height: calc(100vh - var(--nav-h) - var(--mobile-nav-h) - 1.5rem);
    border-radius: 14px;
  }

  .robux-badge { font-size: 0.75rem; padding: 0.3rem 0.55rem; }

  .mobile-nav { display: block; }

  /* Landing: sin bottom nav (como el mockup, solo hamburguesa) */
  body.page-landing {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.page-landing .mobile-nav,
  body.page-landing #mobile-nav {
    display: none !important;
  }

  .desktop-only { display: none !important; }
  .mobile-only { display: flex; }

  /* ── Landing mobile (match mockup) ── */
  .page-landing .hero { padding: 1.25rem 0 2rem; }

  .page-landing .hero-grid {
    gap: 1.5rem;
  }

  .page-landing .hero-content {
    order: 1;
    text-align: left;
  }

  .page-landing .hero-visual {
    order: 3;
    min-height: auto;
    margin-top: 0.25rem;
  }

  .page-landing .hero-badge {
    font-size: 0.62rem;
    margin-bottom: 0.9rem;
  }

  .page-landing .hero-title {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
    text-align: left;
    margin-bottom: 0.85rem;
  }

  .page-landing .hero-sub {
    text-align: left;
    font-size: 0.95rem;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    margin-bottom: 1.1rem;
  }

  .page-landing .hero-features {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1.35rem;
  }

  .page-landing .hero-cta {
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.25rem;
  }

  .page-landing .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .page-landing .hero-social-proof {
    margin-bottom: 0.25rem;
  }

  .page-landing .hero-product {
    width: min(100%, 300px);
  }

  .page-landing .hero-product-card {
    transform: none;
    max-width: 280px;
    padding: 1rem 0.95rem 1.15rem;
  }

  .page-landing .hero-product-stage { min-height: 180px; }
  .page-landing .hero-product-img { width: min(100%, 180px); }
  .page-landing .hero-product-glow {
    width: 260px;
    height: 260px;
  }

  .page-landing .hero-hex svg {
    width: 32px;
    height: 36px;
  }

  .page-landing .stats-cards {
    margin-top: 1.75rem;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .page-landing .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.9rem 0.85rem;
  }

  .page-landing .stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .page-landing .stat-value { font-size: 1.2rem; }
  .page-landing .stat-label { font-size: 0.8rem; }
  .page-landing .stat-hint { font-size: 0.68rem; }

  /* How it works — vertical timeline on mobile */
  .page-landing .steps-flow {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: none;
    position: relative;
    padding-left: 0.25rem;
  }

  .page-landing .step-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    row-gap: 0.2rem;
    text-align: left;
    padding: 0 0 1.5rem 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .page-landing .step-item:hover {
    border: none;
    box-shadow: none;
  }

  .page-landing .step-num-badge {
    position: static;
    transform: none;
    grid-row: 1 / span 2;
    align-self: start;
    width: 32px;
    height: 32px;
    margin-top: 0.15rem;
  }

  .page-landing .step-icon-box {
    display: none;
  }

  .page-landing .step-title {
    grid-column: 2;
    margin-bottom: 0.15rem;
    font-size: 1rem;
  }

  .page-landing .step-desc {
    grid-column: 2;
    font-size: 0.85rem;
  }

  .page-landing .step-connector { display: none; }

  /* Games — compact horizontal-ish grid */
  .page-landing .section-header-games {
    text-align: left;
  }

  .page-landing .section-header-games .section-title,
  .page-landing .section-header .section-title {
    text-align: left;
  }

  .page-landing .section-header .section-sub,
  .page-landing .section-header-games .section-sub {
    margin-left: 0;
    text-align: left;
  }

  .page-landing .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .page-landing .game-card-body {
    padding: 0.65rem 0.7rem 0.75rem;
  }

  .page-landing .game-card-name { font-size: 0.82rem; }
  .page-landing .game-card-count { font-size: 0.7rem; margin-bottom: 0.4rem; }
  .page-landing .game-card-btn {
    font-size: 0.72rem;
    padding: 0.38rem 0.5rem;
  }

  .page-landing .games-see-all-wrap {
    display: block;
  }

  /* Reviews carousel-style scroll */
  .page-landing .reviews-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.75rem;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .page-landing .reviews-grid::-webkit-scrollbar { display: none; }

  .page-landing .review-card {
    min-width: min(86vw, 300px);
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .page-landing .reviews-dots {
    display: flex;
  }

  .page-landing .cta-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.1rem;
    gap: 1.1rem;
    text-align: center;
  }

  .page-landing .cta-banner-left {
    flex-direction: column;
    text-align: center;
  }

  .page-landing .cta-banner .btn { width: 100%; }

  .page-landing .footer-grid-landing {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Generic mobile fallbacks */
  .hero { padding: 1.5rem 0 2.5rem; }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn { width: 100%; }

  .hero-visual { min-height: 220px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.7rem; }

  .section { padding: 2.5rem 0; }

  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  .advantages { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .advantage-card { padding: 1rem; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Sell mobile: stacked steps */
  .sell-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-height: auto;
    padding-bottom: 1rem;
  }

  .sell-games-panel {
    max-height: none;
  }

  .sell-games-panel .sell-panel-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .game-list-item {
    flex-direction: column;
    min-width: 88px;
    text-align: center;
    padding: 0.65rem 0.5rem;
    margin-bottom: 0;
  }

  .game-list-item .name {
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.2;
  }

  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .item-card { padding: 0.6rem; }
  .item-card-img { width: 52px; height: 52px; }

  .items-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select { width: 100%; }

  .sell-summary-panel {
    position: sticky;
    bottom: calc(var(--mobile-nav-h) + 0.5rem);
    z-index: 50;
    max-height: none;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  }

  .sell-summary-panel .sell-panel-body {
    display: none;
  }

  .sell-summary-panel.expanded .sell-panel-body {
    display: block;
    max-height: 200px;
    overflow-y: auto;
  }

  .sell-summary-panel .summary-footer {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  /* Chat mobile */
  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - var(--nav-h) - var(--mobile-nav-h));
  }

  .chat-sidebar {
    display: none;
  }

  .chat-sidebar.mobile-open {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 20;
  }

  .chat-main.hidden-mobile { display: none; }

  .msg { max-width: 90%; }

  .chat-header { padding: 0.65rem 0.85rem; }

  .toast-root {
    left: 0.75rem;
    right: 0.75rem;
    top: auto;
    bottom: calc(var(--mobile-nav-h) + 0.75rem);
  }

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

  /* Admin mobile: ver admin.css */
  .data-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Small mobile ── */
@media (max-width: 380px) {
  .games-grid { grid-template-columns: 1fr 1fr; }
  .advantages { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
}

/* ── Desktop enhancements ── */
@media (min-width: 1024px) {
  .step-arrow {
    display: block;
    position: absolute;
    right: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-green);
    font-size: 1.5rem;
    opacity: 0.4;
    z-index: 2;
  }

  .step-card { position: relative; }
  .step-card:last-child .step-arrow { display: none; }

  .page-landing .games-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Large desktop ── */
@media (min-width: 1280px) {
  .games-grid { grid-template-columns: repeat(5, 1fr); }
  .sell-layout {
    grid-template-columns: 260px 1fr 300px;
  }
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .page-landing .hero-grid {
    gap: 3rem;
  }
}

/* ── Extra-small mobile tweaks ── */
@media (max-width: 380px) {
  .page-landing .hero-title {
    font-size: 1.7rem;
  }

  .page-landing .stats-cards {
    gap: 0.5rem;
  }

  .page-landing .stat-value { font-size: 1.05rem; }
}
