/* ═══════════════════════════════════════════════════════════════════════════
   ATELIER COLORÉ CANADA — 3D ROTATING CUBE SHOWCASE SECTION
   Hold time: 1.0s | Turn time: 1.2s | Cycle length: 8.8s
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hide old product rows */
.old-showcase-rows {
  display: none !important;
}

/* Shared Background for Regional Treasures & Showcase */
.sc-shared-bg {
  background-color: #0f2347;
}

@media (min-width: 1025px) and (hover: hover) {
  .sc-shared-bg {
    background-image: var(--sc-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
}

/* Showcase Section Wrapper */
#sc-showcase {
  padding: 24px 0 60px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

#sc-showcase *,
#sc-showcase *::before,
#sc-showcase *::after {
  box-sizing: border-box;
}

.sc-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Individual Showcase Block: 72-96px vertical padding per block */
.sc-block {
  width: 100%;
  padding: clamp(72px, 7vw, 96px) 0;
  position: relative;
}

/* Centered container: max-width 1180px, side padding clamp(20px, 5vw, 64px) */
.sc-block-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(32px, 6vw, 96px);
  width: 100%;
}

/* Alternating layout: Box on left, Text on right */
.sc-block.sc-reverse .sc-block-inner {
  flex-direction: row-reverse;
}

/* Text Column */
.sc-text-wrap {
  flex: 1 1 50%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Accent Gold Line directly above heading */
.sc-label-wrap {
  display: flex;
  align-items: flex-start;
  margin-bottom: -4px;
}

.sc-label-line {
  display: block;
  height: 2px;
  background-color: #c5a059;
  width: 56px;
  transform-origin: left center;
  transition: width 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 600;
  line-height: 1.25;
  color: #f5efe3;
  margin: 0;
  letter-spacing: -0.01em;
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms,
              transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms;
}

.sc-desc {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: clamp(15px, 1.15vw, 17px);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(245, 239, 227, 0.85);
  margin: 0;
  text-align: left;
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 240ms,
              transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 240ms;
}

.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 13px 30px;
  background: transparent;
  border: 1px solid #c5a059;
  color: #f5efe3;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  border-radius: 50px;
  margin-top: 8px;
  cursor: pointer;
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 360ms,
              transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 360ms,
              background 0.35s ease,
              color 0.35s ease,
              box-shadow 0.35s ease;
}

.sc-btn:hover {
  background: #c5a059;
  color: #1d1a14;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.28);
}

/* Box Column: Centered in its column with name plate below */
.sc-box-col {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 800ms cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Text & Box Entrance Animations (Armed by JS, reveals on viewport entry) */
.sc-block.sc-armed:not(.sc-in-view) .sc-label-line {
  width: 0;
}

.sc-block.sc-armed:not(.sc-in-view) .sc-title,
.sc-block.sc-armed:not(.sc-in-view) .sc-desc,
.sc-block.sc-armed:not(.sc-in-view) .sc-btn {
  opacity: 0;
  transform: translateY(16px);
}

.sc-block.sc-armed:not(.sc-in-view) .sc-box-col {
  opacity: 0;
  transform: translateX(40px);
}

.sc-block.sc-reverse.sc-armed:not(.sc-in-view) .sc-box-col {
  transform: translateX(-40px);
}

.sc-block.sc-in-view .sc-label-line {
  width: 56px;
}

.sc-block.sc-in-view .sc-title,
.sc-block.sc-in-view .sc-desc,
.sc-block.sc-in-view .sc-btn {
  opacity: 1;
  transform: translateY(0);
}

.sc-block.sc-in-view .sc-box-col {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   3D CUBE GEOMETRY & PHYSICS
   ═══════════════════════════════════════════════════════════════════════════ */

.sc-box-wrap {
  --cube-size: clamp(230px, 26vw, 340px);
  --half-cube: calc(var(--cube-size) / 2);
  perspective: 1100px;
  width: var(--cube-size);
  height: var(--cube-size);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Pause rotation and floating motion while mouse is over the cube */
.sc-box-wrap:hover .sc-cube,
.sc-box-wrap:hover .sc-cube-floater,
.sc-box-wrap:hover .sc-bottom-text-wrap {
  animation-play-state: paused !important;
}

/* Slow vertical floating motion (6px over 6s) */
.sc-cube-floater {
  width: var(--cube-size);
  height: var(--cube-size);
  position: relative;
  transform-style: preserve-3d;
  animation: sc-box-float 6s ease-in-out infinite;
}

.sc-cube-floater.sc-paused {
  animation-play-state: paused !important;
}

@keyframes sc-box-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Fixed 3D Tilt: rotateX(24deg) (viewed slightly from below) */
.sc-cube-tilt {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(24deg);
}

/* Rotating Cube Core */
.sc-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: sc-cube-spin 8.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  will-change: transform;
}

.sc-cube.sc-paused,
.sc-bottom-text-wrap.sc-paused {
  animation-play-state: paused !important;
}

/* 6 Cube Faces (4 sides + top lid + bottom)
   Faces enlarged by 1px and offset by -0.5px to overlap adjacent faces
   by ~0.5px, eliminating all seam cracks, dotted lines, and subpixel glitches */
.sc-face {
  position: absolute;
  top: -0.5px;
  left: -0.5px;
  width: calc(var(--cube-size) + 1px);
  height: calc(var(--cube-size) + 1px);
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  outline: none;
}

/* 4 Side Faces: Full-bleed edge to edge (no border lines, no padding) */
.sc-face-side {
  padding: 0;
  overflow: hidden;
  background-color: #c5a059;
  box-shadow: inset 0 -1px 0 #c5a059;
}

/* Subtle shading: faint dark gradient toward right edge, plus bottom inset shadow */
.sc-face-side::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.12) 100%);
  box-shadow: inset 0 -1px 0 #c5a059;
  pointer-events: none;
}

