/*--------------------------------------------------------------
## Popup Styling
--------------------------------------------------------------*/

.order--popup {
  opacity: 0;
  height: 100%;
  pointer-events: none;
  transition: 0.5s ease opacity;
  background-color: #fff;
  position: absolute;
  z-index: 10;
  width: 100%;
  left: 0px;
  top: 0px;
}

body.popup-open {
  .order--popup {
    opacity: 1;
    pointer-events: all;
  }
}

.popup-close {
  width: 15px;
  aspect-ratio: 1;
  background-image: url("close.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  cursor: pointer;
}

/* ------------ Care Popup Styles ------------ */

.care-popup-backdrop {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  position: fixed;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
  justify-content: center;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
  &.active {
    opacity: 1;
    pointer-events: all;
  }
}

.care-popup {
  max-width: 550px;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.5s ease;
  width: calc(100% - 40px);
  position: relative;
  z-index: 99;
}

.care-image {
  display: flex;
  justify-content: center;
  img {
    max-width: 175px;
    aspect-ratio: 4/5;
    object-fit: cover;
  }
}

.care-instructions,
.list {
  list-style-type: "–  ";
  li {
    margin-bottom: 0.02em;
    padding-left: 0.15em;
  }
  @media (max-width: 980px) {
    margin-left: 20px;
  }
}

.list {
  margin-left: 10px;
}

body.care-popup-open {
  overflow: hidden;
  #shopify-section-related-products {
    position: relative;
    z-index: -1;
  }
}

/* ------------ Size Guide Popup Styles ------------ */

.size-guide-popup-backdrop {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  position: fixed;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  &.active {
    opacity: 1;
    pointer-events: all;
  }
}

.size-guide-popup {
  max-width: 550px;
  background-color: #fff;
  width: calc(100% - 40px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s ease;
  position: relative;
  z-index: 999;
}

.size-guide-image {
  display: flex;
  justify-content: center;
  img {
    height: auto;
    object-fit: contain;
    max-width: 100%;
  }
}

body.size-guide-popup-open {
  overflow: hidden;
  #shopify-section-related-products {
    position: relative;
    z-index: -1;
  }
}

/* ------------ Newsletter Popup Styles ------------ */

#email-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  background: rgba(239, 239, 239, 0.82);
  backdrop-filter: blur(17px);
  padding: 60px 40px;
  transform: translateY(100%);
  transition: transform 0.65s ease;
  z-index: 999;

  &.visible {
    transform: translateY(0);
  }

  &.success {
    .popup-inner {
      justify-content: center;
    }
  }
}

#email-popup .popup-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 25px;
  height: 25px;
  background-image: url("close.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: transparent;
  background-size: 20px;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.6;
  }
}

.popup-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-subscription {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;

  @media (max-width: 768px) {
    flex-direction: column;
    gap: 30px;
  }
}

.email-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 300px;

  @media (max-width: 768px) {
    min-width: 100%;
    width: 100%;
  }
}

.email-input {
  flex: 1;
  padding: 10px 50px 10px 0;
  height: 40px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #000;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;

  &::placeholder {
    color: rgba(0, 0, 0, 0.5);
  }

  &:focus {
    border-bottom-color: #000;
  }

  &.error {
    border-bottom-color: #ff0000;
    animation: shake 0.3s;
  }
}

.submit-arrow-newsletter {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.6;
  }

  svg {
    width: 24px;
    height: 4px;
  }
}

.subscription-success {
  text-align: center;
  animation: fadeIn 0.5s;
}

/* ------------ Animations ------------ */

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
