/* ========================================================================== 
   A2TDEV internal utilities foundation — Upgrade 116 / production freeze 117
   Account, support, search, cart/checkout and compact authenticated utilities.
   This layer intentionally sits after each page-specific stylesheet.
   ========================================================================== */

:root {
  --a2t-internal-line: rgba(255,255,255,.14);
  --a2t-internal-line-light: #d7dbd8;
  --a2t-internal-copy: #9ca6a1;
  --a2t-internal-ink: #0b0f12;
  --a2t-internal-paper: #f4f5f2;
  --a2t-internal-accent: #c8f34f;
  --a2t-internal-focus: 0 0 0 3px rgba(200,243,79,.18);
}

/* Shared focus language: visible, restrained and consistent. */
body.a2t-production-shell :is(
  .a2t-account-page,
  .a2t-global-search,
  .a2t-cart-page,
  .a2t-checkout-page,
  .a2t-order-page,
  .a2t-payment-status-page,
  .store-compact-page
) :is(a, button, input, select, textarea):focus-visible {
  outline: 1px solid var(--a2t-internal-accent) !important;
  outline-offset: 3px !important;
  box-shadow: var(--a2t-internal-focus) !important;
}

/* --------------------------------------------------------------------------
   Account / Help / profile utilities
   -------------------------------------------------------------------------- */
body.a2t-production-shell .a2t-account-page {
  padding-top: clamp(38px, 5vw, 68px) !important;
}

body.a2t-production-shell .a2t-account-hero {
  gap: clamp(24px, 4vw, 52px) !important;
  margin-bottom: 30px !important;
  padding-bottom: 30px !important;
}

body.a2t-production-shell .a2t-account-hero h1 {
  max-width: 15ch !important;
}

body.a2t-production-shell .a2t-account-actions {
  align-self: end !important;
}

body.a2t-production-shell :is(.a2t-account-grid,.a2t-settings-grid,.a2t-support-grid) {
  border-radius: 0 !important;
}

body.a2t-production-shell .a2t-account-card,
body.a2t-production-shell .a2t-account-form {
  border-radius: 0 !important;
}

body.a2t-production-shell .a2t-account-card > i {
  border-radius: 0 !important;
}

body.a2t-production-shell .a2t-account-page :is(.a2t-btn,.a2t-btn-dark) {
  border-radius: 0 !important;
}

body.a2t-production-shell .a2t-account-card > :is(.a2t-btn,.a2t-btn-dark) {
  min-width: 132px;
}

body.a2t-production-shell .a2t-account-list > div {
  min-width: 0;
}

body.a2t-production-shell .a2t-account-list > div > :is(strong,span,p,a),
body.a2t-production-shell .a2t-account-technical-value {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.a2t-production-shell .a2t-account-form :is(input,select,textarea) {
  max-width: 100%;
}

body.a2t-production-shell .a2t-account-form input[type="file"] {
  min-height: 48px;
  padding: 8px !important;
}

body.a2t-production-shell .a2t-account-form input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 12px;
  border: 1px solid #aeb5b1;
  border-radius: 0;
  background: transparent;
  color: #232b28;
  padding: 0 12px;
  font: 600 9px/1 var(--a2t-mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Commerce breadcrumb/action parity
   -------------------------------------------------------------------------- */
body.a2t-production-shell .store-compact-page .pm-breadcrumb,
body.a2t-production-shell :is(.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb) {
  min-height: 46px !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  color: #7f8a85 !important;
  font: 600 9px/1 var(--a2t-mono) !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb) :is(a,strong) {
  flex: 0 0 auto;
  padding: 0 !important;
  color: inherit !important;
  text-decoration: none !important;
}

body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb) a:hover {
  color: var(--a2t-internal-accent) !important;
}

body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb) strong {
  color: #d8ddda !important;
  font-weight: 600 !important;
}

body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb) i,
body.a2t-production-shell .a2t-commerce-breadcrumb > span {
  flex: 0 0 auto;
  width: auto !important;
  margin: 0 10px !important;
  color: #4d5853 !important;
  font-size: 7px !important;
}

body.a2t-production-shell :is(.a2t-cart-button,.a2t-checkout-button,.a2t-cart-action-button) {
  border-radius: 0 !important;
}

