/* Dedicated responsive fixes for /smartphones?deal=... */
.phone-deal-detail-page {
  overflow-x: hidden;
}

.phone-deal-detail-page .phone-push-detail {
  width: min(680px, calc(100% - 32px));
  max-width: 680px;
  margin: 20px auto 80px;
}

.phone-deal-detail-page .phone-push-deal-surface.phone-primary-deal-section {
  width: 100%;
  max-width: 640px;
  margin-right: auto;
  margin-left: auto;
}

.phone-deal-detail-page .phone-push-deal-surface .phone-deal-card,
.phone-deal-detail-page .phone-push-deal-surface .phone-deal-card > *,
.phone-deal-detail-page .phone-push-deal-surface .phone-deal-card-header,
.phone-deal-detail-page .phone-push-deal-surface .phone-deal-actions {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 600px) {

  .phone-deal-detail-page .phone-push-detail {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 72px;
    padding: 10px 12px calc(88px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .phone-deal-detail-page .phone-push-detail-hero {
    min-width: 0;
    padding: 12px 2px;
  }

  .phone-deal-detail-page .phone-push-detail-hero h1 {
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .phone-deal-detail-page .phone-push-detail-nav,
  .phone-deal-detail-page .phone-push-detail-nav a {
    min-width: 0;
    max-width: 100%;
  }

  .phone-deal-detail-page .phone-push-deal-surface.phone-primary-deal-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location span {
    max-width: 42%;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-card-badges,
  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-condition,
  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-primary-price,
  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift,
  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-actions {
    width: 100%;
    max-width: 100%;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-condition,
  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-primary-price strong,
  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift strong,
  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift small {
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift > div,
  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift > p {
    min-width: 0;
    max-width: 100%;
    gap: 8px;
  }

  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift > p {
    align-items: flex-start;
  }

  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift > p strong {
    min-width: 0;
    flex: 1 1 auto;
  }

  .phone-deal-detail-page .phone-push-deal-surface .smartphone-cash-gift > p span {
    max-width: 42%;
    flex: 0 1 auto;
    text-align: right;
    white-space: normal;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-actions > * {
    min-width: 0;
    max-width: 100%;
  }

  .phone-deal-detail-page .phone-push-detail-note {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 360px) {

  .phone-deal-detail-page .phone-push-detail {
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* Keep the delivery method readable instead of clipping it on the condition-only page. */
@media (max-width: 600px) {
  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 3px 8px;
    align-items: center;
    min-height: 0;
    padding: 10px 12px;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location img {
    grid-row: 1 / 3;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location strong {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    max-width: none;
  }

  .phone-deal-detail-page .phone-push-deal-surface .phone-deal-location span {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin-left: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
  }
}
