/* ============================================
   Product Popup — Motion-Based Design
   Loaded AFTER style.min.css
   ============================================ */

/* Prevent any hover-based popup activation */
.product-item:hover .product-popup,
.product-item:active .product-popup,
.product-item:focus .product-popup,
.product-item:focus-within .product-popup {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.product-item:hover::after {
  display: none !important;
}

/* ---- Overlay with motion ---- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: 
    backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-overlay-enter {
  backdrop-filter: blur(0);
  background: rgba(0, 0, 0, 0);
}

.popup-overlay-visible {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.5);
}

.popup-overlay-exit {
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  background: rgba(0, 0, 0, 0);
  transition: 
    backdrop-filter 0.25s cubic-bezier(0.4, 0, 1, 1),
    background 0.25s cubic-bezier(0.4, 0, 1, 1);
}

/* ---- Popup modal ---- */
.product-popup {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  transform: translate(-50%, -50%) scale(0.85) translateY(20px) !important;
  width: 98vw;
  max-width: 1400px;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 28px 24px;
  border-radius: 0 !important;
  background: #f5f5f5 !important;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 100px rgba(40, 75, 99, 0.1) !important;
  z-index: 1001 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  -webkit-overflow-scrolling: touch;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s step-end,
    box-shadow 0.4s ease !important;
}

/* Active state — spring-in motion */
.product-popup.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, -50%) scale(1) translateY(0) !important;
  pointer-events: auto !important;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 120px rgba(40, 75, 99, 0.12) !important;
}

/* Exit animation */
.product-popup.popup-exit {
  transform: translate(-50%, -50%) scale(0.92) translateY(15px) !important;
  opacity: 0 !important;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 1, 1),
    opacity 0.2s ease !important;
}

/* ---- Close button ---- */
.popup-close-btn {
  position: absolute !important;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.05) !important;
  border: none !important;
  font-size: 24px;
  line-height: 1;
  color: #2d2d2d !important;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s;
}

.popup-close-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #2d2d2d !important;
  transform: scale(1.08);
}

.popup-close-btn:active {
  transform: scale(0.96);
}

/* ---- Popup heading ---- */
.product-popup h4 {
  margin: 0 0 24px !important;
  padding: 0 48px 14px 0 !important;
  color: #284b63 !important;
  font-family: "Caviar Dreams", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 2px solid #d9d9d9 !important;
  font-weight: 700;
}

/* ============================================
   Scissors List — Card Grid with Stagger
   ============================================ */

.scissors-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
  max-width: none !important;
  list-style-position: outside !important;
}

.scissors-list li {
  padding: 0 !important;
  margin: 0 !important;
  border-bottom: none !important;
  display: block !important;
  list-style-type: none !important;
  position: static !important;
  animation: scissorsCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.product-popup.active .scissors-list li:nth-child(1) { animation-delay: 0.04s; }
.product-popup.active .scissors-list li:nth-child(2) { animation-delay: 0.06s; }
.product-popup.active .scissors-list li:nth-child(3) { animation-delay: 0.08s; }
.product-popup.active .scissors-list li:nth-child(4) { animation-delay: 0.1s; }
.product-popup.active .scissors-list li:nth-child(5) { animation-delay: 0.12s; }
.product-popup.active .scissors-list li:nth-child(6) { animation-delay: 0.14s; }
.product-popup.active .scissors-list li:nth-child(7) { animation-delay: 0.16s; }
.product-popup.active .scissors-list li:nth-child(8) { animation-delay: 0.18s; }
.product-popup.active .scissors-list li:nth-child(9) { animation-delay: 0.2s; }
.product-popup.active .scissors-list li:nth-child(10) { animation-delay: 0.22s; }
.product-popup.active .scissors-list li:nth-child(11) { animation-delay: 0.24s; }
.product-popup.active .scissors-list li:nth-child(12) { animation-delay: 0.26s; }

@keyframes scissorsCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scissors-list li::before {
  display: none !important;
  content: none !important;
}

.scissors-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: auto !important;
  background: #f5f5f5;
  border-radius: 0;
  overflow: hidden;
  transition: 
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease;
  cursor: default;
  will-change: transform;
}

