/* =============================================================
   InfoHub Store — customer panel and access screens
   Depends on base.css.
   ============================================================= */

/* ---- Customer panel (logged in) ------------------------------ */

.ih-account {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Sidebar — mirrors the admin panel sidebar. */
.ih-account__sidebar {
  position: sticky;
  top: calc(var(--ih-header-height) + 24px);
  padding: 12px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: var(--ih-radius-lg);
  background-color: hsl(var(--ih-card));
}

.admin-bar .ih-account__sidebar { top: calc(var(--ih-header-height) + 56px); }

.ih-account-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid hsl(var(--ih-border));
}

.ih-account-user__details { min-width: 0; }

.ih-account-user__name,
.ih-account-user__email {
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-account-user__name { font-weight: 600; }
.ih-account-user__email { color: hsl(var(--ih-muted-foreground)); font-size: 12px; }

.ih-store .woocommerce-MyAccount-navigation ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ih-store .woocommerce-MyAccount-navigation a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--ih-radius);
  color: hsl(240 5% 34%);
  text-decoration: none;
}

.ih-store .woocommerce-MyAccount-navigation a:hover,
.ih-store .woocommerce-MyAccount-navigation .is-active a {
  background-color: hsl(var(--ih-accent));
  color: hsl(var(--ih-accent-foreground));
}

.ih-store .woocommerce-MyAccount-navigation .is-active a { font-weight: 500; }

.ih-store .woocommerce-MyAccount-navigation-link--customer-logout {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid hsl(var(--ih-border));
}

.ih-store .woocommerce-MyAccount-navigation-link--customer-logout a { color: hsl(var(--ih-destructive)); }

.ih-store .woocommerce-MyAccount-navigation-link--customer-logout a:hover {
  background-color: hsl(var(--ih-destructive) / 0.08);
  color: hsl(var(--ih-destructive));
}

.ih-account__main { min-width: 0; }

/* Dashboard. */
.ih-account-greeting {
  margin-bottom: 20px !important;
  color: hsl(var(--ih-muted-foreground));
}

.ih-account-greeting strong { color: hsl(var(--ih-foreground)); }

.ih-order-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ih-order-list__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}

.ih-order-list__item + .ih-order-list__item { border-top: 1px solid hsl(var(--ih-border)); }

.ih-order-list__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.ih-order-list__number { color: hsl(var(--ih-foreground)) !important; font-weight: 500; }
.ih-order-list__date { color: hsl(var(--ih-muted-foreground)); font-size: 12px; }
.ih-order-list__total { min-width: 96px; font-weight: 600; text-align: right; }
.ih-order-list__total small { display: none; }

/* Two per row, so four shortcuts close a 2 x 2 block instead of leaving one alone. */
.ih-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 560px) {
  .ih-shortcuts { grid-template-columns: minmax(0, 1fr); }
}

/* A single address card does not stretch across the page. */
.ih-store .woocommerce-Addresses:has(> .woocommerce-Address:only-child) { grid-template-columns: minmax(0, 560px); }

.ih-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: hsl(var(--ih-muted-foreground)) !important;
  text-decoration: none !important;
}

.ih-shortcut:hover { border-color: hsl(var(--ih-primary) / 0.4); }

.ih-shortcut__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: hsl(var(--ih-primary) / 0.1);
  color: hsl(var(--ih-primary));
}

.ih-shortcut__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.ih-shortcut__title { color: hsl(var(--ih-foreground)); font-weight: 600; }
.ih-shortcut__subtitle { font-size: 12px; }

/* Endpoint content: native WooCommerce markup. */
.ih-store .woocommerce-MyAccount-content > form,
.ih-store .woocommerce-MyAccount-content > .woocommerce-Address,
.ih-store .woocommerce-Addresses .woocommerce-Address {
  padding: 24px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: var(--ih-radius-lg);
  background-color: hsl(var(--ih-card));
}

.ih-store .woocommerce-MyAccount-content > form > h2,
.ih-store .woocommerce-MyAccount-content > form > h3 { font-size: 16px; }

.ih-store .woocommerce-MyAccount-content > p:last-child { margin-bottom: 0; }

.ih-store .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.ih-store .woocommerce-Addresses::before,
.ih-store .woocommerce-Addresses::after { content: none; }

.ih-store .woocommerce-Addresses .woocommerce-Address { width: auto; float: none; }

.ih-store .woocommerce-Address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ih-store .woocommerce-Address-title h2,
.ih-store .woocommerce-Address-title h3 { margin: 0; font-size: 15px; }
.ih-store .woocommerce-Address-title .edit { font-size: 13px; font-weight: 500; }

.ih-store .woocommerce-Address address {
  padding: 0;
  border: 0;
  background: none;
  color: hsl(var(--ih-muted-foreground));
}

.ih-store .woocommerce-orders-table__cell-order-number a { color: hsl(var(--ih-foreground)); font-weight: 500; }
.ih-store .woocommerce-orders-table__cell-order-actions { text-align: right; }
.ih-store .woocommerce-orders-table__cell-order-actions .button + .button { margin-left: 6px; }

.ih-store .woocommerce-MyAccount-content .woocommerce-pagination {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
}

.ih-store .woocommerce-MyAccount-content .woocommerce-Message .button { order: 2; margin-left: auto; }

