:root {
  /* COLORS */

  --text-color: #555555;
  --primary-text-color: #303030;
  --light-text-color: #ffffff;
  --medium-text-color: #9da4bd;
  --transparent-text-color: rgba(157, 164, 189, 0.6);
  --light-bg-color: #ffffff;
  --medium-bg-color: #f7f7f7;
  --dark-bg-color: #111319;
  --booking-bg-color: #191c26;
  --accent-color: #ff6c00;
  --overlay-color: rgba(255, 106, 0, 0.6);
  --border-color: rgba(85, 85, 85, 0.5);
  --medium-border-color: rgba(157, 164, 189, 0.4);

  --gradient-color: rgba(25, 28, 38, 0.2);
  --gradient-dark-color: rgba(25, 28, 38, 0.9);

  --gradient-medium-color-start: rgba(23, 26, 36, 1);
  --gradient-medium-color-end: rgba(23, 26, 36, 0.2);

  --gradient-dark-color-start: rgba(9, 11, 19, 1);
  --gradient-dark-color-end: rgba(9, 11, 19, 0.2);

  --light-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);

  /* TYPEFACES */

  --heading-font: 'Raleway', sans-serif;
  --main-font: 'Open Sans', sans-serif;

  /* TRANSITIONS */

  --transition-function: 250ms linear;
}

