/* Partner portal mobile/tablet responsiveness fixes — loaded AFTER partner-portal.css.
   Keeping these as a separate, readable file (partner-portal.css is minified/fragile). */

/* BUG FIX: the product name/description wrapper had no flex-grow, so it stayed as
   narrow as its own text and left a large dead gap inside the card (all breakpoints). */
.partner-product-info { flex: 1 1 auto; min-width: 0; }
.partner-product-head h2 { overflow-wrap: anywhere; }

/* Let product/admin grids reflow by available width instead of a hard 2-up split that
   only ever drops to 1 column below 720px — this keeps tablets from feeling cramped
   and avoids a lone card stretching oddly next to an empty column. */
.partner-product-grid,
.partner-admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.partner-admin-product {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Keep the desktop header predictable when all account actions are available. */
@media (min-width: 1025px) {
  .partner-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .partner-brand-block {
    flex: 1 1 280px;
    min-width: 260px;
  }
  .partner-header-actions {
    display: flex;
    flex: 1 1 620px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    gap: 8px;
  }
  .partner-header-actions form {
    display: flex;
    margin: 0;
  }
  .partner-header-actions > * {
    min-width: 0;
    flex: 0 1 auto;
    justify-content: center;
    text-align: center;
    line-height: 1.45;
  }
  .partner-header-actions .partner-balance {
    padding-inline: 8px;
  }
}

.partner-balance {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #f3f8ef;
  font-size: .82rem;
  white-space: nowrap;
}

.partner-tabs .partner-tab > .partner-tab-image {
  display: block;
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
  flex: 0 0 30px;
  object-fit: cover;
  border-radius: 5px;
}

@media (max-width: 560px) {
  .partner-tabs .partner-tab > .partner-tab-image {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    flex-basis: 24px;
  }
}

.partner-statement-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #d4bc72;
  border-radius: 8px;
  background: #fff5cb;
  color: #473a13;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.partner-statement-link:hover,
.partner-statement-link:focus { background: #ffe9a0; color: #332907; }

/* Header actions: keep them tidy on phones instead of one lone button stranded with
   a big empty gap next to it when the row wraps. */
@media (max-width: 560px) {
  .partner-header-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .partner-header-actions > a {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
  .partner-header-actions .partner-balance { flex: 1 1 100%; justify-content: center; }
  .partner-header-actions form {
    flex: 1 1 100%;
  }
  .partner-header-actions .partner-logout {
    width: 100%;
    justify-content: center;
  }
}

/* Tablet portrait: a touch more breathing room than the phone breakpoint gives. */
@media (min-width: 561px) and (max-width: 1024px) {
  .partner-catalog { padding: 0 28px; }
  .partner-header { padding: 24px 28px; }
  .partner-invoice { padding: 14px 28px; }
}

/* Orders list cards: avoid an overly wide single column on tablets. */
@media (min-width: 561px) {
  .partner-orders-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}

/* Small phones: tighten card/section padding so more content fits without feeling cramped. */
@media (max-width: 420px) {
  .partner-product-head { padding: 12px; gap: 10px; }
  .partner-units { padding: 4px 12px; }
  .partner-order-note { padding: 12px; }
}
