/* ================================
   DELIVERY LOCATION SELECTOR MODAL
   ================================ */

/* Modal Overlay */
.delivery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Hidden by default - will be shown on first visit */
  display: none;
}

.delivery-modal.is-active {
  display: flex;
}

/* Backdrop */
.delivery-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(4px);
}

/* Modal Container */
.delivery-modal__container {
  position: relative;
  background-color: var(--pearl-white);
  border-radius: 24px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 56px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Back Button */
.delivery-modal__back-btn {
  position: absolute;
  top: 32px;
  left: 32px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--velvet-black);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.delivery-modal__back-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.delivery-modal__back-btn:hover {
  background-color: var(--soft-gray);
  transform: translateX(-2px);
}

.delivery-modal__back-btn:focus {
  outline: 2px solid var(--imperial-purple);
  outline-offset: 2px;
}

/* Header */
.delivery-modal__header {
  text-align: center;
  margin-bottom: 32px;
}

.delivery-modal__title {
  font-family: var(--font-headline);
  font-size: 40px;
  font-weight: var(--weight-regular);
  color: var(--velvet-black);
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.delivery-modal__brand {
  color: var(--imperial-purple);
}

.delivery-modal__tagline {
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 16px;
  color: var(--velvet-black);
  margin: 0;
  opacity: 0.8;
}

/* Hero Image */
.delivery-modal__hero {
  width: 100%;
  margin-bottom: 40px;
  border-radius: 16px;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.delivery-modal__hero.is-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.delivery-modal__hero-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* Step Container */
.delivery-modal__step {
  margin-bottom: 32px;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.delivery-modal__step--hidden {
  display: none;
}

.delivery-modal__step--animating {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform, opacity;
}

.delivery-modal__step--slide-in-right {
  animation: step-slide-in-right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.delivery-modal__step--slide-in-left {
  animation: step-slide-in-left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.delivery-modal__step--slide-out-left {
  animation: step-slide-out-left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.delivery-modal__step--slide-out-right {
  animation: step-slide-out-right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes step-slide-in-right {
  from {
    opacity: 0;
    transform: translate3d(20px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes step-slide-in-left {
  from {
    opacity: 0;
    transform: translate3d(-20px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes step-slide-out-left {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(-20px, 0, 0);
  }
}

@keyframes step-slide-out-right {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(20px, 0, 0);
  }
}

/* Question */
.delivery-modal__question {
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 18px;
  color: var(--velvet-black);
  margin: 0 0 24px 0;
  text-align: left;
}

.delivery-modal__question strong {
  font-weight: var(--weight-semibold);
}

/* Options Grid */
.delivery-modal__options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

/* Option Button */
.delivery-modal__option {
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 16px;
  color: var(--velvet-black);
  background-color: var(--pearl-white);
  border: 1px solid rgba(10, 10, 10, 0.1);
  border-radius: 999px;
  padding: 18px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delivery-modal__option:hover {
  background-color: var(--imperial-purple);
  color: var(--pearl-white);
  border-color: var(--imperial-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(75, 0, 130, 0.2);
}

.delivery-modal__option.is-selected {
  background-color: var(--imperial-purple);
  color: var(--pearl-white);
  border-color: var(--imperial-purple);
  font-weight: var(--weight-semibold);
}

.delivery-modal__option:focus {
  outline: 2px solid var(--imperial-purple);
  outline-offset: 2px;
}

/* CTA Button */
.delivery-modal__cta {
  width: 100%;
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 18px;
  color: var(--pearl-white);
  background-color: var(--imperial-purple);
  border: none;
  border-radius: 4px;
  padding: 20px 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.delivery-modal__cta-location {
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

.delivery-modal__cta:disabled {
  background-color: rgba(75, 0, 130, 0.3);
  cursor: not-allowed;
  opacity: 0.6;
}

.delivery-modal__cta:not(:disabled):hover {
  background-color: var(--deep-plum);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(75, 0, 130, 0.3);
}

.delivery-modal__cta:focus {
  outline: 2px solid var(--imperial-purple);
  outline-offset: 2px;
}

/* ================================
   RESPONSIVE STYLES
   ================================ */

/* Tablet */
@media (max-width: 768px) {
  .delivery-modal__container {
    padding: 40px 32px;
  }

  .delivery-modal__title {
    font-size: 32px;
  }

  .delivery-modal__hero-image {
    height: 220px;
  }

  .delivery-modal__options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .delivery-modal__option {
    padding: 16px 20px;
    min-height: 54px;
    font-size: 15px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .delivery-modal {
    padding: 16px;
  }

  .delivery-modal__container {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .delivery-modal__back-btn {
    top: 24px;
    left: 24px;
    width: 36px;
    height: 36px;
  }

  .delivery-modal__title {
    font-size: 28px;
  }

  .delivery-modal__tagline {
    font-size: 14px;
  }

  .delivery-modal__hero {
    margin-bottom: 32px;
  }

  .delivery-modal__hero-image {
    height: 200px;
  }

  .delivery-modal__question {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .delivery-modal__options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
  }

  .delivery-modal__option {
    padding: 14px 16px;
    min-height: 50px;
    font-size: 14px;
    border-radius: 999px;
  }

  .delivery-modal__cta {
    padding: 18px 28px;
    font-size: 16px;
  }
}
