/*
 * EasyService mobile app layer
 * UI direction: native-app feeling, orange brand, compact cards, thumb-friendly flows.
 */

.es-mobile-top-search {
  display: none;
}

@media (max-width: 767.98px) {
  :root {
    --esm-orange: #ff6a00;
    --esm-orange-2: #ff7f1f;
    --esm-ink: #10172f;
    --esm-muted: #6d7488;
    --esm-line: #e8ebf2;
    --esm-soft: #fff3e9;
    --esm-shadow: 0 18px 45px rgba(16, 23, 47, .10);
    --esm-radius: 24px;
  }

  html,
  body.es-app-body {
    max-width: 100%;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 18% 10%, rgba(255, 106, 0, .075), transparent 26rem),
      linear-gradient(180deg, #fff 0%, #fbfcff 58%, #fff 100%);
  }

  body.es-app-body {
    color: var(--esm-ink);
    padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
  }

  body.es-app-body #ecm-main-content {
    overflow: clip;
  }

  /* App header */
  .es-shell-header {
    height: 102px;
    border-bottom: 0;
    background: rgba(255, 255, 255, .92);
    box-shadow: none;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  .es-shell-header__inner {
    height: 100%;
    padding: max(12px, env(safe-area-inset-top)) 18px 10px;
    align-items: center;
  }

  .es-shell-toggle,
  .es-shell-icon,
  .es-shell-profile,
  .es-shell-login,
  .es-shell-cta {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  }

  .es-shell-brand {
    top: 50%;
    width: min(56vw, 260px);
    justify-content: center;
  }

  .es-shell-brand b {
    font-size: 1.52rem;
    letter-spacing: -.06em;
    text-align: center;
  }

  .es-shell-brand small {
    color: #1f2937;
    font-size: .78rem;
    line-height: 1.15;
  }

  .es-shell-actions {
    margin-left: 0;
  }

  .es-shell-profile img {
    width: 39px;
    height: 39px;
    border: 2px solid #fff;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .12);
  }

  .es-drawer {
    width: min(420px, 94vw);
    border-radius: 0 30px 30px 0;
  }

  .es-drawer__head {
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  .es-drawer-nav a {
    min-height: 54px;
    border: 1px solid rgba(15, 23, 42, .045);
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
  }

  /* Bottom dock */
  .es-mobile-dock {
    height: 94px;
    padding: 9px 12px calc(8px + env(safe-area-inset-bottom));
    align-items: end;
    border-radius: 26px 26px 0 0;
    border-top-color: rgba(15, 23, 42, .075);
    box-shadow: 0 -18px 48px rgba(15, 23, 42, .12);
  }

  .es-mobile-dock a {
    gap: 6px;
    color: #767c8f;
    font-size: .72rem;
    font-weight: 700;
  }

  .es-mobile-dock i {
    font-size: 1.34rem;
  }

  .es-mobile-dock a.is-active {
    color: var(--esm-orange);
  }

  .es-mobile-dock__provider { color: #273b89 !important; }
  .es-mobile-dock__provider i { display: grid; place-items: center; width: 30px; height: 30px; margin-top: -5px; border-radius: 9px; background: #e9edff; color: #273b89; font-size: .95rem; }
  .es-mobile-dock__provider span { max-width: 72px; line-height: 1.05; text-align: center; white-space: normal; }
  .es-mobile-dock__provider.is-active i { background: #273b89; color: #fff; }

  .es-mobile-dock__main i {
    width: 64px;
    height: 64px;
    margin-top: -34px;
    border: 7px solid #fff;
    background: linear-gradient(135deg, var(--esm-orange), var(--esm-orange-2));
    box-shadow: 0 13px 30px rgba(255, 106, 0, .34);
  }

  .es-mobile-dock__main span {
    margin-top: -3px;
  }

  /* Marketplace home */
  .es-market {
    background: transparent;
  }

  .es-mobile-top-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 8px;
    width: min(calc(100vw - 32px), 358px);
    margin: 10px auto 16px;
    padding: 7px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 23px;
    background: #fff;
    box-shadow: var(--esm-shadow);
  }

  .es-mobile-top-search__field {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 55px;
    padding: 0 14px;
  }

  .es-mobile-top-search__field i {
    color: #6b7280;
    font-size: 1.24rem;
  }

  .es-mobile-top-search__field input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--esm-ink);
    font: inherit;
    font-size: 1rem;
  }

  .es-mobile-top-search button {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--esm-orange), #ff8a32);
    color: #fff;
    font-size: 1.22rem;
  }

  .es-market-container {
    width: calc(100% - 40px);
  }

  .es-market-hero {
    padding: 10px 0 28px;
    overflow: visible;
    background: transparent;
    border-bottom: 0;
  }

  .es-market-hero__grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .es-market-hero__visual {
    order: 2;
    min-height: 0;
    height: 292px;
    margin-top: 0;
    border-radius: 25px;
    background: linear-gradient(135deg, #fff2e8, #f4eef5);
    box-shadow: var(--esm-shadow);
  }

  .es-market-visual-shape {
    right: -4%;
    bottom: 0;
    width: 74%;
    height: 100%;
    border-radius: 45% 38% 24px 24px;
    background: linear-gradient(145deg, rgba(255, 106, 0, .16), rgba(255, 255, 255, .35));
  }

  .es-market-hero__visual > img {
    right: -5%;
    bottom: 0;
    width: 68%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 10%;
    border-radius: 0 0 25px 0;
    filter: drop-shadow(0 18px 25px rgba(16, 23, 47, .12));
  }

  .es-market-hero__copy {
    display: flex;
    flex-direction: column;
  }

  .es-market-eyebrow {
    order: 3;
    width: max-content;
    max-width: 80%;
    margin-top: -76px;
    margin-left: 18px;
    z-index: 3;
    padding: 8px 14px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--esm-orange), #ff8b38);
    box-shadow: 0 10px 24px rgba(255, 106, 0, .24);
  }

  .es-market-hero h1 {
    order: 4;
    margin: 18px 0 8px;
    font-size: clamp(2.15rem, 9.4vw, 3.05rem);
    line-height: 1.08;
    letter-spacing: -.055em;
  }

  .es-market-hero__copy > p {
    order: 5;
    color: var(--esm-muted);
    font-size: .98rem;
    line-height: 1.65;
    max-height: 3.4em;
    overflow: hidden;
  }

  .es-market-search {
    order: 1;
    display: none !important;
    grid-template-columns: 1fr 55px;
    gap: 0;
    margin: 6px 0 18px;
    padding: 7px;
    min-height: 74px;
    border: 0;
    border-radius: 23px;
    box-shadow: var(--esm-shadow);
  }

  .es-market-search label {
    height: 59px;
    padding: 0 14px;
  }

  .es-market-search label:first-child i {
    font-size: 1.3rem;
    color: #6b7280;
  }

  .es-market-search input {
    font-size: 1rem;
  }

  .es-market-search__city {
    display: none !important;
  }

  .es-market-search button {
    grid-column: 2;
    grid-row: 1;
    width: 55px;
    height: 55px;
    padding: 0;
    border-radius: 18px;
    font-size: 0;
    background: linear-gradient(135deg, var(--esm-orange), #ff8a32);
  }

  .es-market-search button::before {
    content: "\f1de";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.25rem;
  }

  .es-market-search button i {
    display: none;
  }

  .es-market-popular,
  .es-market-mini-stats {
    display: none;
  }

  .es-market-section {
    padding: 25px 0;
  }

  .es-market-heading {
    align-items: center;
    margin-bottom: 16px;
  }

  .es-market-heading span,
  .es-market-heading p {
    display: none;
  }

  .es-market-heading h2 {
    margin: 0;
    font-size: 1.32rem;
    letter-spacing: -.035em;
  }

  .es-market-heading > a {
    color: var(--esm-orange);
    font-size: .92rem;
    font-weight: 900;
  }

  .es-market-categories {
    gap: 12px;
    margin-right: -20px;
    padding: 4px 20px 12px 0;
  }

  .es-market-categories > a {
    flex-basis: 142px;
    min-height: 136px;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(16, 23, 47, .075);
  }

  .es-market-categories span {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 1.38rem;
  }

  .es-market-categories small {
    display: none;
  }

  .es-market-section--soft {
    background: transparent;
  }

  .es-market-filters {
    position: sticky;
    top: 102px;
    z-index: 30;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -20px 18px;
    padding: 10px 20px 12px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
    scrollbar-width: none;
  }

  .es-market-filters::-webkit-scrollbar {
    display: none;
  }

  .es-market-filters label,
  .es-market-filters select,
  .es-market-filters button,
  .es-market-reset {
    flex: 0 0 auto;
    height: 42px;
    border-radius: 999px;
    font-size: .78rem;
  }

  .es-market-filters label:first-child {
    flex-basis: 210px;
  }

  .es-market-filters__price {
    flex-basis: 118px;
  }

  .es-market-pros {
    gap: 14px;
    margin-right: -20px;
    padding: 4px 20px 18px 0;
  }

  .es-market-pro {
    flex-basis: 66%;
    min-width: 212px;
    max-width: 260px;
    border: 0;
    border-radius: 19px;
    box-shadow: 0 16px 36px rgba(16, 23, 47, .09);
  }

  .es-market-pro__photo {
    height: 144px;
  }

  .es-market-pro__photo > span {
    left: auto;
    right: 9px;
    top: 9px;
    color: #0f9f52;
    background: #dcfce7;
  }

  .es-market-pro__body {
    padding: 12px 13px 14px;
  }

  .es-market-pro h3 {
    font-size: 1rem;
  }

  .es-market-pro__rating {
    margin-top: -25px;
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 23, 47, .08);
  }

  .es-market-pro__foot {
    display: block;
    margin-top: 10px;
  }

  .es-market-pro__foot a {
    display: none;
  }

  .es-market-provider {
    margin: 18px 20px;
    padding: 24px;
    border-radius: 25px;
    background: linear-gradient(135deg, #11182f, #25203b);
  }

  .es-market-provider h2 {
    font-size: 1.45rem;
  }

  .es-market-project {
    margin: 20px 0 0;
    padding: 30px 0;
    background: linear-gradient(180deg, #fff8f2, #fff);
  }

  .es-market-project h2 {
    font-size: 1.55rem;
  }

  .es-market-project__form {
    padding: 18px;
    border: 0;
    border-radius: 22px;
    box-shadow: var(--esm-shadow);
  }

  .es-market-project input,
  .es-market-project select,
  .es-market-project textarea {
    min-height: 54px;
    border-radius: 15px;
    font-size: .95rem;
  }

  .es-market-project__form button[type=submit] {
    min-height: 56px;
    border-radius: 16px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--esm-orange), #ff8a2c);
  }

  /* Public provider profile */
  .esv-page,
  .esv-show-pro {
    background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  }

  .esv-show-hero {
    margin: 0 20px 18px;
    padding: 24px 0 26px;
    border-radius: 28px;
    background:
      radial-gradient(circle at 82% 20%, rgba(255, 255, 255, .22), transparent 9rem),
      linear-gradient(135deg, #11182f 0%, #22254a 58%, #ff6a00 160%);
  }

  .esv-show-hero-inner {
    width: calc(100% - 34px);
  }

  .esv-show-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
  }

  .esv-show-hero h1 {
    font-size: 1.85rem;
    letter-spacing: -.04em;
  }

  .esv-show-pro .container {
    width: calc(100% - 32px);
    padding-left: 0;
    padding-right: 0;
  }

  .esv-show-pro-main {
    display: block;
  }

  .esv-show-about-card,
  .esv-show-offer-card,
  .esv-employer-panel > div,
  .esv-contact-panel {
    border: 0 !important;
    border-radius: 22px !important;
    box-shadow: 0 14px 36px rgba(16, 23, 47, .075) !important;
  }

  .esv-show-offer-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin-right: -16px;
    padding-right: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .esv-show-offer-grid::-webkit-scrollbar {
    display: none;
  }

  .esv-show-offer-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  .esv-employer-panel {
    position: static !important;
    margin-top: 24px;
  }

  .esv-employer-panel form .btn,
  .esv-show-pro button[type=submit],
  .esv-show-pro .btn-primary {
    min-height: 52px;
    border-radius: 16px !important;
    font-weight: 900;
    background: linear-gradient(135deg, var(--esm-orange), #ff8a2c) !important;
    border-color: transparent !important;
  }

  /* Provider dashboard / onboarding form */
  .esv-dash-pro {
    margin: 0;
    padding: 0 0 calc(112px + env(safe-area-inset-bottom));
    background: transparent;
  }

  .esv-dash-top {
    position: relative;
    top: auto;
    margin: 0 0 18px;
    padding: 18px 20px;
    border: 0;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(135deg, #fff7ef, #fff);
    box-shadow: 0 14px 34px rgba(16, 23, 47, .07);
  }

  .esv-dash-brand-k {
    color: var(--esm-orange);
  }

  .esv-dash-brand-t {
    font-size: 1.55rem;
    letter-spacing: -.055em;
  }

  .esv-dash-top-actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .esv-dash-top-actions::-webkit-scrollbar {
    display: none;
  }

  .esv-dash-top-actions .btn,
  .esv-dash-chip {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px !important;
  }

  .esv-dash-int-wrap {
    padding-inline: 20px;
  }

  .esv-dash-progress-wrap {
    position: sticky;
    top: 102px;
    z-index: 20;
    margin: 0 -20px 14px;
    padding: 10px 20px 14px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px);
  }

  .esv-dash-progress-bar {
    height: 8px;
  }

  .esv-dash-progress-fill {
    background: linear-gradient(90deg, var(--esm-orange), #ff9d43) !important;
  }

  .esv-dash-jump {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -20px 16px;
    padding: 0 20px 10px;
    scrollbar-width: none;
  }

  .esv-dash-jump::-webkit-scrollbar {
    display: none;
  }

  .esv-dash-jump a {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    background: #fff;
    color: var(--esm-ink);
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 8px 18px rgba(16, 23, 47, .05);
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
  }

  .esv-dash-card,
  .esv-dash-soft-panel,
  .esv-dash-preview-card {
    border: 0 !important;
    border-radius: 24px !important;
    box-shadow: 0 16px 38px rgba(16, 23, 47, .075) !important;
  }

  .esv-dash-card {
    overflow: hidden;
    margin-bottom: 18px !important;
  }

  .esv-dash-card-h {
    padding: 20px 20px 12px !important;
    background: linear-gradient(135deg, #fff, #fff7ef);
  }

  .esv-dash-card-b {
    padding: 18px 18px 20px !important;
  }

  .esv-dash-card-t {
    font-size: 1.25rem !important;
    letter-spacing: -.035em;
  }

  .esv-dash-profile-grid,
  .esv-dash-live-grid,
  .esv-dash-stat-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .esv-dash-profile-grid .span-2,
  .esv-dash-profile-grid .span-3 {
    grid-column: auto !important;
  }

  .esv-dash-label,
  .form-label {
    color: var(--esm-ink);
    font-size: .9rem;
    font-weight: 900 !important;
  }

  .esv-dash-input,
  .esv-dash-textarea,
  .esv-dash-pro .form-control,
  .esv-dash-pro .form-select,
  .esv-domain-search-input {
    min-height: 56px;
    border: 1px solid #dfe3eb !important;
    border-radius: 16px !important;
    background: #fff !important;
    font-size: .96rem;
    box-shadow: none !important;
  }

  .esv-dash-textarea,
  .esv-dash-pro textarea.form-control {
    min-height: 118px;
  }

  .esv-dash-pro .form-control:focus,
  .esv-dash-pro .form-select:focus,
  .esv-domain-search-input:focus {
    border-color: var(--esm-orange) !important;
    box-shadow: 0 0 0 4px rgba(255, 106, 0, .12) !important;
  }

  .esv-domain-chips,
  .esv-dash-cat-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .esv-dash-pro .btn-primary,
  .esv-dash-pro button[type=submit],
  .esv-dash-pro .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--esm-orange), #ff8a2c) !important;
    border-color: transparent !important;
  }

  .esv-dash-pro .btn-primary,
  .esv-dash-pro button[type=submit] {
    min-height: 54px;
    border-radius: 16px !important;
    font-weight: 900;
  }

  .esv-dash-pro .btn-outline-primary {
    color: #d75400 !important;
    border-color: #ffc99f !important;
  }

  /* Operations pages: bookings, leads, messages, reviews, favorites */
  .esv-ops {
    min-height: 100vh;
    padding-bottom: calc(106px + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 16% 0%, rgba(255, 106, 0, .09), transparent 22rem),
      linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  }

  .esv-ops .container {
    width: calc(100% - 34px);
    padding-left: 0;
    padding-right: 0;
  }

  .esv-ops-nav {
    position: sticky;
    top: 102px;
    z-index: 22;
    margin: 0 -17px 18px;
    padding: 10px 17px;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, .92);
    box-shadow: none;
    backdrop-filter: blur(16px);
  }

  .esv-ops-nav a {
    padding: 10px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    box-shadow: 0 8px 18px rgba(16, 23, 47, .05);
  }

  .esv-ops-nav a.is-active {
    background: #fff0e5;
    color: #d75400;
  }

  .esv-ops h1 {
    font-size: 1.75rem;
    letter-spacing: -.045em;
  }

  .esv-ops .card,
  .esv-ops .list-group,
  .esv-ops .list-group-item {
    border: 0 !important;
    border-radius: 22px !important;
    box-shadow: 0 16px 38px rgba(16, 23, 47, .075) !important;
  }

  .esv-ops .list-group {
    display: grid;
    gap: 12px;
    background: transparent;
    box-shadow: none !important;
  }

  .esv-ops .list-group-item {
    overflow: hidden;
  }

  .esv-ops .btn,
  .esv-ops button {
    min-height: 42px;
    border-radius: 999px !important;
    font-weight: 800;
  }

  .esv-ops .btn-primary {
    background: linear-gradient(135deg, var(--esm-orange), #ff8a2c) !important;
    border-color: transparent !important;
  }

  .esv-ops textarea.form-control,
  .esv-ops input.form-control,
  .esv-ops select.form-select {
    border-radius: 16px !important;
  }
}

@media (max-width: 430px) {
  .es-market-container,
  .esv-show-pro .container,
  .esv-ops .container {
    width: calc(100% - 28px);
  }

  .es-market-hero__visual {
    height: 274px;
  }

  .es-market-pro {
    flex-basis: 70%;
  }

  .es-mobile-dock a {
    font-size: .66rem;
  }
}

/* Loaded before some page-level assets: keep these overrides last and intentionally stronger. */
@media (max-width: 767.98px) {
  body.es-app-body .es-market .es-market-hero__grid {
    display: flex !important;
    flex-direction: column !important;
  }

  body.es-app-body .es-market .es-market-hero__copy {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  body.es-app-body .es-market .es-market-search {
    order: 1 !important;
    display: none !important;
    grid-template-columns: 1fr 55px !important;
    margin: 6px 0 18px !important;
  }

  body.es-app-body .es-market .es-market-hero__visual {
    order: 2 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 292px !important;
  }

  body.es-app-body .es-market .es-market-eyebrow {
    order: 3 !important;
  }

  body.es-app-body .es-market .es-market-hero h1 {
    order: 4 !important;
  }

  body.es-app-body .es-market .es-market-hero__copy > p {
    order: 5 !important;
  }

  body.es-app-body .es-market .es-market-popular,
  body.es-app-body .es-market .es-market-mini-stats {
    display: none !important;
  }

  body.es-app-body .es-market .es-market-search__city {
    display: none !important;
  }

  body.es-app-body .es-market .es-market-search button {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 55px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  body.es-app-body .es-market .es-market-categories {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
  }

  body.es-app-body .es-market .es-market-categories > a {
    flex: 0 0 142px !important;
  }

  body.es-app-body .es-market .es-market-categories small {
    display: none !important;
  }

  body.es-app-body .es-market .es-market-pros {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
  }

  body.es-app-body .es-market .es-market-pro {
    flex: 0 0 66% !important;
  }

  body.es-app-body .es-market .es-market-filters {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
  }
}
