/* css/shop.css */

/* ==========================================================================
   1. Setup & Variables (Scoped)
   ========================================================================== */
.shop-wrapper {
  --shop-bg-color: #000000;
  --shop-text-color: #ffcc00;
  --shop-accent-color: #ffffff;

  --shop-font-primary: "Bebas Neue", sans-serif;
  --shop-font-body:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --shop-item-width: 280px;
  --shop-item-height: 280px;

  --shop-grid-gap-x: 66px;
  --shop-grid-gap-y: 66px;
}

/* ==========================================================================
   2. Main Layout & Resets (Scoped)
   ========================================================================== */

.shop-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: var(--shop-bg-color);
  color: var(--shop-text-color);
  font-family: var(--shop-font-body);
  overflow: hidden;
  user-select: none;
}

.shop-wrapper * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.shop-mobile-feed {
  display: none;
}

/* ==========================================================================
   3. The Stage (Canvas & Interaction Area)
   ========================================================================== */
.shop-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  z-index: 1;
  touch-action: none;
}

.shop-stage:active {
  cursor: grabbing;
}

.shop-stage__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
}

/* ==========================================================================
   4. Grid Items (Cards)
   ========================================================================== */
.shop-card {
  position: absolute;
  width: var(--shop-item-width);
  height: var(--shop-item-height);
  background-color: transparent;
  will-change: transform;
  transform: translate(-50%, -50%);
  overflow: visible;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}

.shop-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition:
    transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    filter 0.5s ease;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}

.shop-card:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6)) brightness(1.1);
}

/* ==========================================================================
   5. UI Overlays
   ========================================================================== */
.shop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 10;
}

.shop-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.shop-card--expanded {
  position: absolute;
  z-index: 30;
  cursor: default;
  background-color: transparent;
  box-shadow: none;
  overflow: visible;
  border-radius: 0;
  will-change: transform, opacity;
}

.shop-card--expanded img {
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.6));
}

/* ==========================================================================
   6. Product Detail View
   ========================================================================== */
.shop-detail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.shop-detail__media {
  width: 100%;
  flex-shrink: 0;
  min-height: 55vh;
  pointer-events: none;
}

.shop-detail__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  padding-bottom: 100px;
  background: transparent;
  transform: translateY(0);
  justify-content: flex-start;
}

.shop-detail__info {
  max-width: 100%;
}

.shop-detail__title,
.shop-detail__price,
.shop-detail__desc,
.shop-btn {
  will-change: transform, opacity;
  opacity: 0;
}

