/* shop.css — Shop page styles (film showcase, product modal, welcome modal) */

.film-showcase {
  position: relative;
  width: 100%;
  margin-top: clamp(2rem, 5vh, 3rem);
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(0.75rem, 2.5vw, 1.25rem);
  overflow-x: clip;
  overflow-y: visible;
}

.film-glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  inset: 0;
  background:
    radial-gradient(
      ellipse 42% 38% at 36% 40%,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.28) 38%,
      rgba(255, 255, 255, 0) 66%
    ),
    radial-gradient(
      ellipse 36% 44% at 72% 34%,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.12) 42%,
      rgba(255, 255, 255, 0) 64%
    ),
    radial-gradient(
      ellipse 48% 40% at 54% 62%,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(255, 255, 255, 0.2) 36%,
      rgba(255, 255, 255, 0) 68%
    ),
    radial-gradient(
      ellipse 30% 34% at 18% 72%,
      rgba(255, 255, 255, 0.38) 0%,
      rgba(255, 255, 255, 0) 58%
    ),
    radial-gradient(
      ellipse 28% 30% at 84% 78%,
      rgba(255, 255, 255, 0.32) 0%,
      rgba(255, 255, 255, 0) 55%
    );
}

.film-glow::before {
  content: "";
  position: absolute;
  top: 3%;
  right: 12%;
  width: 46%;
  height: 52%;
  background: radial-gradient(
    ellipse 68% 62% at 48% 44%,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.14) 44%,
    rgba(255, 255, 255, 0) 72%
  );
  border-radius: 44% 56% 62% 38% / 55% 45% 52% 48%;
  transform: rotate(7deg);
}

.film-glow::after {
  content: "";
  position: absolute;
  bottom: 2%;
  left: 8%;
  width: 44%;
  height: 48%;
  background: radial-gradient(
    ellipse 64% 58% at 42% 56%,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0) 70%
  );
  border-radius: 52% 48% 60% 40% / 45% 55% 50% 50%;
  transform: rotate(-8deg);
}

.film-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  padding: 0.35rem 0.25rem;
}

.film-card {
  --tilt: 0deg;
  position: relative;
  cursor: pointer;
  background: #f7f7f5;
  padding: 0.55rem 0.55rem 2.4rem;
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 5px 16px rgba(0, 0, 0, 0.11),
    0 1px 3px rgba(0, 0, 0, 0.07);
  transform: rotate(var(--tilt));
}

.film-card:nth-child(1) { --tilt: -2.5deg; }
.film-card:nth-child(2) { --tilt: 1.8deg; }
.film-card:nth-child(3) { --tilt: -1.2deg; }
.film-card:nth-child(4) { --tilt: 2.2deg; }
.film-card:nth-child(5) { --tilt: -1.8deg; }
.film-card:nth-child(6) { --tilt: 1.4deg; }

