/* Desktop-only companion for the mobile home redesign. */
@media (min-width: 760px) {
  .home-screen { gap: 20px; padding-bottom: 12px; }

  .home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 2px 0;
  }

  .home-section-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #10265b;
    font-size: 1.08rem;
  }

  .home-section-heading h2 svg { width: 21px; color: #1f72f5; }

  .home-section-heading button {
    border: 0;
    color: #1e71ee;
    background: transparent;
    font: inherit;
    font-size: .76rem;
    font-weight: 850;
  }

  .home-quick-heading { margin-top: 2px; }
  .home-quick-label { display: none !important; }

  .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  /* Keep desktop in the same RTL sequence as mobile. */
  #moreFeaturesCard { order: 1; }
  #foodOrderCard { order: 2; }
  #searchCard { order: 3; }
  #hamnegarCard { order: 4; }
  #eventsCard, #marketCard { display: none !important; }

  .feature-card,
  .feature-ai {
    height: 222px !important;
    min-height: 222px !important;
    padding: 18px !important;
    gap: 8px !important;
    border-radius: 22px !important;
  }

  .feature-card img,
  .feature-ai img {
    width: 62px !important;
    height: 62px !important;
    object-fit: contain;
  }

  .feature-card strong,
  .feature-ai strong { font-size: .96rem !important; }

  .feature-card small,
  .feature-ai small {
    font-size: .72rem !important;
    line-height: 1.8 !important;
    -webkit-line-clamp: 3 !important;
  }

  .home-today {
    min-width: 0;
    padding: 20px 22px 7px;
    border: 1px solid #e6edf8;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 13px 32px rgba(39, 77, 136, .08);
  }

  .home-today__list { margin-top: 10px; }

  .home-today__item {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid #eaf0f8;
    color: #13265a;
    background: transparent;
    text-align: right;
    font: inherit;
  }

  .home-today__item:last-child { border-bottom: 0; }
  .home-today__item--post { grid-template-columns: auto 52px minmax(0, 1fr) 18px; }
  .home-today__image { width: 52px; height: 52px; overflow: hidden; border-radius: 14px; background: #edf4ff; }
  .home-today__image img { width: 100%; height: 100%; object-fit: cover; }
  .home-today__item svg { width: 18px; color: #89a0c8; }
  .home-today__copy { min-width: 0; }
  .home-today__copy b,.home-today__copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .home-today__copy b { font-size: .82rem; }
  .home-today__copy small { margin-top: 4px; color: #71809a; font-size: .68rem; }
  .home-today__type { padding: 6px 9px; border-radius: 99px; color: #8260d7; background: #f3edff; font-size: .62rem; font-weight: 850; }
  .home-today__type.is-event { color: #216be8; background: #eaf2ff; }
  .home-empty { margin: 17px 0 12px; color: #7c89a0; font-size: .76rem; line-height: 1.8; }

  .home-suggestions { min-width: 0; }
  .home-suggestions__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 11px; }

  .home-suggestion {
    min-width: 0;
    min-height: 142px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #edf1f7;
    border-radius: 22px;
    padding: 15px 12px;
    color: #14275b;
    background: #fff;
    box-shadow: 0 10px 26px rgba(35, 75, 139, .07);
    font: inherit;
    text-align: center;
  }

  .home-suggestion b { overflow: hidden; max-width: 100%; font-size: .78rem; white-space: nowrap; text-overflow: ellipsis; }
  .home-suggestion small { color: #70809e; font-size: .66rem; line-height: 1.7; }
  .home-suggestion--study > svg { width: 40px; height: 40px; padding: 9px; border-radius: 14px; color: #2875f4; background: #e8f1ff; }
  .home-suggestion__avatars { height: 43px; display: flex; direction: ltr; }
  .home-suggestion__avatars span { width: 42px; height: 42px; margin-left: -8px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #91b7ff, #2b6ce8); background-size: cover; background-position: center; font-size: .7rem; font-weight: 900; }
  .home-suggestion__avatars span.has-image { color: transparent; }
}

@media (min-width: 900px) {
  .home-screen {
    grid-template-columns: minmax(0, 1.45fr) minmax(285px, .9fr);
    grid-template-areas:
      "hero hero"
      "quick quick"
      "features today"
      "features suggestions"
      "trust trust";
    column-gap: 20px;
    row-gap: 20px;
    align-items: start;
  }

  .home-event-banner { grid-area: hero; }
  .home-quick-heading { grid-area: quick; }
  .feature-grid { grid-area: features; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .home-today { grid-area: today; }
  .home-suggestions { grid-area: suggestions; }
  .trust-card { grid-area: trust; }

  .feature-card,
  .feature-ai {
    height: 224px !important;
    min-height: 224px !important;
    padding: 17px !important;
  }

  .home-today { padding: 18px 18px 5px; }
  .home-today__item { gap: 8px; padding: 11px 0; }
  .home-today__item--post { grid-template-columns: auto 43px minmax(0, 1fr) 16px; }
  .home-today__image { width: 43px; height: 43px; border-radius: 12px; }
  .home-today__copy b { font-size: .74rem; }
  .home-today__copy small { font-size: .62rem; }
  .home-today__type { padding: 5px 7px; font-size: .57rem; }
  .home-suggestions__grid { gap: 10px; }
  .home-suggestion { min-height: 132px; padding: 12px 8px; }
}

/* Desktop quick access: use each card's own illustration instead of the
   shared legacy sprite. This keeps the content distinct and prevents long
   labels from colliding with the illustration or action button. */
@media (min-width: 900px) {
  #features .feature-card,
  #features .feature-ai {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 9px !important;
    height: 238px !important;
    min-height: 238px !important;
    padding: 20px 18px 54px !important;
    overflow: hidden;
    text-align: center;
  }

  #features .feature-card::before,
  #features .feature-ai::before { display: none !important; }

  #features .feature-card > img,
  #features .feature-ai > img {
    display: block !important;
    width: 82px !important;
    height: 72px !important;
    flex: 0 0 auto;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain;
  }

  #features .feature-card strong,
  #features .feature-ai strong {
    display: block !important;
    min-height: 25px !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: #102862;
    font-size: 1rem !important;
    line-height: 1.55 !important;
    -webkit-line-clamp: 1 !important;
  }

  #features .feature-card strong span { display: inline !important; }

  #features .feature-card small,
  #features .feature-ai small {
    display: -webkit-box !important;
    min-height: 42px;
    margin: 0 !important;
    overflow: hidden !important;
    color: #657796;
    font-size: .72rem !important;
    line-height: 1.8 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2 !important;
  }

  #features .feature-card .arrow,
  #features .feature-ai .ai-arrow {
    right: 17px !important;
    bottom: 15px !important;
  }

  #features .feature-ai::after {
    top: 13px;
    left: 13px;
    min-height: 25px;
    padding-inline: 8px;
    font-size: .58rem;
  }

  #features .feature-ai .ai-badge { display: none; }
}

@media (min-width: 760px) and (max-width: 899px) {
  .home-today { padding-inline: 20px; }
  .feature-card,
  .feature-ai { height: 212px !important; min-height: 212px !important; }
}

/* Desktop dashboard layout. Kept in this desktop-only file so the compact
   mobile home remains exactly as it is. */
@media (min-width: 900px) {
  body {
    padding: 52px 0;
    background:
      radial-gradient(circle at 97% 9%, rgba(80, 143, 255, .14) 0 7rem, transparent 7.1rem),
      radial-gradient(circle at 1% 47%, rgba(80, 143, 255, .1) 0 4rem, transparent 4.1rem),
      radial-gradient(circle at 9% 94%, rgba(117, 159, 255, .12) 0 10rem, transparent 10.1rem),
      linear-gradient(145deg, #f5f9ff, #edf5ff 58%, #f7faff);
  }

  .phone-shell {
    width: min(1320px, calc(100% - 56px));
    min-height: calc(100vh - 104px);
    padding: 14px 42px 30px 244px;
    border-color: rgba(220, 231, 247, .9);
    border-radius: 28px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 28px 72px rgba(36, 74, 137, .15);
  }

  .app-header {
    min-height: 54px;
    padding: 0 0 16px;
  }

  .brand { font-size: 1.22rem; }
  .logo-mark { width: 43px; height: 43px; }
  .upgrade-button {
    min-height: 38px;
    padding-inline: 14px;
    font-size: .72rem;
  }

  .bottom-nav {
    top: 54px;
    right: auto;
    bottom: 28px;
    left: 14px;
    width: 188px;
    padding: 12px 10px;
    gap: 5px;
    border: 1px solid #e5edf8;
    border-radius: 20px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 12px 28px rgba(45, 84, 142, .06);
  }

  .bottom-nav a {
    min-height: 48px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 0 11px;
    color: #38527f;
    font-size: .73rem;
  }

  .bottom-nav a > svg { width: 19px; height: 19px; }
  .bottom-nav a.active { color: #1769ed; background: linear-gradient(135deg, #edf5ff, #e4efff); }
  .bottom-nav a.active::after { right: auto; left: -10px; }
  .bottom-nav .nav-profile-greeting { margin-bottom: 8px; }

  .home-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr);
    grid-template-areas:
      "hero hero"
      "features features"
      "today suggestions"
      "trust trust";
    gap: 20px;
    align-items: stretch;
  }

  .home-event-banner {
    grid-area: hero;
    min-height: 232px;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
    gap: 22px;
    padding: 24px 40px 0;
    border-color: #cfe1fb;
    border-radius: 23px;
    background:
      radial-gradient(circle at 6% 8%, rgba(94, 159, 255, .24) 0 4rem, transparent 4.1rem),
      radial-gradient(circle at 94% 100%, rgba(91, 153, 255, .2) 0 5rem, transparent 5.1rem),
      linear-gradient(120deg, #e6f1ff, #fbfdff 64%, #ecf5ff);
  }

  .hero-copy { justify-content: center; padding-bottom: 23px; }
  .hero-copy h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 2.55vw, 2.3rem); line-height: 1.55; }
  .hero-copy p { max-width: 610px; margin: 0; color: #496895; font-size: .87rem; line-height: 2; }
  .hero-copy .primary-button { min-height: 42px; margin-top: 15px; font-size: .76rem; }
  .hero-visual img { width: min(112%, 365px); transform: translateY(5px); }

  .home-quick-heading { display: none; }
  .feature-grid {
    grid-area: features;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }

  .feature-grid::before {
    content: "دسترسی سریع  ⚡";
    order: 2;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    min-height: 28px;
    color: #173b7d;
    font-size: .9rem;
    font-weight: 900;
  }

  #features .feature-card {
    height: 164px !important;
    min-height: 164px !important;
    display: grid !important;
    grid-template-rows: 64px auto minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    gap: 5px !important;
    padding: 16px 16px 42px !important;
    border-color: #e3edf9;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 12px 28px rgba(43, 87, 150, .07);
    text-align: center;
  }

  #features .feature-card > img {
    width: 64px !important;
    height: 64px !important;
  }

  #features .feature-card strong {
    min-height: 0 !important;
    color: #122f66;
    font-size: .84rem !important;
    line-height: 1.5 !important;
  }

  #features .feature-card small {
    min-height: 0;
    color: #7184a6;
    font-size: .65rem !important;
    line-height: 1.8 !important;
  }

  #features .feature-card .arrow {
    right: auto !important;
    left: 14px !important;
    bottom: 13px !important;
    width: 31px;
    height: 31px;
    box-shadow: none;
  }

  /* The first row mirrors the larger action cards in the approved desktop reference. */
  #eventsCard,
  #marketCard,
  #hamnegarCard {
    order: 1;
    min-height: 130px !important;
    height: 130px !important;
    grid-template-columns: 64px minmax(0, 1fr) 31px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    justify-items: stretch !important;
    column-gap: 13px !important;
    padding: 16px !important;
    text-align: right !important;
  }

  #eventsCard { display: grid !important; }
  #marketCard { display: grid !important; }
  #eventsCard > img,
  #marketCard > img,
  #hamnegarCard > img { grid-column: 1; grid-row: 1 / 3; }
  #eventsCard strong,
  #marketCard strong,
  #hamnegarCard strong { grid-column: 2; grid-row: 1; align-self: end; text-align: right; }
  #eventsCard small,
  #marketCard small,
  #hamnegarCard small { grid-column: 2; grid-row: 2; align-self: start; text-align: right; }
  #eventsCard .arrow,
  #marketCard .arrow,
  #hamnegarCard .arrow { position: static !important; grid-column: 3; grid-row: 1 / 3; align-self: center; justify-self: end; }

  #moreFeaturesCard,
  #searchCard,
  #foodOrderCard { order: 3; }

  .home-today {
    grid-area: today;
    min-height: 255px;
    padding: 19px 21px 9px;
    border-color: #e3edf9;
    border-radius: 19px;
    box-shadow: 0 12px 28px rgba(43, 87, 150, .06);
  }

  .home-suggestions { grid-area: suggestions; }
  .home-suggestions__grid { height: calc(100% - 38px); grid-template-columns: 1fr; gap: 11px; }
  .home-suggestion {
    min-height: 118px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: start;
    column-gap: 12px;
    padding: 15px;
    border-color: #e3edf9;
    border-radius: 18px;
    text-align: right;
  }

  .home-suggestion__avatars,
  .home-suggestion--study > svg { grid-row: 1 / 3; grid-column: 1; }
  .home-suggestion b { grid-column: 2; font-size: .77rem; }
  .home-suggestion small { grid-column: 2; font-size: .65rem; }
  .home-suggestion__avatars span { width: 38px; height: 38px; }

  .trust-card {
    grid-area: trust;
    min-height: 64px;
    padding: 11px 18px;
    border-color: #dce9fb;
    border-radius: 17px;
    box-shadow: none;
    background: linear-gradient(135deg, #fafdff, #eef6ff);
  }

  .trust-card strong { margin-bottom: 2px; color: #25477f; font-size: .76rem; }
  .trust-card p { font-size: .64rem; }
  .shield-icon, .lock-icon { width: 38px; height: 38px; font-size: 1rem; }
}

@media (min-width: 900px) and (max-width: 1080px) {
  .phone-shell { padding-right: 28px; padding-left: 208px; }
  .bottom-nav { width: 164px; }
  .home-screen { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "features" "today" "suggestions" "trust"; }
  .home-suggestions__grid { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