.shop-detail__title {
  font-family: var(--shop-font-primary);
  font-size: 3.5rem;
  line-height: 0.9;
  margin-bottom: 0.5rem;
  color: var(--shop-text-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.shop-detail__price {
  font-family: var(--shop-font-primary);
  font-size: 2rem;
  color: var(--shop-accent-color);
  margin-bottom: 1.5rem;
}

.shop-detail__desc {
  font-family: var(--shop-font-body);
  font-size: 1.25rem;
  line-height: 1.5;
  color: #cccccc;
  margin-bottom: 2rem;
  max-width: 100%;
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.shop-btn {
  font-family: var(--shop-font-primary);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  background-color: transparent;
  color: var(--shop-text-color);
  border: 2px solid var(--shop-text-color);
  border-radius: 0;
  padding: 12px 24px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: auto;
  width: 100%;
  text-align: center;
}

.shop-btn:hover {
  background-color: var(--shop-text-color);
  color: var(--shop-bg-color);
}

.shop-btn--close {
  font-family: var(--shop-font-primary);
  font-size: 1.3125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: transparent;
  color: var(--shop-text-color);
  border: 2px solid var(--shop-text-color);
  padding: 13px 26px;
  transition: all 0.3s ease;

  position: absolute;
  top: auto;
  right: auto;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);

  z-index: 50;
  opacity: 0;
  pointer-events: none;
}

.shop-btn--close.active {
  opacity: 1;
  pointer-events: auto;
}

.shop-btn--close:hover {
  background-color: var(--shop-text-color);
  color: var(--shop-bg-color);
}

.shop-btn--index {
  font-family: var(--shop-font-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: absolute;
  top: auto;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: auto;
  font-size: 1.3125rem;
  padding: 13px 26px;
  background-color: var(--shop-text-color);
  color: var(--shop-bg-color);
  border: 2px solid var(--shop-text-color);
  border-radius: 0;
  transition: all 0.3s ease;
}

/* ==========================================================================
   8. Index (List View)
   ========================================================================== */
.shop-index {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding-top: 80px;
}

.shop-index.active {
  opacity: 1;
  pointer-events: auto;
}

.shop-index__list {
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: var(--shop-text-color) transparent;
}

.shop-index__list::-webkit-scrollbar {
  width: 4px;
}
.shop-index__list::-webkit-scrollbar-thumb {
  background-color: var(--shop-text-color);
  border-radius: 0;
}

.shop-index__item {
  display: block;
  font-family: var(--shop-font-primary);
  font-size: 3rem;
  color: #333;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition:
    color 0.3s,
    transform 0.3s;
  line-height: 1;
  background: none;
  border: none;
  width: 100%;
}

.shop-index__item:hover {
  color: var(--shop-text-color);
  transform: scale(1.05);
}

.shop-btn--index-close {
  margin-top: 30px;
  font-family: var(--shop-font-primary);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: transparent;
  color: var(--shop-text-color);
  border: 2px solid var(--shop-text-color);
  padding: 12px 24px;
}

.shop-btn--index-close:hover {
  background-color: var(--shop-text-color);
  color: var(--shop-bg-color);
}

/* ==========================================================================
   9. Media Queries (Desktop Tweaks)
   ========================================================================== */
@media (min-width: 1025px) {
  .shop-detail {
    flex-direction: row;
    overflow-y: hidden;
    align-items: center;
  }
  .shop-detail__media {
    height: 100%;
    flex: 1;
    background: none;
    pointer-events: none;
  }
  .shop-detail__content {
    padding: 60px;
    justify-content: center;
    background: none;
  }
  .shop-detail__info {
    max-width: 500px;
  }
  .shop-detail__title {
    font-size: 5rem;
  }
  .shop-detail__price {
    font-size: 2.5rem;
  }
  .shop-btn {
    width: auto;
    display: inline-block;
  }
  .shop-btn--close {
    bottom: 40px;
    top: auto;
    right: auto;
  }
  .shop-btn--index {
    bottom: 40px;
  }
  .shop-index__item {
    font-size: 4rem;
  }
}

/* ==========================================================================
   10. MOBILE & TABLET DOOMSCROLL MODE
   ========================================================================== */
@media (max-width: 1024px) {
  .shop-stage,
  .shop-btn--index,
  .shop-index,
  .shop-detail,
  .shop-btn--close {
    display: none !important;
  }

  .shop-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100dvh;
    -webkit-overflow-scrolling: touch;
    cursor: auto;
    background-color: #000;

    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .shop-mobile-feed {
    display: block;
    width: 100%;
    padding-top: calc(100px + env(safe-area-inset-top));
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .mobile-item {
    position: relative;
    width: 100%;
    min-height: 80dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #222;
    padding: 20px;
    background: #000;
    overflow: hidden;
    z-index: 1;
  }

  .mobile-item__kinetic {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    will-change: transform;
    min-height: 60dvh;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 4rem;
    padding-bottom: 2rem;
  }

  .mobile-item__img-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .mobile-item.is-open .mobile-item__img-wrap {
    flex: 0.6;
    transform: translateY(10%);
  }

  .mobile-item__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: all 0.5s ease;
  }

  .mobile-item__title {
    font-family: var(--shop-font-primary);
    font-size: 5rem;
    line-height: 0.85;

    color: transparent;
    -webkit-text-stroke: 1px var(--shop-text-color);
    mix-blend-mode: overlay;
    opacity: 0.6;

    text-transform: uppercase;
    text-align: center;
    position: absolute;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    z-index: 2;
    pointer-events: none;

    transition:
      top 0.5s cubic-bezier(0.25, 1, 0.5, 1),
      transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
      color 0.3s ease,
      opacity 0.3s ease,
      font-size 0.5s ease,
      mix-blend-mode 0.1s step-end;
  }

  .mobile-item.is-open .mobile-item__title {
    top: 0%;
    transform: translate(-50%, 0);

    color: var(--shop-text-color);
    opacity: 1;
    mix-blend-mode: normal;

    font-size: 4rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 1);

    transition:
      top 0.5s cubic-bezier(0.25, 1, 0.5, 1),
      transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
      color 0.3s ease,
      opacity 0.3s ease,
      font-size 0.5s ease,
      mix-blend-mode 0.1s step-start;
  }

  .mobile-item__price {
    font-family: var(--shop-font-primary);
    font-size: 2.5rem;
    color: var(--shop-accent-color);
    margin-bottom: 0;
    text-align: center;
    position: relative;
    z-index: 5;
  }

  .mobile-item__details {
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    z-index: 5;
  }

  .mobile-item__toggle-btn {
    background: transparent;
    border: 1px solid #333;
    color: #ffffff !important;

    font-family: var(--shop-font-body);
    font-size: 0.8rem;
    padding: 10px 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;

    opacity: 1;
  }

  .mobile-item__toggle-btn:active,
  .mobile-item__toggle-btn[aria-expanded="true"] {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
  }

  .mobile-item__content-hidden {
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: #111;
  }

  .mobile-item__content-inner {
    padding: 20px;
    border: 1px solid #333;
    border-top: none;
  }

  .mobile-item__desc {
    font-family: var(--shop-font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 20px;
    text-align: left;
  }

  .mobile-item__buy-btn {
    width: 100%;
    background: var(--shop-text-color);
    color: #000;
    border: none;
    padding: 15px;
    font-family: var(--shop-font-primary);
    font-size: 1.5rem;
    text-transform: uppercase;
    cursor: pointer;
  }
}

/* ==========================================================================
   11. TABLET SPECIFIC TYPOGRAPHY OVERRIDES (iPad Air & iPad Pro)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  .mobile-item__title {
    font-size: 5.5rem;
  }

  .mobile-item.is-open .mobile-item__title {
    font-size: 6.8rem;
  }

  .mobile-item__toggle-btn {
    font-size: 1.6rem;
  }

  .mobile-item__desc {
    font-size: 1.5rem;
    line-height: 1.65;
  }
}

/* ==========================================================================
   12. EDITORIAL SPLIT-SCREEN (Mid-Tier Landscape Devices)
   ========================================================================== */
.shop-wrapper.layout-split-screen .shop-stage,
.shop-wrapper.layout-split-screen .shop-overlay,
.shop-wrapper.layout-split-screen .shop-detail,
.shop-wrapper.layout-split-screen .shop-btn--index,
.shop-wrapper.layout-split-screen .shop-index,
.shop-wrapper.layout-split-screen .shop-btn--close,
.shop-wrapper.layout-split-screen .shop-mobile-feed {
  display: none !important;
}

.shop-wrapper.layout-split-screen {
  overflow: hidden !important;
  height: 100dvh !important;
  overscroll-behavior: none;
  position: relative;
}

.shop-split-screen {
  display: grid;
  grid-template-columns: 40% 60%;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: var(--shop-bg-color);
}

.shop-split-screen__left {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 40px 60px 40px;
  border-right: 1px solid rgba(255, 204, 0, 0.2);
  scrollbar-width: none;
}

.shop-split-screen__left::-webkit-scrollbar {
  display: none;
}

.shop-split-screen__left::before {
  content: "";
  display: block;
  position: sticky;
  top: 0;
  width: 100%;
  height: 130px;
  background-color: var(--shop-bg-color);
  border-bottom: 1px solid rgba(255, 204, 0, 0.3);
  margin-bottom: 2rem;
  z-index: 10;
}

.shop-split-screen__right {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  padding-bottom: clamp(60px, calc(60px + 10dvh), 140px);
  position: relative;
  min-height: 0;
}

.shop-split-screen__left .shop-index__item {
  font-family: var(--shop-font-primary) !important;
  color: var(--shop-text-color) !important;
  text-align: left;
  margin-bottom: 2rem;
  font-size: 3.5rem;
  display: block;
  width: 100%;
  opacity: 0.4;
  transform: translateX(0);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.shop-split-screen__left .shop-index__item.is-active {
  opacity: 1;
  transform: translateX(15px);
}

@media (hover: hover) and (pointer: fine) {
  .shop-split-screen__left .shop-index__item:hover {
    opacity: 1;
    transform: translateX(15px);
  }
}

.split-detail__media {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  min-height: 0;
}

.split-detail__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.split-detail__content {
  width: 100%;
  max-width: 450px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 40vh;
  min-height: 380px;
  flex-shrink: 0;
}

.split-detail__title {
  font-family: var(--shop-font-primary);
  font-size: 3rem;
  line-height: 0.9;
  margin-bottom: 0.5rem;
  color: var(--shop-text-color);
  text-transform: uppercase;
}

.split-detail__price {
  font-family: var(--shop-font-primary);
  font-size: 1.8rem;
  color: var(--shop-accent-color);
  margin-bottom: 1rem;
}

.split-detail__desc {
  font-family: var(--shop-font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: #cccccc;
  margin-bottom: 1rem;
}

.shop-split-screen__right .shop-btn {
  opacity: 1 !important;
  transform: none !important;
  margin-top: auto;
  margin-bottom: 0;
}