body {
  font-family: var(--main-font);
  font-size: 14px;
  line-height: 1.86;
  letter-spacing: 0.02em;
  color: var(--text-color);

  background-color: var(--light-bg-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0;

  font-family: var(--heading-font);
  letter-spacing: 0.05em;
  color: var(--primary-text-color);
}

p {
  margin-top: 0;
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 0;
}

img {
  display: block;
  max-width: 100%;
}

button {
  padding: 0;

  cursor: pointer;
}

address {
  margin-bottom: 70px;

  font-style: normal;
}

/* ============= UTILITIES ============= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;

  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  overflow: hidden;
  white-space: nowrap;
}

/* ============= COMPONENTS ============= */

.container {
  width: 1200px;
  padding-left: 15px;
  padding-right: 15px;
  margin: 0 auto;
}

.section {
  padding: 120px 0;
}

.section-title {
  margin-bottom: 20px;
  line-height: 1.17;
}

.section-title,
.benefits-title {
  font-size: 42px;
  font-weight: 700;
}

.btn {
  min-width: 160px;
  height: 40px;
  padding: 12px 18px;

  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.09em;
  font-weight: 600;
  text-transform: uppercase;

  background-color: transparent;
  border: 1px solid var(--accent-color);
  border-radius: 25px;
  transition:
    background-color var(--transition-function),
    border-color var(--transition-function);
}

.btn:is(:hover, :focus-visible) {
  color: var(--light-text-color);

  background-color: var(--accent-color);
  border-color: transparent;
}

.btn-theme-light {
  color: var(--primary-text-color);
}

.btn-theme-dark {
  color: var(--light-text-color);
}

.link {
  text-decoration: none;
  color: var(--primary-text-color);
  transition: color var(--transition-function);
}

.link:is(:hover, :focus-visible) {
  color: var(--accent-color);
}

.list {
  list-style: none;
}

.follow-link,
.copyright {
  font-size: 11px;
  line-height: 1.36;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.overline {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;

  font-size: 11px;
  line-height: 1.36;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.overline-theme-light {
  color: var(--primary-text-color);
}

.overline-theme-dark {
  color: var(--transparent-text-color);
}

.overline::before {
  content: '';
  width: 60px;
  height: 1px;

  background-color: currentColor;
}

.subtitle {
  font-size: 18px;
  line-height: 1.67;
}

.subtitle-theme-light {
  color: var(--text-color);
}

.subtitle-theme-dark {
  color: var(--medium-text-color);
}

.title-theme-dark {
  color: var(--light-text-color);
}

.follow-list {
  display: flex;
  gap: 40px;
  text-transform: none;
}

/* ============= HEADER ============= */

.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding-top: 32px;
  padding-bottom: 32px;
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-nav {
  display: flex;
  align-items: center;
}

.logo {
  margin-right: 130px;
}

.logo-icon {
  fill: currentColor;
}

.menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.menu-link {
  display: block;
  padding-top: 12px;
  padding-bottom: 12px;

  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 600;
  line-height: 1.33;
  color: var(--light-text-color);
}

.header-contact-wrapper {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-right: 20px;
}

/* ============= HERO ============= */

.hero-wrapper {
  display: flex;
}

.aside {
  display: flex;
  align-items: flex-end;
  width: 100px;
  padding-left: 53px;
  padding-bottom: 40px;
}

.aside .overline {
  margin-bottom: 0;
}

.hero .follow-list {
  transform: rotate(-90deg) translateY(100%);
  transform-origin: bottom left;
}

.hero-content-wrapper {
  flex-grow: 1;
  padding-top: 272px;
  padding-right: 100px;
  padding-bottom: 208px;
  padding-left: 100px;

  background-color: var(--dark-bg-color);
  background-image:
    linear-gradient(var(--gradient-color), var(--gradient-color)),
    url(../images/background/hero-slider1-1x.jpg);
  background-repeat: no-repeat;
  background-size: cover;
}

.hero-title {
  margin-bottom: 20px;

  font-size: 72px;
  line-height: 1.18;
  letter-spacing: 0.05em;
}

.hero .subtitle {
  max-width: 360px;
}

/* ============= ABOUT ============= */

.about-wrapper {
  display: flex;
  gap: 30px;
}

.about-image-wrapper {
  display: flex;
  gap: 30px;
  flex-basis: calc((100% - 30px) / 2);
}

.about-item {
  flex-basis: calc((100% - 30px) / 2);
}

.about-info-wrapper {
  max-width: 470px;
}

.about .subtitle {
  margin-bottom: 20px;
}

.about-text {
  margin-bottom: 42px;
}

/* ============= SERVICES AND PRICES ============= */

.services {
  max-width: 1660px;
  margin: 0 auto;
  background-image: url(../images/background/services-slider-1x.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--dark-bg-color);
}

.services-list-wrapper {
  display: flex;
  gap: 30px;
}

.services .section-title,
.services-list-wrapper {
  margin-bottom: 44px;
}

.services-list {
  padding: 30px 20px;
  flex-basis: calc((100% - 30px) / 2);
}

.services-list:first-child {
  background-image: linear-gradient(
    var(--gradient-medium-color-start),
    var(--gradient-medium-color-end)
  );
}

.services-list:last-child {
  background-image: linear-gradient(
    var(--gradient-dark-color-start),
    var(--gradient-dark-color-end)
  );
}

.services-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.services-item:not(:last-child) {
  margin-bottom: 20px;
}

.services-item::before {
  content: '';

  height: 1px;
  flex-grow: 1;
  background-color: var(--transparent-text-color);
}

.services-text {
  font-size: 18px;
  line-height: 1.67;
  color: var(--medium-text-color);
}

.services-text:first-child {
  order: -1;
}

.services .btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
}

/* ============= BENEFITS ============= */

.benefits-wrapper {
  display: flex;
  gap: 130px;
  padding-left: 100px;
}

.benefits-list {
  display: flex;
  flex-wrap: wrap;
  width: 370px;
  flex-shrink: 0;
}

.benefits-list > .list-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 170px;
  height: 133px;
  padding: 20px 24px;

  background-color: var(--medium-bg-color);
}

.benefits-list > .list-item:nth-child(even) {
  margin-top: 30px;
}

.benefits-list > .list-item:nth-child(odd) {
  margin-right: 30px;
}

.benefits-info-wrapper {
  max-width: 500px;
}

.benefits-title {
  position: relative;
  margin-bottom: 6px;

  line-height: 1.36;
  letter-spacing: 0.05em;
  color: var(--primary-text-color);
}

.benefits-title::after {
  content: '+';
  position: absolute;
  top: 7px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0;
  color: var(--accent-color);
}

.benefits-text {
  font-size: 11px;
  line-height: 1.36;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--primary-text-color);
  text-align: center;
}

