/* ============================================================
   SECTION: WISHES (家族への想い & 健康は一生の付き合い)
   ============================================================ */

.wishes {
  position: relative;
  /* overflow: clip; */
  z-index: 3;
  background-color: var(--color-navy-deep);
  margin-bottom: calc(-1 * var(--wishes-slant-y));

  /* CSS Variables to control the slanted cuts and vertical gap width */
  --wishes-slant-y: 40px; /* Độ dốc dọc (top/bottom) */
  --wishes-slant-x: 40px;  /* Độ dốc ngang giữa 2 cột (0px = khít hoàn toàn) */
}

.wishes + * {
  position: relative;
  z-index: 2;
}

/* Background vertical text "WISHES" */
.wishes__deco {
  position: absolute;
  top: 0;
  right: 0;
  height: 480px;
  width: auto;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

/* Container and Grid */
.wishes__grid {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Panel Base Styles */
.wishes__panel {
  position: relative;
  width: 100%;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Text Panels */
.wishes__panel--text {
  background-color: var(--color-white);
  padding: 56px 24px;
}

.wishes__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
  color: var(--color-navy-deep);
  line-height: 1.4;
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

.wishes__text p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  letter-spacing: 0.02em;
  margin: 0;
}

.wishes__text p + p {
  margin-top: 20px;
}

/* Wish Cards Grid */
.wishes__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 16px;
  margin-top: 40px;
  margin-bottom: 32px;
}

.wish-card {
  position: relative;
  background-color: var(--color-white);
  padding: 36px 12px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(8, 0, 82, 0.06);
  border: 1px solid rgba(8, 0, 82, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 1023px) {
  .wish-card:first-child {
    grid-column: span 2;
    justify-self: center;
    width: 100%;
    max-width: 180px;
  }
}

.wish-card__capsule {
  background-color: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  box-shadow: 0 4px 10px rgba(8, 0, 82, 0.15);
}

.wish-card__text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.4;
  margin: 0;
}

.wishes__note {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-navy-deep);
  margin-top: 16px;
  margin-bottom: 0;
}

/* Media Panels */
.wishes__panel--media {
  height: 550px;
}

.wishes__img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.wishes__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile panel wrapper base styles */
.wishes__panel-wrapper {
  position: relative;
  width: 100%;
}

/* Mobile ordering: Panel 1 -> Panel 2 -> Panel 4 -> Panel 3 */
.wishes__panel--1 { order: 1; }
.wishes__panel-wrapper--2 { order: 2; }
.wishes__panel--4 { order: 3; }
.wishes__panel--3 { order: 4; }

/* Mobile slanted cuts (clip-path parallelogram shape) */
.wishes__panel {
  clip-path: polygon(0 var(--wishes-slant-y), 100% 0, 100% calc(100% - var(--wishes-slant-y)), 0 100%);
}

/* Apply negative margin-top between all grid direct children on mobile */
.wishes__grid > * + * {
  margin-top: calc(-1 * var(--wishes-slant-y));
}

/* ---- Sticky / Floating CTA Button ---- */
.wishes__sticky-btn {
  position: absolute;
  bottom: 80px; /* Tăng từ 24px lên 80px để không đè lên chữ và đường chéo trên di động */
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-orange);
  color: var(--color-white);
  padding: 4px 4px 4px 28px;
  min-height: 48px;
  min-width: 310px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 18px rgba(235, 159, 52, 0.35);
  text-decoration: none;
  white-space: nowrap;
  z-index: 5;
  overflow: hidden; /* Đảm bảo tia sáng không bị tràn ra ngoài */
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  line-height: 1;
}

/* Lớp giả chứa luồng sáng quét qua */
.wishes__sticky-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 50px;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 1;
}

.wishes__sticky-btn-text {
  letter-spacing: 0.05em;
  margin-right: 16px;
  color: var(--color-white) !important;
}

.wishes__sticky-btn-arrow {
  width: 40px;
  height: 28px;
  background-color: var(--color-orange);
  border: 1.5px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: skewX(-15deg);
  border-radius: 4px;
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s;
}

.wishes__sticky-btn-arrow span {
  display: inline-block;
  transform: skewX(15deg);
  color: var(--color-white) !important;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.3s;
}

.wishes__sticky-btn:hover {
  background-color: #f7ac3e;
  box-shadow: 0 8px 24px rgba(235, 159, 52, 0.5);
  transform: translateX(-50%) scale(1.05); /* Phóng to nhẹ khi hover */
}

.wishes__sticky-btn:hover::after {
  animation: btnShine 1.0s cubic-bezier(0.25, 1, 0.5, 1);
}

.wishes__sticky-btn:hover .wishes__sticky-btn-arrow {
  background-color: var(--color-white);
  border-color: var(--color-white);
  transform: skewX(-15deg) scale(1.05);
}

.wishes__sticky-btn:hover .wishes__sticky-btn-arrow span {
  color: var(--color-orange) !important;
  transform: skewX(15deg) translateX(2px);
}