.scissors-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.scissors-list li > div {
  height: auto !important;
  min-height: auto !important;
}

.scissors-list img,
.scissors-card img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center !important;
  background: #f5f5f5 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  flex: none !important;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scissors-card:hover img {
  transform: scale(1.08);
}

.scissors-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.scissors-list .scissors-name,
.scissors-card .scissors-name {
  font-weight: 700 !important;
  color: #2d2d2d !important;
  font-size: 0.95rem !important;
  margin-bottom: 0 !important;
  text-align: left !important;
  width: auto !important;
  flex: none !important;
  line-height: 1.3;
}

.scissors-list .scissors-details,
.scissors-card .scissors-details {
  font-size: 0.82rem !important;
  color: #2d2d2d !important;
  margin-top: 0 !important;
  padding: 0 !important;
  line-height: 1.45;
  flex: none !important;
  width: auto !important;
}

/* ============================================
   CTA Button in Popup
   ============================================ */

.popup-cta {
  margin-top: 24px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #d9d9d9;
  animation: scissorsCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.product-popup.active .popup-cta {
  animation: scissorsCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.32s backwards;
}

.popup-cta .product-link {
  display: inline-block;
  background: #284b63;
  color: #fff !important;
  padding: 12px 32px;
  border-radius: 0 8px 0 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  transition: 
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(40, 75, 99, 0.35);
}

.popup-cta .product-link:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(40, 75, 99, 0.45);
}

.popup-cta .product-link:active {
  transform: translateY(-1px);
}

.popup-cta .product-link::after {
  content: none !important;
}

/* ============================================
   Responsive — Tablet
   ============================================ */

@media (max-width: 768px) {
  .product-popup {
    width: 98vw;
    max-width: none;
    padding: 28px 22px 22px;
    max-height: 96vh;
    border-radius: 0 !important;
  }

  .scissors-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .scissors-list img,
  .scissors-card img {
    object-fit: cover !important;
  }

  .scissors-card-body {
    padding: 12px 14px 14px;
  }

  .scissors-list .scissors-name,
  .scissors-card .scissors-name {
    font-size: 0.86rem !important;
  }

  .scissors-list .scissors-details,
  .scissors-card .scissors-details {
    font-size: 0.78rem !important;
  }

  .popup-close-btn {
    width: 44px;
    height: 44px;
    font-size: 26px;
    top: 12px;
    right: 12px;
  }
}

/* ============================================
   Responsive — Small Mobile
   ============================================ */

@media (max-width: 420px) {
  .product-popup {
    width: 98vw;
    padding: 24px 16px 20px;
    max-height: 96vh;
    border-radius: 0 !important;
  }

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

  .scissors-list li {
    display: block !important;
  }

  .scissors-card {
    flex-direction: column !important;
    border-radius: 0;
    align-items: stretch;
  }

  .scissors-list img,
  .scissors-card img {
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    min-height: 0;
    border-radius: 0 !important;
    object-fit: cover !important;
    background: #f5f5f5 !important;
  }

  .scissors-card-body {
    padding: 12px 14px;
    justify-content: center;
  }

  .scissors-list .scissors-name,
  .scissors-card .scissors-name {
    font-size: 0.88rem !important;
  }

  .scissors-list .scissors-details,
  .scissors-card .scissors-details {
    font-size: 0.76rem !important;
  }

  .popup-cta .product-link {
    padding: 11px 26px;
    font-size: 0.84rem;
  }
}

/* ============================================
   Scrollbar
   ============================================ */

.product-popup::-webkit-scrollbar {
  width: 6px;
}

.product-popup::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.product-popup::-webkit-scrollbar-thumb {
  background: rgba(40, 75, 99, 0.25);
  border-radius: 0;
}

.product-popup::-webkit-scrollbar-thumb:hover {
  background: rgba(40, 75, 99, 0.4);
}
