/* ============================================================
   RESPONSIVE.CSS — Seth MU
   Breakpoints:
     Mobile S:  < 480px
     Mobile L:  480px – 767px
     Tablet:    768px – 1023px
     Desktop:   1024px – 1199px
     Wide:      ≥ 1200px
   ============================================================ */

/* ── 1. RESET CRÍTICO — quita el min-width fijo ── */
html {
  min-width: 0 !important;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
}

/* ── 2. CONTENEDORES GLOBALES ── */
.main-wrapper,
.section-container,
.sethmu-navbar-inner,
.global-top-bar-content {
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

/* ── 3. IMÁGENES FLUIDAS ── */
img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   TABLET  768px – 1023px
   ============================================================ */
@media (max-width: 1023px) {

  /* Navbar */
  .sethmu-navbar-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
  }
  .snav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 4px 0;
    border-top: 1px solid rgba(155,17,30,0.2);
  }
  .snav-item {
    padding: 10px 14px;
    font-size: 11px;
    letter-spacing: 1px;
  }
  .snav-actions {
    order: 2;
  }

  /* Hero */
  .hero-stats-row {
    gap: 12px;
  }
  .hero-stat-side {
    padding: 14px 20px;
    min-width: 120px;
  }
  .hero-stat-side .hero-stat-num { font-size: 42px; }
  .hero-stat-center {
    width: 140px;
    height: 140px;
  }
  .hero-stat-num-big { font-size: 42px; }
  .hero-btn-main,
  .hero-btn-outline {
    padding: 13px 32px;
    font-size: 13px;
    letter-spacing: 2px;
  }
  .hero-rates {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .hero-rate { padding: 0 12px; }
  .hero-rate-div { height: 36px; }

  /* Grids */
  .unique-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .rankings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Castle Siege */
  .cs-layout {
    flex-direction: column;
    gap: 24px;
    padding: 28px 24px;
    text-align: center;
  }
  .cs-info-wrap { align-items: center; }
  .cs-divider { width: 100%; }

  /* Rankings menu */
  .rankings_menu a {
    width: 130px;
    font-size: 11px;
    padding: 4px 2px;
  }

  /* Tables */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Floating buttons — smaller on tablet */
  .float-btn { width: 44px; height: 44px; }
  .float-btn i { width: 44px; line-height: 44px; font-size: 17px; }
}

/* ============================================================
   MOBILE  < 768px
   ============================================================ */
@media (max-width: 767px) {

  /* ── Top bar — hide on mobile ── */
  .global-top-bar { display: none; }

  /* ── Navbar ── */
  .sethmu-navbar-inner {
    padding: 8px 12px;
    gap: 6px;
  }
  .snav-logo-img { height: 28px; }
  .snav-links {
    gap: 0;
    padding: 2px 0 6px;
  }
  .snav-item {
    padding: 8px 10px;
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .snav-login-btn,
  .snav-panel-btn,
  .snav-logout-btn,
  .snav-register-btn {
    padding: 7px 14px !important;
    font-size: 11px !important;
    letter-spacing: 1px;
  }

  /* ── Hero ── */
  .hero-section { min-height: 420px; }
  .hero-inner { padding: 28px 16px 50px; }
  .hero-logo-img { max-height: 130px; }
  .hero-stats-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .hero-stat-side {
    width: 100%;
    max-width: 280px;
    padding: 12px 16px;
    min-width: unset;
  }
  .hero-stat-side .hero-stat-num { font-size: 36px; }
  .hero-stat-center {
    width: 120px;
    height: 120px;
    order: -1;
  }
  .hero-stat-num-big { font-size: 36px; }
  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .hero-btn-main,
  .hero-btn-outline {
    width: 100%;
    max-width: 300px;
    padding: 14px 24px;
    font-size: 13px;
    letter-spacing: 2px;
    justify-content: center;
  }
  .hero-rates {
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 12px;
    justify-content: center;
  }
  .hero-rate { padding: 6px 12px; }
  .hero-rate-div { display: none; }
  .rate-val { font-size: 15px; }

  /* ── Grids ── */
  .unique-grid,
  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rankings-grid { grid-template-columns: 1fr; }

  /* ── Castle Siege ── */
  .cs-layout {
    padding: 20px 16px;
    gap: 16px;
  }
  .cs-logo-ring { width: 130px; height: 130px; }
  .cs-logo-ring img { width: 110px !important; height: 110px !important; }
  .cs-owner-name { font-size: 18px; }
  .cs-countdown { font-size: 22px; }

  /* ── Rankings menu ── */
  .rankings_menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
  }
  .rankings_menu a {
    width: calc(50% - 8px);
    font-size: 10px;
    padding: 6px 4px;
    letter-spacing: 0.5px;
  }

  /* ── Rankings filter bar ── */
  .rankings-filter-bar .row {
    justify-content: center;
  }
  .rankings-filter-bar .col-2 {
    width: 20%;
    min-width: 60px;
  }

  /* ── Tables ── */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mu-rank-table th,
  .mu-rank-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
  .mu-rank-avatar { width: 28px !important; height: 28px !important; }

  /* ── Main layout — stack sidebar below content ── */
  .col-lg-8, .col-lg-4 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* ── Page title ── */
  .page-title { font-size: 22px; }

  /* ── Forms ── */
  .form-control,
  input[type=text],
  input[type=password],
  input[type=number] {
    font-size: 16px; /* prevents iOS zoom */
  }
  .input-group { flex-wrap: nowrap; }
  .input-group-text { font-size: 12px; padding: 6px 8px; }

  /* ── Buttons — full width on mobile ── */
  .btn-block-mobile {
    display: block;
    width: 100%;
  }

  /* ── Floating social buttons ── */
  .floating-social {
    top: auto;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 10px;
  }
  .float-btn {
    border-radius: 50px;
    width: 46px;
    height: 46px;
  }
  .float-btn i {
    width: 46px;
    line-height: 46px;
    font-size: 18px;
  }
  .float-btn-label { display: none !important; }
  .float-btn:hover { width: 46px; }

  /* ── Footer ── */
  .sethmu-footer { padding: 20px 12px; }
  .footer-links { gap: 6px; }
  .footer-links a { font-size: 11px; }

  /* ── Section padding ── */
  .section-dark,
  .section-ruby,
  .section-community { padding: 36px 0; }
  .section-title { font-size: 20px; letter-spacing: 2px; }

  /* ── Profile pages ── */
  .gp-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
  }
  .gp-guild-name { font-size: 1.4rem; }
  .gp-vitality-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .gp-stat-value { font-size: 1.1rem; }
  .gp-roster-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .gp-vitality, .gp-commandments, .gp-roster, .gp-alliances { padding: 12px; }

  .pp-header {
    flex-wrap: wrap;
    padding: 16px 12px;
    gap: 12px;
  }
  .pp-char-name { font-size: 1.4rem; }
  .pp-panels { grid-template-columns: 1fr; gap: 12px; }
  .pp-info-bar { flex-direction: column; }
  .pp-info-divider { width: auto; height: 1px; }

  /* ── UserCP ── */
  .uc-quick-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .uc-coins-bar { flex-direction: column; }
  .uc-coin-divider { width: auto; height: 1px; }
  .uc-info-label { width: 100px; font-size: 0.7rem; }
  .uc-char-card { flex-direction: column; }

  /* ── Donation / shop packs ── */
  .row.justify-content-center > [class*="col-"] {
    margin-bottom: 12px;
  }
}