.sc-face-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Face transforms pushed forward by half cube size with zero gaps */
.sc-face-front {
  transform: rotateY(0deg) translateZ(var(--half-cube));
}

.sc-face-right {
  transform: rotateY(90deg) translateZ(var(--half-cube));
}

.sc-face-back {
  transform: rotateY(180deg) translateZ(var(--half-cube));
}

.sc-face-left {
  transform: rotateY(270deg) translateZ(var(--half-cube));
}

/* Top Lid: plain solid dark face (hidden from view when viewed from below) */
.sc-face-top {
  top: -2px;
  left: -2px;
  width: calc(var(--cube-size) + 4px);
  height: calc(var(--cube-size) + 4px);
  transform: rotateX(90deg) translateZ(calc(var(--half-cube) - 0.25px));
  background-color: #2a2520;
  overflow: hidden;
}

/* Bottom Face: rich warm golden base with centered counter-rotating section name */
.sc-face-bottom {
  top: -2px;
  left: -2px;
  width: calc(var(--cube-size) + 4px);
  height: calc(var(--cube-size) + 4px);
  transform: rotateX(-90deg) translateZ(calc(var(--half-cube) - 0.25px));
  background: #c9a45c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Counter-rotating text wrapper on the bottom face */
.sc-bottom-text-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 75%;
  width: 75%;
  text-align: center;
  transform-origin: center center;
  animation: sc-name-counter-spin 8.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  will-change: transform;
}

.sc-bottom-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: calc(var(--cube-size) * 0.076);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1d1a14;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

/* Hide static name plate in normal 3D mode (used in prefers-reduced-motion) */
.sc-name-plate {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8.8s CUBE ROTATION KEYFRAMES
   Hold time: 1.0s | Turn time: 1.2s | Cycle length: 8.8s
   0% & 11.36% hold 1st; 25% & 36.36% hold 2nd; 50% & 61.36% hold 3rd;
   75% & 86.36% hold 4th; 100% end.
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes sc-cube-spin {
  0%, 11.36% {
    transform: rotateY(-28deg);
  }
  25%, 36.36% {
    transform: rotateY(-118deg);
  }
  50%, 61.36% {
    transform: rotateY(-208deg);
  }
  75%, 86.36% {
    transform: rotateY(-298deg);
  }
  100% {
    transform: rotateY(-388deg);
  }
}

/* Counter-rotation keyframes for bottom text wrapper (keeps name horizontal & upright) */
@keyframes sc-name-counter-spin {
  0%, 11.36% {
    transform: rotate(28deg);
  }
  25%, 36.36% {
    transform: rotate(118deg);
  }
  50%, 61.36% {
    transform: rotate(208deg);
  }
  75%, 86.36% {
    transform: rotate(298deg);
  }
  100% {
    transform: rotate(388deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Mobile <= 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #sc-showcase {
    padding: 32px 0 50px;
  }

  .sc-block {
    padding: 44px 0;
  }

  .sc-block-inner,
  .sc-block.sc-reverse .sc-block-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 48px;
    padding: 0 20px;
  }

  .sc-box-col {
    order: 1;
    width: 100%;
  }

  .sc-box-wrap {
    --cube-size: 220px;
    margin-bottom: 0;
  }

  .sc-name-plate {
    margin-top: 68px;
    margin-bottom: 8px;
  }

  .sc-text-wrap {
    order: 2;
    align-items: center;
    text-align: center;
    max-width: 100%;
    gap: 14px;
  }

  .sc-label-wrap {
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .sc-label-line {
    transform-origin: center;
  }

  .sc-desc {
    text-align: center;
    font-size: 15px;
    line-height: 1.65;
  }

  .sc-btn {
    align-self: center;
  }

  .sc-block.sc-armed:not(.sc-in-view) .sc-box-col,
  .sc-block.sc-reverse.sc-armed:not(.sc-in-view) .sc-box-col {
    transform: translateY(24px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   No entrance animation, no rotation; clean 2x2 grid of mats
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .sc-label-line {
    width: 56px !important;
    transition: none !important;
  }

  .sc-title,
  .sc-desc,
  .sc-btn,
  .sc-box-col {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .sc-box-wrap {
    perspective: none !important;
    width: 100% !important;
    height: auto !important;
    max-width: 380px !important;
  }

  .sc-cube-floater,
  .sc-cube-tilt {
    transform: none !important;
    animation: none !important;
    width: 100% !important;
    height: auto !important;
  }

  .sc-cube {
    animation: none !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
  }

  .sc-face-side {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
  }

  .sc-face-side img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
  }

  .sc-face-top,
  .sc-face-bottom {
    display: none !important;
  }

  .sc-box-shadow {
    display: none !important;
  }

  .sc-name-plate {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 16px !important;
  }
}
