/* ============================== Common styles ============================= */
a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin-top: 0;
  margin-bottom: 0;
}

ol,
ul {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  list-style-type: none;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

body {
  font-family: 'Roboto', sans-serif;
  color: #434455;
  background-color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* ===================== General styles for all sections ==================== */
.container {
  width: 1158px;
  padding-left: 15px;
  padding-right: 15px;
  margin: 0 auto;
}

.section-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  letter-spacing: 0.02em;
  color: #2e2f42;
  text-transform: capitalize;
  margin-bottom: 72px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;

  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/* =============================== Logo styles ============================== */
.logo {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d5ae5;
  margin-right: 76px;
}

.logo .logo-studio-header {
  color: #2e2f42;
}

.logo .logo-studio-footer {
  color: #f4f4fd;
}

/* ============================== Header styles ============================= */
.page-header {
  border-bottom: 1px solid #e7e9fc;
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: #ffffff;
  box-shadow: 0px 2px 1px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16), 0px 1px 6px rgba(46, 47, 66, 0.08);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-navigation {
  display: flex;
  align-items: center;
}

.menu {
  display: flex;
  align-items: center;
  gap: 40px;
  font-weight: 500;
  color: #2e2f42;
}

.menu-link {
  display: block;
  padding-top: 24px;
  padding-bottom: 24px;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-link:hover,
.menu-link:focus {
  color: #404bbf;
}

.menu-link.active {
  position: relative;
  color: #404bbf;
}

.menu-link.active::after {
  content: '';
  width: 100%;
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 4px;
  background-color: #404bbf;
  border-radius: 2px;
}

.contacts {
  color: #434455;
  font-style: normal;
}

.contacts-list {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* =========================== Hero section styles ========================== */
.hero {
  color: #ffffff;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding-top: 188px;
  padding-bottom: 188px;
  background-color: #2e2f42;
  background-image: linear-gradient(
      to bottom,
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url('../images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slogan {
  max-width: 496px;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;
}

.order-btn {
  font-weight: 500;
  display: block;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding-left: 32px;
  padding-right: 32px;
  min-width: 169px;
  height: 56px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: #4d5ae5;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.order-btn:hover,
.order-btn:focus {
  background-color: #404bbf;
}

/* ========================= Benefits section styles ======================== */
.benefits {
  padding-top: 120px;
  padding-bottom: 120px;
}

.benefit-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 112px;
  border: 1px solid #8e8f99;
  border-radius: 4px;
  background-color: #f4f4fd;
  margin-bottom: 8px;
}

.benefit-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: #2e2f42;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.benefits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.benefits-item {
  flex-basis: calc((100% - 3 * 24px) / 4);
}

/* ========================= Our Team section styles ======================== */
.team {
  background-color: #f4f4fd;
  padding-top: 120px;
  padding-bottom: 120px;
}

.team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}
.team-member-card {
  background-color: #ffffff;
  text-align: center;
  flex-basis: calc((100% - 3 * 24px) / 4);
  border-radius: 0 0 4px 4px;
  box-shadow: 0px 1px 6px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16), 0px 2px 1px rgba(46, 47, 66, 0.08);
}

.team-member {
  padding: 32px 0;
}

.team-member-name {
  text-align: center;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: #2e2f42;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.team-member-position {
  text-align: center;
  margin-bottom: 8px;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.social-links-item {
  width: 40px;
  height: 40px;
}

.social-link {
  width: 100%;
  height: 100%;
  background-color: #4d5ae5;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover,
.social-link:focus {
  background-color: #404bbf;
}

.social-link-icon {
  fill: #f4f4fd;
}

/* ======================= Our Portfolio section styles ===================== */
.portfolio {
  padding-top: 120px;
  padding-bottom: 120px;
}

.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 48px;
  justify-content: center;
}

.portfolio-item {
  flex-basis: calc((100% - 2 * 24px) / 3);
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover,
.portfolio-item:focus {
  box-shadow: 0px 1px 6px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16), 0px 2px 1px rgba(46, 47, 66, 0.08);
}

.portfolio-item-img {
  position: relative;
  overflow: hidden;
}
.portfolio-item-title {
  padding: 32px 16px;
  border: 1px solid #e7e9fc;
  border-top: none;
}

.portfolio-item-name {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: #2e2f42;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.portfolio-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  color: #f4f4fd;
  background-color: #4d5ae5;
  padding: 40px 32px;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .portfolio-item-overlay,
.portfolio-item:focus .portfolio-item-overlay {
  transform: translateY(0%);
}

/* ============================== Footer styles ============================= */
.page-footer {
  padding-top: 100px;
  padding-bottom: 100px;
  background-color: #2e2f42;
}

.footer-container {
  display: flex;
  align-items: baseline;
}

.footer-content {
  margin-right: 120px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.footer-text {
  color: #f4f4fd;
  max-width: 264px;
}

.social-links-container {
  margin-right: 80px;
}

.footer-social-links-title {
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 16px;
}

.footer-social-links {
  display: flex;
  gap: 16px;
}

.footer-social-links-item {
  width: 40px;
  height: 40px;
}

.footer-social-link {
  width: 100%;
  height: 100%;
  background-color: #4d5ae5;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social-link:hover,
.footer-social-link:focus {
  background-color: #31d0aa;
}

.footer-social-link-icon {
  fill: #f4f4fd;
}

.footer-subscribe-title {
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 16px;
}

.subscribe-form {
  display: flex;
  width: 453px;
  gap: 24px;
}

.subscribe-email {
  width: 264px;
  height: 40px;
  border: 1px solid #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: transparent;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.subscribe-email::placeholder {
  color: #ffffff;
}

.subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
  min-width: 165px;
  height: 40px;
  background-color: #4d5ae5;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
}

.subscribe-icon {
  margin-left: 16px;
  fill: #ffffff;
}

/*                              Order form styles                             */

.backdrop {
  background-color: rgba(46, 47, 66, 0.4);

  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;

  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 408px;
  min-height: 584px;
  background-color: #fcfcfc;
  border-radius: 4px;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 2px 1px 0 rgba(0, 0, 0, 0.2);
  padding: 24px;
  padding-top: 72px;
  /* display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px; */
  overflow-y: auto;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  /* align-self: flex-end; */
  border-radius: 50%;
  padding: 0;
  width: 24px;
  height: 24px;
  background-color: #e7e9fc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  fill: #2e2f42;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-icon {
  fill: #2e2f42;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  background-color: #404bbf;
  border: none;
}

.modal-close-btn:hover > .modal-close-icon,
.modal-close-btn:focus > .modal-close-icon {
  fill: #ffffff;
}

.callback-form-description {
  display: block;
  font-weight: 500;
  color: #2e2f42;
  margin-bottom: 24px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  margin-bottom: 16px;
}

.callback-form {
  width: 100%;
}

.callback-form-fields-wrapper {
  margin-bottom: 8px;
}

.callback-form-input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  background-color: transparent;
  padding-left: 38px;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: transparent;
}

.callback-form-input:focus {
  border-color: #4d5ae5;
  outline: transparent;
}

.callback-form-input:focus + .callback-form-field-icon {
  fill: #4d5ae5;
}

.callback-form-field-label {
  display: block;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  margin-bottom: 4px;
}

.callback-form-input-wrapper {
  position: relative;
}

.callback-form-field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  fill: #2e2f42;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.callback-form-comment-field {
  margin-bottom: 16px;
}

.callback-form-comment {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  width: 100%;
  height: 120px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  background-color: transparent;
  resize: none;
  padding: 8px 16px;
  color: rgba(46, 47, 66, 0.4);
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: transparent;
}

.callback-form-comment:focus {
  border-color: #4d5ae5;
  outline: transparent;
}

.callback-form-comment::placeholder {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
}

.callback-form-checkbox-wrapper {
  display: flex;
  margin-bottom: 24px;
}

.privacy-policy-checkbox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 2px;
  fill: transparent;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    fill 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.callback-form-privacy-checkbox:focus
  + .privacy-policy-checkbox-label
  .privacy-policy-checkbox-icon {
  outline: 1px solid #404bbf;
}

.callback-form-privacy-checkbox:checked
  + .privacy-policy-checkbox-label
  .privacy-policy-checkbox-icon {
  fill: #f4f4fd;
  border: 1px solid #404bbf;
  background-color: #404bbf;
  border: none;
}

.privacy-policy-checkbox-label {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
}

.privacy-policy-link {
  line-height: 1.33333;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #4d5ae5;
}

.callback-form-submit-btn {
  display: block;
  background-color: #4d5ae5;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 4px;
  padding: 16px 32px;
  min-width: 169px;
  height: 56px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #ffffff;
  margin-left: auto;
  margin-right: auto;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.callback-form-submit-btn:hover,
.callback-form-submit-btn:focus {
  background-color: #404bbf;
}
