/* cart_extend 0.3.88 — consistent type hierarchy across FRONTEND and BE modules.
 * All sizes come from DesignTokens.css; this file changes only cart_extend
 * component subtrees, never TYPO3's surrounding site/backend UI.
 * Email HTML and printed A4 forms intentionally use their own media scales.
 */

/* 16px normal content, identical in management, customer, stock, search,
 * product and cart surfaces. Keep the site's selected font family. */
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel, .cart-extend-quote,
    .cart-extend-product-period, .cart-extend-cart-period) {
  font-family: var(--ce-font-family, inherit);
  font-size: var(--ce-font-size-base);
  line-height: var(--ce-line-height-base);
}

/* Headings are driven by semantic level, not by a bootstrap/theme preset.
 * Real product H1 stays H1 but is deliberately sized as a section heading. */
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel, .cart-extend-quote) h1 {
  font-size: var(--ce-font-size-page-heading);
  line-height: var(--ce-line-height-heading);
}
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel, .cart-extend-quote) h2 {
  font-size: var(--ce-font-size-section-heading);
  line-height: var(--ce-line-height-heading);
}
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel, .cart-extend-quote) h3 {
  font-size: var(--ce-font-size-subheading);
  line-height: var(--ce-line-height-heading);
}
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel, .cart-extend-quote) :is(h4, h5, h6) {
  font-size: var(--ce-font-size-base);
  line-height: var(--ce-line-height-heading);
}

/* Regular paragraphs, list items, links and summaries do not change
 * size between customer, cart and administration when a theme uses custom
 * article/checkout typography. Their emphasis still comes from weight/color. */
:is(.ce-bookings, .ce-module, .ce-product-search, .cart-extend-cart-view,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel)
  :is(p, li, a, summary, dt, dd) {
  font-size: var(--ce-font-size-base);
}

/* Same 18px legend everywhere, including product and cart legends. */
:is(.ce-bookings, .ce-module, .cart-extend-cart-view) fieldset.ce-section-frame > legend,
.ce-bookings.ce-offer-editor fieldset.ce-offer-step > legend,
.cart-extend-products-detail .product.ce-product-panel > h1.ce-product-legend-heading,
.cart-extend-product-offer .selectbox.ce-product-panel > h3.ce-product-legend-heading {
  font-size: var(--ce-font-size-lg) !important;
  line-height: var(--ce-line-height-heading);
}
/* Product name has H1 semantics, but a slightly stronger 22px title. */
.cart-extend-products-detail .product.ce-product-panel > h1.ce-product-legend-heading {
  font-size: var(--ce-font-size-product-heading) !important;
}

/* Frontend themes often assign different sizes to cart table cells and to
 * labels; normalize all tabular text and keep emphasis via font-weight. */
:is(.ce-bookings, .ce-module, .cart-extend-cart-view, .ce-product-search,
    .cart-extend-product-offer) :is(table, th, td, caption) {
  font-size: var(--ce-font-size-table) !important;
  line-height: var(--ce-line-height-base);
}
:is(.ce-bookings, .ce-module, .cart-extend-cart-view, .ce-product-search,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel) :is(label, dt, dd) {
  font-size: var(--ce-font-size-base);
  line-height: var(--ce-line-height-base);
}

/* Control sizes must be 16px, especially on touch devices (avoids iOS zoom).
 * Exclude icon-only calendar arrows, which have a separate token below. */
:is(.ce-bookings, .ce-module, .cart-extend-cart-view, .ce-product-search,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel)
  :is(input:not([type=hidden]), select, textarea, .form-control,
      .cart-extend-calendar-toggle) {
  font-family: inherit;
  font-size: var(--ce-font-size-control) !important;
  line-height: var(--ce-line-height-control);
}
:is(.ce-bookings, .ce-module, .cart-extend-cart-view, .ce-product-search,
    .cart-extend-products-detail, .cart-extend-product-offer,
    .cart-extend-period, .cart-extend-period-panel)
  :is(button, .btn, input[type=submit], input[type=button], .ce-icon-action) {
  font-family: inherit;
  font-size: var(--ce-font-size-button) !important;
  line-height: var(--ce-line-height-control);
}

/* Consistent secondary information, without shrinking regular field labels. */
:is(.ce-bookings, .ce-module, .cart-extend-cart-view, .ce-product-search,
    .cart-extend-products-detail, .cart-extend-product-offer)
  :is(small, .small, .ce-booking-organisation, .ce-fulfillment-hint,
      .cart-extend-line-availability, .ce-selectbox-stock, .ce-offer-help,
      .ce-product-search-missing, .form-text, .help-block,
      .invalid-feedback, .cart-extend-period-hint) {
  font-size: var(--ce-font-size-sm) !important;
  line-height: var(--ce-line-height-base);
}

/* Subtotals use the same body size; the actual TOTAL is an 18px accent. */
.cart-extend-cart-view :is(.cart-extend-rental-total,
    .cart-extend-final-summary .total-gross) :is(th, td),
.ce-bookings.ce-offer-editor .ce-offer-price-summary strong {
  font-size: var(--ce-font-size-total) !important;
}

/* Cart date picker and team date picker: calendar numerals remain readable. */
:is(.cart-extend-cart-view, .cart-extend-product-offer, .ce-bookings)
  :is(.cart-extend-calendar-day, .ce-admin-calendar-grid button) {
  font-size: var(--ce-font-size-base) !important;
}
:is(.cart-extend-cart-view, .cart-extend-product-offer, .ce-bookings)
  :is(.cart-extend-calendar-weekday, .ce-admin-calendar-weekday) {
  font-size: var(--ce-font-size-xs) !important;
}
:is(.cart-extend-cart-view, .cart-extend-product-offer, .ce-bookings)
  :is(.cart-extend-month-nav, .ce-admin-calendar-nav button) {
  font-size: var(--ce-font-size-calendar-nav) !important;
  line-height: 1;
}
.cart-extend-product-offer .cart-extend-calendar-symbol {
  font-size: var(--ce-font-size-icon);
}

/* Icons within action cards stay icons; labels have the regular body size. */
.ce-bookings :is(.ce-admin-nav-card .ce-card-label, .ce-admin-tabs a,
    .ce-admin-action-link) {
  font-size: var(--ce-font-size-base);
}

/* Neither the font size nor the hierarchy changes at mobile widths;
 * only spatial layout changes in the component stylesheets. */
@media (max-width: 650px) {
  .cart-extend-cart-view fieldset.ce-section-frame > legend.ce-cart-legend,
  .cart-extend-cart-view #form-order fieldset.checkout-step.ce-section-frame > legend.ce-cart-legend {
    font-size: var(--ce-font-size-lg) !important;
  }
}