@keyframes btnShine {
  0% { left: -150%; }
  100% { left: 200%; }
}

/* ============================================================
   PC ( >= 1024px )
   ============================================================ */
@media (min-width: 1024px) {
  .wishes {
    --wishes-slant-y: 8vw; /* Steep vertical slant height (responsive slant) */
    --wishes-slant-x: 8vw; /* Steep horizontal slant offset */
    --wishes-gap: 0px;     /* Set to 0px so the panels fit tightly together */
  }

  .wishes__panel {
    height: 100%;
  }

  .wishes__deco {
    height: 663px;
  }

  .wishes__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1100px 768px; /* Row 1 = 332px, Row 2 = 768px (Total column 1 = 1100px) */
  }

  /* Reset grid child margins on PC */
  .wishes__grid > * {
    margin-top: 0;
  }

  /* Reset ordering */
  .wishes__panel--1 { order: unset; grid-row: 1; grid-column: 1; }
  .wishes__panel-wrapper--2 { order: unset; grid-row: 1; grid-column: 2; }
  .wishes__panel--3 { order: unset; grid-row: 2; grid-column: 1; }
  .wishes__panel--4 { order: unset; grid-row: 2; grid-column: 2; }

  /* Slanted cuts on PC - mathematically aligned, parallel lines, 0px gap */
  /* Left Column Panel 1 */
  .wishes__panel--1 {
    clip-path: polygon(0 8vw, 100% 4vw, calc(100% - 8vw) calc(100% - 3.36vw), 0 100%);
    width: calc(100% + var(--wishes-slant-x));
    padding-right: calc(100px + var(--wishes-slant-x)) !important;
  }

  /* Left Column Panel 3 */
  .wishes__panel--3 {
    clip-path: polygon(0 8vw, 100% 4.64vw, calc(100% - 8vw) calc(100% - 2.72vw), 0 100%);
    margin-top: calc(-1 * var(--wishes-slant-y) + var(--wishes-gap));
    min-height: 768px !important; /* Make bottom row taller */
  }

  /* Right Column Panel 2 Wrapper & Panel */
  .wishes__panel-wrapper--2 {
    position: relative;
    z-index: 4;
    height: 100%;
    width: 100%;
    margin-left: 0;
  }

  .wishes__panel--2 {
    clip-path: polygon(8vw 4vw, 100% 0, 100% calc(100% - 8vw), 0 calc(100% - 3.36vw));
    width: 100%;
    margin-left: 0;
    min-height: 332px !important; /* Match Row 1 height to prevent stretching */
  }

  /* Center the family in the visible area to prevent bad cropping */
  .wishes__panel--2 .wishes__img {
    object-position: center center;
  }

  /* Center the walking couple in the visible area to prevent bad cropping */
  .wishes__panel--3 .wishes__img {
    object-position: center center;
  }

  /* Right Column Panel 4 */
  .wishes__panel--4 {
    background-color: var(--color-bg);
    clip-path: polygon(8vw 4.64vw, 100% 0, 100% calc(100% - 8vw), 0 calc(100% - 2.72vw));
    width: calc(100% + var(--wishes-slant-x));
    margin-left: calc(-1 * var(--wishes-slant-x));
    margin-top: calc(-1 * var(--wishes-slant-y) + var(--wishes-gap));
    padding-left: calc(100px + var(--wishes-slant-x)) !important;
  }

  /* Text Panels Padding */
  .wishes__panel--text {
    padding: 0 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Image Panels Height & Aspect Ratio */
  .wishes__panel--media {
    height: 100%;
  }

  .wishes__title {
    font-size: 32px;
    margin-bottom: 20px;
  }

  .wishes__text p {
    font-size: 16px;
  }

  /* 3 Cards row on PC */
  .wishes__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
  }

  .wish-card {
    padding: 36px 12px 20px;
  }

  .wish-card:first-child {
    grid-column: auto;
    justify-self: auto;
    width: auto;
    max-width: none;
  }



  .wish-card__text {
    font-size: 14px;
  }

  .wishes__note {
    font-size: 15px;
  }

  /* CTA Button PC Position & Sticky behavior */
  .wishes__sticky-btn {
    bottom: 250px; /* Tăng từ 40px lên 250px để đặt nút lên phía trên đè lên bãi cát của ảnh gia đình */
    left: 50%;
    transform: translateX(-50%);
    min-height: 72px;
    min-width: 440px;
    font-size: 20px;
    padding: 6px 6px 6px 40px;
  }

  .wishes__sticky-btn-text {
    margin-right: 28px;
  }

  .wishes__sticky-btn-arrow {
    width: 52px;
    height: 36px;
  }

  .wishes__sticky-btn-arrow span {
    font-size: 18px;
  }

  .wishes__sticky-btn:hover {
    transform: translateX(-50%) scale(1.05); /* Giữ lại translateX(-50%) để nút không bị lệch vị trí khi hover */
  }



}