/* ============= OUR BARBERS =============== */

.barbers {
  background-color: var(--medium-bg-color);
}

.barbers .section-title {
  margin-bottom: 44px;
}

.barbers-overlay-wrapper {
  position: relative;
  overflow: hidden;
}

.barbers-overlay {
  position: absolute;

  top: 0;
  transform: translateY(100%);

  width: 100%;
  height: 100%;
  padding: 40px;

  background-color: var(--overlay-color);
  overflow: auto;
  transition: transform var(--transition-function);
}

.barbers-overlay-wrapper:hover .barbers-overlay {
  transform: translateY(0);
}

.barbers-overlay-text {
  font-size: 18px;
  line-height: 1.39;
  color: var(--light-text-color);
  transform: scale(0);
  transition: transform var(--transition-function) 250ms;
}

.barbers-overlay-wrapper:hover .barbers-overlay-text {
  transform: scale(1);
}

.barbers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.barbers-list > .list-item {
  flex-basis: calc((100% - 30px * 2) / 3);
}

.barbers-name-wrapper {
  padding: 30px 30px 0;

  text-align: center;
}

.barbers-name-title {
  margin-bottom: 8px;

  font-family: var(--main-font);
  font-size: 18px;
  line-height: 1.39;
  letter-spacing: 0.02em;
}

.barbers-name-subtitle {
  margin-bottom: 30px;

  font-size: 14px;
  line-height: 1.36;
  color: var(--accent-color);
}

.barbers-socials-list {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.barbers-socials-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  color: var(--primary-text-color);
  border-radius: 50%;
  background-color: var(--light-bg-color);
  transition:
    color var(--transition-function),
    box-shadow var(--transition-function);
}

.barbers-socials-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.barbers-socials-link:is(:hover, :focus-visible) {
  box-shadow: var(--light-shadow);
  color: var(--accent-color);
}

/* ============= WORKS ============= */

.works-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.works-list .list-item {
  flex-basis: calc((100% - 30px * 3) / 4);
}

.works .overline {
  margin-bottom: 44px;
}

/* ============= BOOKING-CONTACTS ============= */

.booking-contacts {
  padding-top: 130px;
  padding-bottom: 120px;
  max-width: 1660px;
  margin: 0 auto;

  background-color: var(--booking-bg-color);
  background-image: url(../images/background/contacts-slider-1x.webp);
  background-repeat: no-repeat;
  background-position: right;
  background-size: calc(50% - 15px) 100%;
}

.booking-contacts-wrapper {
  display: flex;
}

.booking {
  padding-right: 30px;
  flex-basis: calc(50% + 15px);
}

.booking-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.booking-field-label {
  position: relative;
  width: calc((100% - 30px) / 2);
  margin-bottom: 44px;

  color: var(--medium-border-color);
}

.booking-field {
  width: 100%;
  height: 24px;
  padding: 0;
  margin: 0;

  color: var(--light-text-color);

  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--medium-border-color);
  outline: transparent;
  transition: border-color var(--transition-function);
}

.booking-field-name {
  position: absolute;
  top: 0;
  left: 0;

  transition:
    transform var(--transition-function),
    color var(--transition-function);
}

.booking-field-name {
  font-size: 11px;
  line-height: 1.36;
  letter-spacing: 0.1em;
  font-weight: 600;
  text-transform: uppercase;
}

.booking-field:focus {
  border-color: var(--light-bg-color);
}

.booking-field:focus + .booking-field-name {
  transform: translateY(-24px);
  color: var(--light-text-color);
}

.booking-field:not(:focus):not(:placeholder-shown) + .booking-field-name {
  transform: translateY(-24px);
}

.booking-field-label.message {
  width: 100%;
}

