/* Capa responsive transversal. Se carga al final para armonizar los módulos. */
html {
  overflow-x: clip;
}

body,
main {
  min-width: 0;
}

img,
video,
iframe {
  max-width: 100%;
}

input,
select,
textarea,
button {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 680px;
}

dialog {
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 20px);
}

@media (max-width: 1100px) {
  .site-header {
    padding-inline: 18px;
  }

  .header-brand-area {
    gap: 16px;
  }

  .dashboard-shell,
  .catalog {
    width: min(100% - 24px, 1180px);
  }

  .catalog {
    padding-inline: 0;
    margin-inline: auto;
  }

  .page-heading h1 {
    font-size: clamp(2rem, 6vw, 3.8rem);
  }
}

@media (max-width: 980px) {
  .site-header {
    column-gap: 12px;
  }

  .site-header nav.is-open {
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-header nav > .button,
  .site-header nav > a,
  .nav-group summary,
  .nav-dropdown a,
  .nav-dropdown .link-button {
    min-height: 44px;
  }

  .header-wallet-balance {
    justify-content: space-between;
  }

  .publisher-admin-row,
  .customer-subscription-grid,
  .wallet-summary,
  .payout-request-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-shell,
  .dashboard-shell.ads-page,
  .catalog {
    width: calc(100% - 20px);
    margin-top: 24px;
    margin-bottom: 48px;
  }

  .hero {
    min-height: 0;
    padding: 44px 18px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.75rem, 15vw, 4.25rem);
    overflow-wrap: anywhere;
  }

  .hero p {
    font-size: 1rem;
  }

  .page-heading,
  .tier-banner,
  .active-trip-card,
  .profile-status-card,
  .profile-chat-card {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading {
    gap: 14px;
    margin-bottom: 20px;
  }

  .page-heading > .button,
  .tier-banner > .button,
  .profile-status-card .button,
  .profile-chat-card .button {
    width: 100%;
  }

  .form-card,
  .auth-card,
  .profile-preview-frame {
    padding: 20px;
    border-radius: 17px;
  }

  .auth-shell {
    min-height: auto;
    padding: 28px 10px 48px;
  }

  .auth-card h1 {
    font-size: clamp(1.75rem, 9vw, 2.2rem);
  }

  .form-grid,
  .price-grid,
  .admin-columns,
  .subscription-price-grid,
  .customer-subscription-grid,
  .wallet-summary,
  .payout-request-card,
  .ads-manage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-actions,
  .payment-options,
  .subscription-payment-options {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions > *,
  .form-actions form,
  .form-actions .button,
  .payment-options form,
  .payment-options .button,
  .subscription-payment-options form,
  .subscription-payment-options .button {
    width: 100%;
  }

  .inline-admin-form,
  .filter-form {
    align-items: stretch;
  }

  .inline-admin-form label,
  .filter-form input,
  .filter-form select {
    flex: 1 1 180px;
  }

  .table-card {
    padding: 16px;
  }

  .table-wrap table {
    min-width: 620px;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .media-grid,
  .bonus-plan-grid,
  .public-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 14px;
  }

  .media-actions,
  .ad-card-actions {
    flex-wrap: wrap;
  }

  .profile-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .profile-dialog > div {
    padding: 18px;
  }

  .profile-modal-head h2 {
    font-size: clamp(1.8rem, 10vw, 2.8rem);
  }

  .modal-loading {
    padding: 42px 14px;
  }

  .image-lightbox,
  .ad-photo-dialog {
    width: calc(100% - 12px);
    height: calc(100dvh - 12px);
    border-radius: 12px;
  }

  .gallery-workspaces {
    gap: 18px;
  }

  .gallery-workspace,
  .new-gallery-panel {
    border-radius: 16px;
  }

  .gallery-content-strip {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .chat-inbox-item,
  .notification-item {
    align-items: flex-start;
  }

  .chat-message,
  .ad-message-thread article {
    max-width: 88%;
  }

  .travel-map {
    height: min(55vh, 300px);
  }

  .active-trip-strip {
    gap: 9px;
    padding: 10px 12px;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 62px;
    padding-inline: 10px;
  }

  .header-brand-area {
    gap: 8px;
  }

  .brand {
    font-size: 1.3rem;
  }

  .header-ads-link {
    min-height: 40px;
    padding: 2px 7px 2px 2px;
  }

  .header-ads-link img {
    width: 35px;
    height: 35px;
  }

  .header-ads-link span {
    max-width: 62px;
    font-size: .66rem;
  }

  .nav-toggle {
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
  }

  .nav-toggle b {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dashboard-shell,
  .dashboard-shell.ads-page,
  .catalog {
    width: calc(100% - 12px);
  }

  .form-card,
  .auth-card,
  .profile-preview-frame,
  .table-card {
    padding: 15px;
  }

  .form-card input,
  .form-card textarea,
  .form-card select,
  .stack-form input,
  .stack-form select {
    padding: 12px;
  }

  .compound-field {
    grid-template-columns: minmax(0, 1fr) minmax(76px, auto);
  }

  .compound-field select {
    min-width: 76px;
    width: 100%;
  }

  .formula-box,
  .plan-period-price,
  .gallery-upload-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .formula-box {
    gap: 8px;
    padding: 16px;
    font-size: .95rem;
  }

  .formula-box strong {
    font-size: 1.5rem;
  }

  .ad-city-picker,
  .ads-page .ad-city-picker {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ad-city-picker .button {
    width: 100%;
  }

  .ad-card {
    padding: 8px;
  }

  .ad-card > header,
  .ad-card > footer {
    grid-template-columns: 1fr auto;
  }

  .ad-card > header > strong {
    text-align: right;
  }

  .ad-card > header > span:last-child {
    grid-column: 1 / -1;
    text-align: left;
  }

  .ad-card-main {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .ad-detail-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .my-ads-list > article,
  .favorite-ad-list article {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
  }

  .my-ads-list img,
  .favorite-ad-list img {
    width: 72px;
    height: 72px;
  }

  .my-ads-list > article > form,
  .favorite-ad-list article > :last-child {
    grid-column: 1 / -1;
  }

  .ad-schedule-form,
  .chat-compose,
  .travel-search,
  .promo-redeem-card,
  .promo-redeem-card form,
  .new-gallery-form,
  .gallery-upload-form {
    grid-template-columns: 1fr;
  }

  .notification-item,
  .chat-inbox-item,
  .chat-safety {
    flex-direction: column;
  }

  .notification-item .button,
  .chat-safety .button {
    width: 100%;
  }

  .chat-message,
  .ad-message-thread article {
    max-width: 94%;
  }

  .profile-facts,
  .profile-data .profile-facts,
  .grid-size-summary,
  .transfer-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-trip-note {
    align-items: flex-start;
  }

  .legal-page {
    width: calc(100% - 12px);
    padding: 18px 15px;
  }

  .adult-gate {
    width: calc(100% - 12px);
    padding: 22px 16px;
  }

  .adult-gate-mark {
    width: 66px;
    height: 66px;
    font-size: 1.55rem;
  }

  footer {
    padding: 22px 12px;
    line-height: 1.7;
  }
}

@media (max-width: 380px) {
  .header-ads-link span {
    display: none;
  }

  .ad-card-main {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .ad-copy dl {
    grid-template-columns: 1fr;
  }

  .ad-card > footer {
    grid-template-columns: 1fr;
  }

  .ad-card > footer .ad-status {
    text-align: left;
  }

  .button,
  .location-button {
    padding-inline: 16px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .profile-card:hover .profile-tile-details {
    opacity: 0;
  }

  .profile-card:focus .profile-tile-details {
    opacity: 1;
  }

  .button,
  .link-button,
  summary,
  .language-option,
  .ad-star-picker .ad-star-button {
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
