/* Mobile layout overrides; desktop keeps the existing presentation. */
.sf-mobile-menu, .sf-mobile-contact { display: none; }
.sf-account-details > summary { display: none; }
.sf-ai-mobile-progress { display: none; }
#sf-agent-wizard h3 { scroll-margin-top: 140px; }
.sf-location-summary { display: none; cursor: pointer; font-size: 13px; font-weight: 700; color: #164ca0; }
.sf-location-summary span { display: block; font-weight: 400; color: #64748b; margin-top: 3px; }
#sf-location-banner[open] > summary { margin-bottom: 12px; }
:focus-visible { outline: 2px solid #0866ff; outline-offset: 3px; }
@media (max-width: 767px) {
  .sf-mobile-header-row > a:first-child > div:nth-child(2) { display: none; }
  .sf-mobile-header-row { height: auto !important; min-height: 64px; }
  #sf-search-form-mobile { display: block; flex: 1; min-width: 0; padding: 0; }
  #sf-search-form-mobile input { min-height: 44px; font-size: 13px; padding-right: 8px; }
  .sf-mobile-header-row:has(#sf-search-form-mobile) .sf-mobile-header-actions { margin-left: 0; }
  .sf-mobile-header-row:has(#sf-search-form-mobile) .sf-btn-publish { display: none !important; }
  header nav[aria-label="Categorías principales"] { overflow: visible; margin: 0; padding: 8px 0; }
  header nav[aria-label="Categorías principales"] > div { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); width: 100%; min-width: 0; gap: 2px; }
  header nav[aria-label="Categorías principales"] a { display: flex; flex-direction: column; gap: 5px; padding: 8px 2px; border-radius: 12px; min-width: 0; min-height: 62px; font-size: 10px; line-height: 1.2; white-space: normal; text-align: center; justify-content: center; }
  header nav[aria-label="Categorías principales"] a svg { width: 20px; height: 20px; flex-shrink: 0; }
  #sf-nearby, #sf-results-container.sf-results-grid, #sf-results-container.sf-results-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; overflow: visible; padding: 0; }
  #sf-nearby .sf-card, #sf-results-container .sf-card { width: auto; min-width: 0; flex-direction: column; }
  #sf-nearby .sf-card-img, #sf-results-container .sf-card-img { width: 100%; min-width: 0; height: auto; aspect-ratio: 1; }
  #sf-nearby .sf-card h3, #sf-results-container .sf-card h3 { font-size: 12px; }
  #sf-nearby .sf-card > :last-child, #sf-results-container .sf-card > :last-child { padding: 10px; min-width: 0; }
  #sf-nearby > :not(.sf-card) { grid-column: 1 / -1; }
  .sf-mobile-more { display: block; width: 100%; min-height: 44px; padding: 12px; margin-top: 14px; border-radius: 12px; border: 1px solid #dbe3ef; font-weight: 700; }
  .sf-mobile-header-row { gap: 8px !important; min-width: 0; }
  .sf-mobile-header-row > a:first-child { min-width: 0 !important; flex-shrink: 1; gap: 6px !important; }
  .sf-mobile-header-row > a:first-child span:first-child { font-size: 16px !important; }
  .sf-mobile-header-row > a:first-child > div:first-child { width: 32px; height: 32px; flex-shrink: 0; }
  .sf-mobile-header-actions { gap: 6px !important; flex-shrink: 0; }
  header #sf-auth-btn, header #sf-auth-btn-mobile,
  header a[href="/notificaciones"] { display: none !important; }
  header .sf-btn-publish { min-height: 44px; padding: 8px 12px !important; white-space: nowrap; }
  header .sf-btn-publish span { display: inline !important; }
  .sf-mobile-menu { display: block; position: relative; }
  .sf-mobile-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid #dbe3ef; border-radius: 12px; font-size: 13px; font-weight: 700; padding: 0 8px; }
  .sf-mobile-menu > summary::-webkit-details-marker { display: none; }
  .sf-mobile-menu nav { position: absolute; right: 0; top: calc(100% + 8px); width: 230px; max-height: 70vh; overflow-y: auto; background: white; box-shadow: 0 12px 30px #0f172a26; border: 1px solid #dbe3ef; border-radius: 14px; padding: 8px; z-index: 60; }
  .sf-mobile-menu nav a, .sf-mobile-menu nav button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; text-align: left; font-size: 14px; border-radius: 8px; }
  .sf-mobile-menu nav a:hover, .sf-mobile-menu nav button:hover { background: #eff6ff; }
  .sf-mobile-menu [hidden] { display: none !important; }
  .sf-mobile-menu nav a[href="/notificaciones"] { display: flex !important; }
  header nav[aria-label="Categorías principales"] a { min-height: 44px; }
  .sf-hero-wrapper { padding: 14px 16px !important; margin-bottom: 18px !important; }
  .sf-hero-wrapper h1 { font-size: 21px; margin-bottom: 6px; }
  .sf-hero-wrapper .relative > p:first-child, .sf-hero-wrapper .grid { display: none; }
  .sf-hero-wrapper .relative > p { margin-bottom: 0; font-size: 13px; }
  #sf-location-banner { display: block; padding: 12px; }
  .sf-location-summary { display: list-item; }
  #sf-location-banner:not([open]) > :not(summary) { display: none; }
  #sf-location-banner select, #sf-location-banner button { min-height: 44px; }
  .sf-scroll-row .sf-card { width: 250px; min-width: 250px; }
  .sf-card h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .sf-card .sf-card-excerpt { display: none; }
  .sf-card button, #sf-mobile-filter-close, #sf-active-chips button { min-width: 44px; min-height: 44px; }
  #sf-mobile-filter-drawer button, #sf-mobile-filter-drawer select, #sf-mobile-filter-drawer input[type="number"] { min-height: 44px; }
  #sf-mobile-filter-drawer label { min-height: 44px; }
  .sf-results-list .sf-card { flex-direction: row; min-height: 150px; align-items: stretch; }
  .sf-results-list .sf-card-img { width: 110px; min-width: 110px; height: auto; aspect-ratio: auto; }
  .sf-results-list .sf-card-img img { height: 100%; object-fit: cover; }
  .sf-results-list .sf-card > :last-child { min-width: 0; flex: 1; padding: 12px; }
  .sf-results-list .sf-card h3 { font-size: 13px; }
  #sf-account-tabs { overflow: visible; display: block; padding-bottom: 12px; }
  #sf-account-tabs > div:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #sf-account-tabs .sf-tab-item { min-height: 44px; padding: 8px; font-size: 12px; white-space: normal; justify-content: flex-start; min-width: 0; }
  #sf-account-tabs > div:last-child:not(:first-child) { display: none; }
  .sf-account-details { border: 1px solid #dbe3ef; background: white; border-radius: 16px; }
  .sf-account-details > summary { display: list-item; cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 700; min-height: 48px; }
  .sf-account-details:not([open]) > :not(summary) { display: none; }
  .sf-create-hero { padding: 14px 16px !important; margin-bottom: 14px !important; }
  .sf-create-hero .sf-hero-badge, .sf-create-hero .sf-hero-pills, .sf-create-hero .sf-hero-desc { display: none !important; }
  .sf-create-hero .sf-hero-title { margin: 0 !important; font-size: 21px !important; }
  #sf-step-1 { padding: 18px; }
  #sf-step-1 .sf-type-card[data-type] { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 10px; padding: 14px 22px 14px 12px; }
  #sf-step-1 .sf-type-card[data-type] > div:not(.sf-radio-indicator) { grid-column: 1; grid-row: 1 / 3; width: 32px; height: 32px; margin: 0; border-radius: 10px; }
  #sf-step-1 .sf-type-card[data-type] h3, #sf-step-1 .sf-type-card[data-type] p { grid-column: 2; margin: 0; }
  #sf-step-1 .sf-type-card[data-type] > span { display: none; }
  #sf-agent-wizard h3 { scroll-margin-top: 90px; }
  .sf-ai-mobile-progress { display: block; font-size: 13px; font-weight: 700; color: #164ca0; }
  .sf-ai-actions .sf-ai-btn-primary { flex: 1; }
  .sf-share-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 16px 8px; }
  .sf-share-options button { min-height: 68px; }
  #modal-share > div { max-height: calc(100dvh - 32px); overflow-y: auto; }
  .sf-mobile-contact:not([hidden]) { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 35; gap: 12px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: white; border-top: 1px solid #dbe3ef; box-shadow: 0 -4px 16px #0f172a0d; }
  .sf-mobile-contact strong { flex: 1; min-width: 0; font-size: 18px; color: #0866ff; }
  .sf-mobile-contact button { min-height: 44px; border-radius: 12px; padding: 10px 20px; background: #0866ff; color: white; font-weight: 700; }
  body.sf-has-mobile-contact { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