/* The payment gateway inserts this card at the beginning of a viewed order.
   Give it breathing room from the account frame without affecting checkout. */
.ih-store.woocommerce-account .woocommerce-MyAccount-content .pagou-pay--done {
  margin-top: 24px;
  margin-bottom: 24px;
}

/* ---- Access screens (logged out) ----------------------------- */

.ih-layout-auth .ih-shell { background-color: hsl(var(--ih-background)); }
.ih-layout-auth .ih-main { display: flex; }

.ih-auth {
  display: flex;
  flex: 1;
  min-height: 100vh;
  background-position: center;
  background-size: cover;
}

.admin-bar .ih-auth { min-height: calc(100vh - 32px); }

.ih-auth__panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
}

.ih-auth__card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: var(--ih-radius-lg);
  background-color: hsl(var(--ih-card));
  box-shadow: 0 4px 24px rgb(0 0 0 / 0.08);
}

.ih-auth__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.ih-store .ih-auth__brand .ih-brand__logo { height: 40px; max-width: 220px; object-position: center; }

.ih-auth__heading { margin-bottom: 24px; text-align: center; }

.ih-store .ih-auth__title { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.ih-auth__subtitle { margin: 0 !important; color: hsl(var(--ih-muted-foreground)); }
.ih-auth__hint { color: hsl(var(--ih-muted-foreground)); font-size: 13px; }

.ih-auth__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

.ih-store .ih-auth__submit { margin-bottom: 0; }
.ih-store .ih-auth__submit .button { width: 100%; }

.ih-auth__card .ih-btn--block { margin-top: 8px; }

.ih-auth__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--ih-muted-foreground)) !important;
  font-size: 13px;
  font-weight: 500;
}

.ih-auth__back:hover { color: hsl(var(--ih-foreground)) !important; text-decoration: none !important; }

/* Over a custom background the link gets its own surface to stay readable. */
.ih-auth.has-background .ih-auth__back {
  padding: 6px 14px;
  border-radius: 999px;
  background-color: hsl(var(--ih-card));
}

/* Split layouts: form on one side, image or brand panel on the other. */
.ih-auth--esquerda .ih-auth__panel,
.ih-auth--direita .ih-auth__panel {
  flex: 0 0 50%;
  max-width: 640px;
}

.ih-auth--direita { flex-direction: row-reverse; }

.ih-auth--esquerda .ih-auth__card,
.ih-auth--direita .ih-auth__card {
  border: 0;
  box-shadow: none;
  background: none;
  padding: 0;
  max-width: 380px;
}

/* Side panel: an image, or a solid colour with the logo and a sentence. With
   no colour chosen it takes a light tint of the brand colour, so any logo
   stays readable. */
.ih-auth__visual {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background-color: hsl(var(--ih-primary) / 0.08);
  background-position: center;
  background-size: cover;
  color: hsl(var(--ih-foreground));
}

.ih-auth__visual--dark { color: #fff; }

.ih-auth__visual-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 400px;
  text-align: center;
}

.ih-store .ih-auth__visual-logo { width: auto; max-width: min(280px, 100%); max-height: 110px; object-fit: contain; }
.ih-auth__visual-text { margin: 0 !important; font-size: 17px; line-height: 1.55; opacity: 0.86; }

/* The logo already sits on the side panel, so the form does not repeat it. */
@media (min-width: 901px) {
  .ih-auth.has-side-logo .ih-auth__brand { display: none; }
}

/* Small print under the register form (WooCommerce privacy notice). */
.ih-store .ih-auth__card .woocommerce-privacy-policy-text p {
  margin: 0 0 16px;
  color: hsl(var(--ih-muted-foreground));
  font-size: 12px;
  line-height: 1.5;
}

/* ---- Responsive --------------------------------------------- */

@media (max-width: 900px) {
  .ih-account { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  /* Sidebar turns into a horizontally scrollable tab strip. */
  .ih-account__sidebar {
    position: static;
    padding: 6px;
  }

  .ih-account-user { display: none; }

  .ih-store .woocommerce-MyAccount-navigation ul {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ih-store .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }

  .ih-store .woocommerce-MyAccount-navigation a { white-space: nowrap; }

  .ih-store .woocommerce-MyAccount-navigation-link--customer-logout {
    margin: 0 0 0 4px;
    padding: 0 0 0 4px;
    border-top: 0;
    border-left: 1px solid hsl(var(--ih-border));
  }

  .ih-auth__visual { display: none; }

  .ih-auth--esquerda .ih-auth__panel,
  .ih-auth--direita .ih-auth__panel { flex: 1; max-width: none; }
}

@media (max-width: 560px) {
  .ih-auth__card { padding: 24px 20px; }

  .ih-auth--esquerda .ih-auth__card,
  .ih-auth--direita .ih-auth__card { padding: 0 4px; }

  .ih-order-list__item { flex-wrap: wrap; gap: 8px 12px; padding: 14px 16px; }
  .ih-order-list__main { flex-basis: 100%; }
  .ih-order-list__total { margin-left: auto; }

  .ih-store .woocommerce-MyAccount-content > form,
  .ih-store .woocommerce-Addresses .woocommerce-Address { padding: 16px; }

  .ih-store .woocommerce-orders-table__cell-order-actions .button { flex: 1; }
}