/* ============================================================
   MOBILE S  < 480px
   ============================================================ */
@media (max-width: 479px) {

  /* Navbar — collapse nav links into 2 per row */
  .snav-links { display: grid; grid-template-columns: repeat(2, 1fr); }
  .snav-item {
    justify-content: center;
    padding: 8px 6px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .snav-actions { width: 100%; justify-content: center; order: 2; }
  .snav-login-btn,
  .snav-panel-btn,
  .snav-logout-btn,
  .snav-register-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px !important;
    font-size: 10px !important;
  }

  /* Hero */
  .hero-logo-img { max-height: 100px; }
  .hero-stat-side .hero-stat-num { font-size: 28px; }
  .hero-stat-num-big { font-size: 28px; }
  .hero-stat-center { width: 100px; height: 100px; }
  .hero-btn-main,
  .hero-btn-outline {
    font-size: 12px;
    padding: 12px 20px;
    letter-spacing: 1.5px;
  }

  /* Rankings menu — 1 per row on very small screens */
  .rankings_menu a { width: 100%; max-width: 280px; }

  /* UserCP quick cards — 1 column */
  .uc-quick-grid { grid-template-columns: 1fr; }

  /* Guild roster — 1 column */
  .gp-roster-grid { grid-template-columns: 1fr; }

  /* Vitality — stack */
  .gp-vitality-grid { grid-template-columns: 1fr; }

  /* Tables — hide less important columns */
  .mu-rank-table .mu-rank-th:nth-child(2),
  .mu-rank-table td:nth-child(2) { display: none; }

  /* Page title */
  .page-title { font-size: 18px; }

  /* Section title */
  .section-title { font-size: 17px; letter-spacing: 1.5px; }
}

/* ============================================================
   WIDE DESKTOP  ≥ 1200px — keep max-width centered
   ============================================================ */
@media (min-width: 1200px) {
  .main-wrapper,
  .section-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   UTILITY — touch-friendly tap targets
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  /* Minimum 44px tap target for all interactive elements */
  a, button, .btn, input[type=submit], input[type=button],
  .rankings_menu a, .snav-item, .uc-quick-card, .gp-member-card {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Larger form inputs on touch */
  .form-control,
  input[type=text],
  input[type=password],
  input[type=number],
  select {
    min-height: 48px;
    font-size: 16px !important;
  }

  /* No hover effects that require hover */
  .unique-card:hover,
  .feature-card:hover,
  .gp-stat-card:hover,
  .pp-stat-card:hover,
  .uc-quick-card:hover {
    transform: none;
  }
}

/* ============================================================
   PRINT — hide decorative elements
   ============================================================ */
@media print {
  #video-viewport,
  .floating-social,
  .sethmu-navbar,
  .global-top-bar,
  .sethmu-footer { display: none !important; }
  body { background: #fff; color: #000; }
}
