
@st-namespace 'Pagination-deprecated-st-css';
@st-import [ srOnly ] from '../internal/WixUiCoreComponents/common/a11y.st.css';

:import {
  -st-from: "../../common/formatters.st.js";
  -st-named: fallback, font, color;
}

:vars {
  defaultTextFont: "{theme: 'Body-M', size: '16px'}";
  defaultMobileFont: "{theme: 'Body-M', size: '14px'}";
  defaultTextFontColor: color-5;
  defaultSelectedTextFontColor: color-8;
  defaultDisabledTextFontColor: color-3;
}

:vars {
  /*
    The font of the pagination pages
    @default {theme: 'Body-M', size: '16px'}, {theme: 'Body-M', size: '14px'} for mobile
  */
  TextFont: --overridable;
  /*
    The color of the pagination pages
    @default color-5
  */
  TextFontColor: --overridable;
  /*
    The color of the selected page
    @default color-8
  */
  SelectedTextFontColor: --overridable;
  /*
    The color of the disabled nav buttons
    @default color-3
  */
  DisabledTextFontColor: --overridable;
}

/*

 * The font of the pagination pages
 * @type font
 * @default [Desktop] preset: 'Body-M' | overrides: { size: '16px'} [Mobile] preset: 'Body-M' | overrides: { size: '14px'}
  */
@property st-global(--wix-ui-tpa-pagination-text-font);

/*
 * The color of the pagination pages
 * @type color
 * @default --wix-color-5
 */
@property st-global(--wix-ui-tpa-pagination-text-font-color);

/*
 * The color of the selected page
 * @type color
 * @default --wix-color-8
 */
@property st-global(--wix-ui-tpa-pagination-selected-text-font-color);

/*
 * The color of the disabled nav buttons
 * @type color
 * @default --wix-color-3
 */
@property st-global(--wix-ui-tpa-pagination-disabled-text-font-color);


.button-common-mixin {
    display: inline-flex;
    flex-shrink: 0;
}

.root {
  -st-states: rtl, mobile, disabled, error;
  user-select: none;

  align-items: stretch;
  box-sizing: border-box;
  display: inline-flex;
  font:  fallback(font(value(TextFont)), font(value(defaultTextFont)));
  text-decoration-color: color(fallback(value(SelectedTextFontColor), value(defaultSelectedTextFontColor)));
}

.root:mobile {
  font: fallback(font(value(TextFont)), font(value(defaultMobileFont)));
}

.buttonTransition {
  transition: 200ms opacity;
}

.pageButtonRules {
  -st-mixin: buttonTransition;
  min-width: 1em;
  min-height: 1em;
  line-height: 1em;
  justify-content: center;
  align-items: center;
  padding: 0.5em 0.5em;
  margin: 0.25em;
}

.root::pageButton {
  -st-mixin: pageButtonRules;
  position: relative;
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
}

.root::currentPage {
  -st-mixin: pageButtonRules;
  color: color(fallback(value(SelectedTextFontColor), value(defaultSelectedTextFontColor)));
  text-decoration: underline;
  padding: 0.5em;
}

.root:not(:disabled)::pageButton:hover::before {
  opacity: 0.2;
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.root:not(:disabled)::pageButton:hover {
  opacity: 0.7;
}

.root:disabled::pageButton {
  cursor: default;
}

.root::navButton {
  -st-mixin: buttonTransition;
  min-width: 1em;
  min-height: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
}

.root::navButton:disabled, .root[data-preview="disabled"]::navButton {
  cursor: default;
  color: color(fallback(value(DisabledTextFontColor), value(defaultDisabledTextFontColor)));
}

.root::navButton:hover:not(:disabled) {
  opacity: 0.8;
}

.root::navButton svg {
  width: 1em;
  min-width: 24px;
  height: 1em;
  min-height: 24px;
}

.root:rtl::navButton svg {
  transform: scaleX(-1);
}

.root::navButtonFirst, .root::navButtonPrevious {
  margin-right: 1em;
}

.root:rtl::navButtonFirst, .root:rtl::navButtonPrevious {
  margin-right: 0;
  margin-left: 1em;
}

.root::navButtonLast, .root::navButtonNext {
  margin-left: 1em;
}

.root:rtl::navButtonLast, .root:rtl::navButtonNext {
  margin-left: 0;
  margin-right: 1em;
}

button.pageButton,
button.navButton {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
}

button.pageButton {
  width: 2em;
  height: 2em;

}

.root::gap {
  -st-mixin: pageButtonRules;
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
}

.root::pageStrip {
  min-width: 3em;
  overflow: visible;
  align-self: center;
}

.root::pageStripInner {
  flex-grow: 1;
  flex-basis: auto;
  justify-content: center;
  overflow: visible;
  align-items: center;
}

.root::pageStripTemplate {
  overflow: hidden;
}

.root::pageForm {
  flex-grow: 1;
  flex-basis: auto;
  justify-content: center;
  align-items: stretch;
}

.root::compact {
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
}

.root:mobile::compact{
  align-items: center;
}

.root::slash {
  line-height: 100%;
  height: 1em;
  flex-shrink: 0;
  align-self: center;
  margin-left: 0.25em;
  margin-right: 0.25em;
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
}

.root::slash svg {
  width: 1em;
  height: 1em;
}

.root::totalPages {
  max-width: 4ch;
  min-width: 1ch;
  padding-left: 0.25em;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color(fallback(value(TextFontColor), value(defaultTextFontColor)));
  align-self: center;
}


.sr-only {
    -st-mixin: srOnly;
}

.navButton {
    -st-mixin: button-common-mixin;
    -st-states: disabled;
}

.navButton:not(:disabled) {
    cursor: pointer;
}

.emptyButton {
    -st-mixin: button-common-mixin;
}

.navButtonFirst {  order: 1;  }
.navButtonPrevious,
.emptyButtonPrevious{  order: 2;  }
.navButtonNext,
.emptyButtonNext{  order: 4;  }
.navButtonLast {  order: 5;  }

.pageStrip {
    order: 3;
    overflow-x: hidden;
}

.pageStripInner {
    display: flex;
}

.pageStripTemplate {
    height: 0;
    overflow: hidden;
}

.pageButton {
    -st-mixin: button-common-mixin;
    -st-states: disabled;
}

.pageButton:not(:disabled) {
    cursor: pointer;
}

.currentPage {
    -st-mixin: button-common-mixin;
}

.gap {
    -st-mixin: button-common-mixin;
}

.pageForm {
    display: flex;
    order: 3;
}

.compact {
    -st-extends: pageForm;
}

.pageInput {}
.totalPages {}
.slash {}

/* st-namespace-reference="../../../../src/components/Pagination/Pagination.deprecated.st.css" */
    