.film-photo {
  aspect-ratio: 1;
  border-radius: 1px;
  overflow: hidden;
  background-size: 118% auto, 14px 14px;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.film-card:nth-child(odd) .film-photo {
  background-color: #f4f8fc;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #e8f2fa 0% 50%);
}

.film-card:nth-child(even) .film-photo {
  background-color: #faf6f8;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #f5e8ef 0% 50%);
}

.film-footer {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: calc(0.38rem + 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.film-price {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  font-weight: 400;
  color: #3a3a3a;
  line-height: 1;
  letter-spacing: 0.02em;
}

.film-buy {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: clamp(0.58rem, 1.3vw, 0.68rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #5a7a92;
  border: none;
  border-radius: 2px;
  padding: 0.28rem 0.45rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.film-buy:hover {
  background: #4a6a82;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(40, 60, 75, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-panel {
  position: relative;
  width: min(52rem, 100%);
  max-height: min(34rem, 90vh);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  transform: scale(0.96);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal.is-open .modal-panel {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #f0f0f0;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: min(34rem, 90vh);
}

.modal-media {
  background-color: #f4f8fc;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #e8f2fa 0% 50%);
  background-size: 72% auto, 14px 14px;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
  min-height: 18rem;
}

.modal-media.is-pink {
  background-color: #faf6f8;
  background-image:
    url("../candle.png"),
    repeating-conic-gradient(#ffffff 0% 25%, #f5e8ef 0% 50%);
}

.modal-info {
  padding: 2rem 2rem 2rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.15;
  padding-right: 1.5rem;
}

.modal-price {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
}

.modal-desc {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.55;
  color: #5c5c5c;
  margin: 0;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-label {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.option-pill {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option-pill:hover {
  border-color: #999;
}

.option-pill.is-selected {
  border-color: #1a1a1a;
  background: #f7f7f7;
}

.modal-qty-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
}

.qty-btn {
  font-family: "Geist Sans", "Geist", sans-serif;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #1a1a1a;
  cursor: pointer;
}

.qty-btn:hover {
  background: #f5f5f5;
}

.modal-qty {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  min-width: 1.5rem;
  text-align: center;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.modal-atc,
.modal-buy {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.modal-atc {
  color: #fff;
  background: var(--pink);
  border: 1px solid var(--pink);
}

.modal-atc:hover {
  background: var(--pink-hover);
  border-color: var(--pink-hover);
}

.modal-buy {
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #1a1a1a;
}

.modal-buy:hover {
  background: #f7f7f7;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(40, 60, 75, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  font-family: "Geist Sans", "Geist", sans-serif;
}

.welcome-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.welcome-panel {
  position: relative;
  width: min(22rem, 100%);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  transform: scale(0.96);
  transition: transform 0.28s ease;
  overflow: hidden;
}

.welcome-modal.is-open .welcome-panel {
  transform: scale(1);
}

.welcome-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #444;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.welcome-close:hover {
  background: #f5f5f5;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem 1.75rem;
  gap: 0.6rem;
  font-family: "Geist Sans", "Geist", sans-serif;
}

.welcome-title {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 400;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0;
}

.welcome-desc {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

.welcome-code-wrap {
  width: 100%;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.welcome-code-label {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.35rem;
}

.welcome-code-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.welcome-code {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  color: #1a1a1a;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 0.65rem 0.75rem;
  user-select: all;
}

.welcome-copy {
  flex-shrink: 0;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: #5a7a92;
  border: none;
  border-radius: 3px;
  padding: 0 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.welcome-copy:hover {
  background: #4a6a82;
}

.welcome-copy.is-copied {
  background: #4a7a62;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
}

.welcome-cta {
  width: 100%;
  box-sizing: border-box;
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: #5a7a92;
  border: none;
  border-radius: 3px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: center;
}

.welcome-cta:hover {
  background: #4a6a82;
}

.welcome-dismiss {
  font-family: "Geist Sans", "Geist", sans-serif;
  font-size: 0.68rem;
  color: #999;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.welcome-dismiss:hover {
  color: #666;
}

@media (max-width: 720px) {
  .modal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .film-showcase {
    margin-top: 1.25rem;
    padding: 1rem 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .film-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
  }

  .film-card {
    transform: rotate(0deg) !important;
    padding: 0.45rem 0.45rem 3rem;
    min-width: 0;
    width: 100%;
  }

  .film-card:nth-child(odd) .film-photo {
    background-color: #faf6f8;
    background-image:
      url("../candle.png"),
      repeating-conic-gradient(#ffffff 0% 25%, #f5e8ef 0% 50%);
  }

  .film-buy {
    font-size: 0.62rem;
    padding: 0.5rem 0.65rem;
    min-height: 2rem;
    letter-spacing: 0.05em;
  }

  .film-price {
    font-size: 0.74rem;
    line-height: 1.2;
    flex-shrink: 1;
    min-width: 0;
  }

  .film-footer {
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.5rem;
    gap: 0.35rem;
    min-height: 2rem;
    align-items: center;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92dvh;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    overflow: hidden;
  }

  .modal.is-open .modal-panel {
    transform: translateY(0);
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    width: 2.25rem;
    height: 2.25rem;
  }

  .modal-layout {
    display: block;
    flex: 1;
    min-height: 0;
    max-height: 92dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-media {
    position: relative;
    z-index: 0;
    width: 100%;
    aspect-ratio: 1;
    max-height: min(48dvh, 100vw);
    background-size: 78% auto, 14px 14px;
    background-position: center, center;
  }

  .modal-info {
    position: relative;
    z-index: 2;
    margin-top: -1.75rem;
    background: #ffffff;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.08);
    overflow: visible;
    padding: 1.35rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
    gap: 0.75rem;
  }

  .modal-title {
    font-size: 1.45rem;
    padding-right: 2rem;
  }

  .option-pill {
    padding: 0.55rem 0.85rem;
    min-height: 2.25rem;
  }

  .qty-btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .modal-atc,
  .modal-buy {
    padding: 1rem;
    min-height: 3rem;
    font-size: 0.88rem;
    width: 100%;
  }

  .modal-actions {
    width: 100%;
  }

  .option-group {
    justify-content: flex-start;
  }

  .modal-qty-row {
    margin: 0 auto;
  }

  .welcome-modal {
    padding: 0;
    align-items: flex-end;
  }

  .welcome-panel {
    width: 100%;
    max-height: 94dvh;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }

  .welcome-modal.is-open .welcome-panel {
    transform: translateY(0);
  }

  .welcome-content {
    padding: 1.35rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
    align-items: center;
    text-align: center;
  }

  .welcome-code-wrap,
  .welcome-code-row {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .film-grid {
    grid-template-columns: 1fr;
    max-width: min(16rem, 88vw);
    margin-left: auto;
    margin-right: auto;
  }
}