/* Purchase flow remains horizontal on phones. Vertical stacking consumed too
   much of the first screen and made the three-stage lifecycle harder to scan. */
body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) {
  overflow: hidden;
  border-radius: 0 !important;
}

body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li {
  min-width: 0;
}

body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.a2t-production-shell .a2t-cart-summary,
body.a2t-production-shell .a2t-checkout-pay {
  align-self: start;
}

body.a2t-production-shell .a2t-cart-panel,
body.a2t-production-shell .a2t-checkout-panel,
body.a2t-production-shell .a2t-order-panel,
body.a2t-production-shell .a2t-payment-result-card {
  border-radius: 0 !important;
}

/* --------------------------------------------------------------------------
   Search / utility parity
   -------------------------------------------------------------------------- */
body.a2t-production-shell .a2t-global-search {
  padding-top: clamp(38px, 5vw, 68px) !important;
}

body.a2t-production-shell .a2t-search-form,
body.a2t-production-shell .a2t-search-form button,
body.a2t-production-shell .a2t-search-field,
body.a2t-production-shell .a2t-search-empty-mark {
  border-radius: 0 !important;
}

body.a2t-production-shell .a2t-search-result {
  outline-offset: -1px !important;
}

body.a2t-production-shell .a2t-search-result:focus-visible {
  background: rgba(200,243,79,.04) !important;
}

/* Compact product utilities (wishlist etc.) follow the same square actions. */
body.a2t-production-shell .store-compact-page :is(button,a) {
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   Responsive production behavior
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  body.a2t-production-shell .a2t-settings-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }

  body.a2t-production-shell .a2t-support-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}

