/*
 * VEYLOVA WooCommerce customer surfaces — fluid geometry only.
 * Loaded after frontend.css so account, cart and checkout share the same
 * responsive contract as the standalone storefront.
 */

body.veylova-customer-shell,
body.woocommerce-account,
body.woocommerce-cart,
body.woocommerce-checkout {
  --vl-account-gutter: clamp(0.75rem, 4vw, 2rem);
  --vl-account-width: 67.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

body.veylova-customer-shell :where(
  main,
  section,
  article,
  aside,
  nav,
  form,
  fieldset,
  table,
  .woocommerce,
  .woocommerce-MyAccount-content
),
body.woocommerce-account :where(
  main,
  section,
  article,
  aside,
  nav,
  form,
  fieldset,
  table,
  .woocommerce,
  .woocommerce-MyAccount-content
),
body.woocommerce-cart :where(main, section, article, aside, form, table),
body.woocommerce-checkout :where(main, section, article, aside, form, table) {
  min-width: 0;
  max-width: 100%;
}

body.veylova-customer-shell :where(img, video),
body.woocommerce-account :where(img, video),
body.woocommerce-cart :where(img, video),
body.woocommerce-checkout :where(img, video) {
  max-width: 100%;
  height: auto;
}

body.veylova-customer-shell .vl-customer-header__inner,
body.veylova-customer-shell .vl-customer-heading,
body.veylova-customer-shell .vl-customer-stage > *,
body.woocommerce-account .entry-content,
body.woocommerce-account .wp-block-post-title {
  width: min(
    var(--vl-account-width),
    calc(100% - (2 * var(--vl-account-gutter)))
  );
  max-width: var(--vl-account-width);
  margin-inline: auto;
}

body.veylova-customer-shell :where(
  button,
  .button,
  [role="button"],
  input,
  select,
  textarea
),
body.woocommerce-account :where(
  button,
  .button,
  [role="button"],
  input,
  select,
  textarea
),
body.woocommerce-cart :where(
  button,
  .button,
  [role="button"],
  input,
  select,
  textarea
),
body.woocommerce-checkout :where(
  button,
  .button,
  [role="button"],
  input,
  select,
  textarea
) {
  min-width: 0;
  max-width: 100%;
  font: inherit;
}

body.veylova-customer-shell :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body.woocommerce-account :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body.woocommerce-cart :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body.woocommerce-checkout :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
}

body.veylova-customer-shell :where(.button, button, [role="button"]),
body.woocommerce-account :where(.button, button, [role="button"]),
body.woocommerce-cart :where(.button, button, [role="button"]),
body.woocommerce-checkout :where(.button, button, [role="button"]) {
  min-height: 2.75rem;
  touch-action: manipulation;
}

@media (max-width: 48.75rem) {
  body.veylova-customer-shell .vl-customer-header__inner {
    grid-template-columns: clamp(4.75rem, 20vw, 5.5rem) minmax(0, 1fr);
  }

  body.veylova-customer-shell .vl-customer-brand {
    width: 100%;
  }

  body.veylova-customer-shell .vl-customer-nav {
    min-width: 0;
    justify-content: flex-end;
    overflow: visible;
  }

  body.veylova-customer-shell .vl-customer-nav::-webkit-scrollbar {
    display: none;
  }

  body.veylova-customer-shell .vl-customer-nav a {
    flex: 0 0 auto;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation,
  body.woocommerce-account .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
    display: none;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation li {
    flex: 0 0 auto;
  }

  body.woocommerce-cart table.shop_table_responsive,
  body.woocommerce-checkout table.shop_table_responsive {
    width: 100%;
  }
}

@media (max-width: 30rem) {
  body.veylova-customer-shell .vl-customer-heading .wp-block-post-title,
  body.woocommerce-account .wp-block-post-title {
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }

  body.veylova-customer-shell .vl-orders-intro,
  body.woocommerce-orders .vl-orders-intro {
    grid-template-columns: 1fr;
  }

  body.veylova-customer-shell .vl-orders-intro .button,
  body.woocommerce-orders .vl-orders-intro .button {
    width: 100%;
  }
}

@media (max-width: 21.875rem) {
  body.veylova-customer-shell .vl-customer-header__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    min-height: 0;
    padding-block: 6px;
  }

  body.veylova-customer-shell .vl-customer-brand {
    grid-column: 1;
    width: 88px;
    justify-self: center;
  }

  body.veylova-customer-shell .vl-customer-nav {
    grid-column: 1;
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.veylova-customer-shell *,
  body.woocommerce-account *,
  body.woocommerce-cart *,
  body.woocommerce-checkout * {
    scroll-behavior: auto !important;
  }
}

/* Account navigation v2: every destination stays visible on phones. */
@media (max-width: 48.75rem) {
  body.woocommerce-account .woocommerce-MyAccount-navigation {
    padding: 6px;
    overflow: visible;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation li,
  body.woocommerce-account .woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--edit-account {
    grid-column: auto;
    min-width: 0;
    flex: initial;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation a {
    box-sizing: border-box;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    height: 100%;
    padding: 6px 5px;
    font-size: clamp(0.7rem, 2.5vw, 0.84rem);
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
  }
}

@media (max-width: 22.5rem) {
  body.woocommerce-account .woocommerce-MyAccount-navigation {
    padding: 5px;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    gap: 5px;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation a {
    padding-inline: 3px;
    font-size: 0.67rem;
  }
}