.booking-message {
  height: 76px;
  margin-bottom: 44px;
  resize: none;
}

.contacts {
  padding-left: 100px;
  flex-basis: calc(50% - 15px);
}

.booking .section-title {
  margin-bottom: 44px;
}

.contacts .section-title {
  margin-bottom: 40px;
}

.contacts-item:not(:last-child) {
  margin-bottom: 20px;
}

.contacts-link {
  display: flex;
  align-items: center;

  font-size: 18px;
  line-height: 1.67;
  color: var(--medium-text-color);
}

.address-link {
  align-items: flex-start;
  font-weight: 700;
}

.el-link {
  text-decoration: underline;
}

.contacts-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-right: 16px;

  stroke: currentColor;
  fill: transparent;
}

.contacts-text {
  white-space: nowrap;
}

.info-text {
  font-size: 18px;
  line-height: 1.67;
  color: var(--medium-text-color);
}

/* ============= FOOTER ============= */

footer {
  padding: 56px 0;
}

.footer-wrapper {
  display: flex;
  justify-content: space-between;
}

.footer-wrapper .overline {
  margin-bottom: 0;
}

.copyright {
  color: var(--medium-text-color);
}

/* ============= MODAL WINDOW ============= */

body.modal-open {
  overflow: hidden;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background-color: var(--gradient-dark-color);

  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow-y: scroll;

  transition:
    opacity var(--transition-function),
    visibility var(--transition-function);
}

.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.is-hidden .modal {
  transform: translate(-50%, -50%) scale(1.1);
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 528px;
  min-height: 580px;
  padding: 50px;
  background-color: var(--light-bg-color);
  border-radius: 5px;

  transform: translate(-50%, -50%) scale(1);
  transition: transform var(--transition-function);
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  border: 1px solid var(--text-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  transition: border-color var(--transition-function);
  color: var(--primary-text-color);
}

.modal-close-icon {
  fill: currentColor;
  transition: fill var(--transition-function);
}

.modal-close-btn:is(:hover, :focus-visible) {
  border-color: var(--accent-color);
}

.modal-close-btn:is(:hover, :focus-visible) .modal-close-icon {
  fill: var(--accent-color);
}

.modal-title {
  margin-bottom: 20px;

  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

.modal-list {
  margin-bottom: 20px;
}

.modal-field:not(:last-child) {
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  height: 40px;
  padding-left: 38px;

  color: var(--primary-text-color);

  border: 1px solid var(--primary-text-color);
  border-radius: 3px;
  outline: transparent;
  transition: border-color var(--transition-function);
}

.modal-input::placeholder,
.modal-comment::placeholder {
  color: var(--border-color);
}

.modal-input:not(:focus):not(:placeholder-shown):valid {
  background-color: rgba(100, 203, 121, 0.195);
}

.modal-input:not(:focus):not(:placeholder-shown):invalid {
  background-color: rgba(255, 99, 71, 0.3);
}

.modal-input:focus-visible {
  border-color: var(--accent-color);
}

.modal-input:focus-visible + .icon {
  fill: var(--accent-color);
}

.input-wrapper {
  position: relative;
}

.icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 24px;
  fill: currentColor;
  transition: fill var(--transition-function);
}

.modal-comment {
  width: 100%;
  height: 80px;
  padding: 10px;

  color: var(--primary-text-color);

  border: 1px solid var(--primary-text-color);
  border-radius: 3px;
  resize: none;
  outline: transparent;
}

.modal-comment:focus-visible {
  border-color: var(--accent-color);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-policy-text .link {
  text-decoration: underline;
  cursor: pointer;
}

.icon-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  fill: transparent;
  transition:
    fill var(--transition-function),
    border-color var(--transition-function);
  cursor: pointer;
}

.user-policy:checked + .icon-check {
  border-color: var(--accent-color);
  fill: var(--primary-text-color);
}

.user-policy:focus + .icon-check {
  border-color: var(--accent-color);
}