@media (max-width: 760px) {
  body.a2t-production-shell :is(.a2t-account-page,.a2t-global-search,.a2t-cart-page,.a2t-checkout-page,.a2t-order-page,.a2t-payment-status-page,.store-compact-page) {
    min-width: 0;
  }

  body.a2t-production-shell .a2t-account-page,
  body.a2t-production-shell .a2t-global-search {
    width: min(100% - 32px, var(--a2t-container)) !important;
    padding-top: 32px !important;
  }

  body.a2t-production-shell .a2t-account-hero {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    align-items: start !important;
    margin-bottom: 24px !important;
    padding-bottom: 24px !important;
  }

  body.a2t-production-shell .a2t-account-hero h1 {
    max-width: 100% !important;
    font-size: clamp(38px, 11vw, 54px) !important;
  }

  body.a2t-production-shell .a2t-account-hero p {
    font-size: 14px !important;
    line-height: 1.62 !important;
  }

  body.a2t-production-shell .a2t-account-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    align-self: auto !important;
  }

  body.a2t-production-shell .a2t-account-actions > :only-child {
    grid-column: 1 / -1;
  }

  body.a2t-production-shell .a2t-account-actions > * {
    min-width: 0 !important;
    width: 100% !important;
  }

  body.a2t-production-shell .a2t-account-stats {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    margin-bottom: 28px !important;
  }

  body.a2t-production-shell .a2t-account-stats article {
    min-height: 92px !important;
    padding: 16px !important;
    border-right: 1px solid var(--a2t-line) !important;
    border-bottom: 1px solid var(--a2t-line) !important;
  }

  body.a2t-production-shell .a2t-account-stats article:nth-child(2n) {
    border-right: 0 !important;
  }

  body.a2t-production-shell .a2t-account-stats article:nth-last-child(-n+2) {
    border-bottom: 0 !important;
  }

  body.a2t-production-shell :is(.a2t-account-grid,.a2t-settings-grid,.a2t-support-grid) {
    grid-template-columns: 1fr !important;
  }

  body.a2t-production-shell .a2t-account-card,
  body.a2t-production-shell .a2t-account-form {
    padding: 22px 20px !important;
  }

  body.a2t-production-shell .a2t-account-card > .a2t-btn,
  body.a2t-production-shell .a2t-account-card > .a2t-btn-dark {
    width: 100% !important;
  }

  body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb) {
    min-height: 44px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    white-space: nowrap;
  }
  body.a2t-production-shell :is(.store-compact-page .pm-breadcrumb,.a2t-cart-breadcrumb,.a2t-checkout-breadcrumb,.a2t-commerce-breadcrumb)::-webkit-scrollbar { display:none; }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li {
    min-height: 64px !important;
    padding: 9px 8px !important;
    border-right: 1px solid var(--commerce-dark-line) !important;
    border-bottom: 0 !important;
    align-content: center;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li:last-child {
    border-right: 0 !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li span {
    flex: 0 0 auto;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li strong {
    font-size: 8px !important;
    line-height: 1.3 !important;
  }

  body.a2t-production-shell .a2t-cart-layout,
  body.a2t-production-shell .a2t-checkout-grid,
  body.a2t-production-shell .a2t-order-overview {
    margin-top: 24px !important;
  }

  body.a2t-production-shell .a2t-cart-controls-bar {
    gap: 14px !important;
  }

  body.a2t-production-shell .a2t-checkout-pay {
    position: static !important;
  }

  body.a2t-production-shell .a2t-order-confirmation-mark {
    width: 100%;
    justify-items: start !important;
    text-align: left !important;
  }

  body.a2t-production-shell .a2t-payment-result-card {
    margin-top: 36px !important;
  }

  body.a2t-production-shell .a2t-search-form :is(input[type="search"],button) {
    font-size: 16px !important;
  }
}

@media (max-width: 430px) {
  body.a2t-production-shell .a2t-account-page,
  body.a2t-production-shell .a2t-global-search {
    width: min(100% - 32px, var(--a2t-container)) !important;
    padding-top: 28px !important;
  }

  body.a2t-production-shell .a2t-account-person {
    grid-template-columns: 56px minmax(0,1fr) !important;
  }

  body.a2t-production-shell .a2t-account-avatar {
    width: 56px !important;
    height: 56px !important;
  }

  body.a2t-production-shell .a2t-account-actions {
    grid-template-columns: 1fr !important;
  }

  body.a2t-production-shell .a2t-account-stats article {
    min-height: 84px !important;
    padding: 14px !important;
  }

  body.a2t-production-shell .a2t-account-stats strong {
    font-size: clamp(22px, 8vw, 30px) !important;
  }

  body.a2t-production-shell .a2t-account-stats .a2t-email-stat strong,
  body.a2t-production-shell .a2t-account-stats strong.a2t-compact-stat {
    font-size: 12px !important;
  }

  body.a2t-production-shell .a2t-account-card,
  body.a2t-production-shell .a2t-account-form {
    padding: 20px 18px !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li {
    min-height: 58px !important;
    padding-inline: 5px !important;
    gap: 5px !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li strong {
    font-size: 7.5px !important;
    letter-spacing: .02em !important;
  }

  body.a2t-production-shell .a2t-cart-controls-bar .a2t-cart-action-button,
  body.a2t-production-shell .a2t-cart-summary .a2t-cart-button,
  body.a2t-production-shell .a2t-checkout-hero > .a2t-checkout-button,
  body.a2t-production-shell .a2t-cart-hero > .a2t-cart-button {
    width: 100% !important;
    justify-content: center !important;
  }

  body.a2t-production-shell .a2t-payment-result-actions,
  body.a2t-production-shell .a2t-order-access-item,
  body.a2t-production-shell .a2t-order-item {
    min-width: 0;
  }
}

@media (max-width: 350px) {
  body.a2t-production-shell .a2t-account-page,
  body.a2t-production-shell .a2t-global-search {
    width: min(100% - 28px, var(--a2t-container)) !important;
  }

  body.a2t-production-shell .a2t-account-person {
    grid-template-columns: 1fr !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li {
    min-height: 56px !important;
    padding-inline: 3px !important;
  }

  body.a2t-production-shell :is(.a2t-commerce-flow,.a2t-checkout-steps) li span {
    display: none !important;
  }
}

@media (hover:none) and (pointer:coarse) {
  body.a2t-production-shell .a2t-search-result:hover { background: transparent !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.a2t-production-shell :is(.a2t-account-page,.a2t-global-search,.a2t-cart-page,.a2t-checkout-page,.a2t-order-page) * {
    scroll-behavior: auto !important;
  }
}
