/* ═══════════════════════════════════════════════════════════
   SINGLE PRODUCT V2 — English Puzzle
   Design tokens: Poppins, #583AF0, #D0EA43, #CD7EF9,
                   #EE4508, #EAE7E5, 2px borders, 25px radius
   ═══════════════════════════════════════════════════════════ */

/* ── LAYOUT CONTAINER ─────────────────────────────────────── */
.sp-v2 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
}

/* ── TOP: Gallery + Info (2-column) ───────────────────────── */
.sp-v2__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* ── GALLERY COLUMN ───────────────────────────────────────── */
.sp-v2__gallery {
  position: relative;
  min-width: 0;
}

/* Kill any inherited borders on gallery wrappers */
.sp-v2__gallery .woocommerce-product-gallery,
.sp-v2__gallery .woocommerce-product-gallery__wrapper,
.sp-v2__gallery .woocommerce-product-gallery__image,
.sp-v2__gallery .images {
  border: none !important;
  box-shadow: none !important;
}

/* Force gallery visible (WooCommerce starts at opacity:0) */
.sp-v2__gallery .woocommerce-product-gallery {
  opacity: 1 !important;
  position: relative;
  max-width: 100%;
}

/* flex-viewport is the clipping slide container — single border HERE */
.sp-v2__gallery .flex-viewport {
  border: 2px solid #000;
  border-radius: 25px;
  overflow: hidden !important;
  background: #fff;
  max-width: 100% !important;
  position: relative;
}

.sp-v2__gallery .woocommerce-product-gallery__image img,
.sp-v2__gallery .woocommerce-product-gallery__image a img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* ── GALLERY NAV ARROWS ───────────────────────────────────── */
.sp-v2__gallery .flex-direction-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-v2__gallery .flex-direction-nav li {
  position: static;
}

.sp-v2__gallery .flex-direction-nav a {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  transition: background 0.2s, transform 0.2s;
  text-indent: -9999px;
  font-size: 0;
  line-height: 0;
  margin: 0;
  padding: 0;
}

.sp-v2__gallery .flex-direction-nav a.flex-prev {
  left: 12px !important;
  right: auto !important;
}

.sp-v2__gallery .flex-direction-nav a.flex-next {
  right: 12px !important;
  left: auto !important;
}

.sp-v2__gallery .flex-direction-nav a::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid #000;
  border-bottom: 2.5px solid #000;
}

.sp-v2__gallery .flex-direction-nav a.flex-prev::after {
  transform: rotate(135deg);
  margin-left: 3px;
}

.sp-v2__gallery .flex-direction-nav a.flex-next::after {
  transform: rotate(-45deg);
  margin-right: 3px;
}

.sp-v2__gallery .flex-direction-nav a:hover {
  background: #D0EA43;
  transform: translateY(-50%) scale(1.08);
}

/* ── THUMBNAIL STRIP ──────────────────────────────────────── */
.sp-v2__gallery .flex-control-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 16px!important;
  padding: 0;
  list-style: none;
  justify-content: center;
}

.sp-v2__gallery .flex-control-thumbs li {
  flex: 0 0 auto;
  width: 72px;
  height: auto;
}

.sp-v2__gallery .flex-control-thumbs li img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 2px solid #ddd;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.sp-v2__gallery .flex-control-thumbs li img:hover,
.sp-v2__gallery .flex-control-thumbs li img.flex-active {
  border-color: #583AF0;
  /*transform: scale(1.06);*/
}

/* Sale flash on gallery */
.sp-v2__gallery .onsale {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 5;
  background: #EE4508;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 18px;
  border-radius: 50px;
  border: 2px solid #000;
  line-height: 1.3;
}

/* Zoom icon override */
.sp-v2__gallery .woocommerce-product-gallery__trigger {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  transition: background 0.2s, transform 0.2s;
}

.sp-v2__gallery .woocommerce-product-gallery__trigger::before {
  content: '+';
  font-size: 22px;
  font-weight: 700;
  color: #000;
  line-height: 1;
}

.sp-v2__gallery .woocommerce-product-gallery__trigger img {
  display: none !important;
}

.sp-v2__gallery .woocommerce-product-gallery__trigger:hover {
  background: #D0EA43;
  transform: scale(1.1);
}

/* ── INFO COLUMN ──────────────────────────────────────────── */
.sp-v2__info {
  padding-top: 8px;
}

/* Sale badge */
.sp-v2__badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 16px;
  border-radius: 50px;
  border: 2px solid #000;
  margin-bottom: 16px;
}

.sp-v2__badge--sale {
  background: #EE4508;
  color: #fff;
}

/* Category */
.sp-v2__category {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #583AF0;
  margin-bottom: 12px;
}

.sp-v2__category a {
  color: #583AF0;
  text-decoration: none;
}

.sp-v2__category a:hover {
  text-decoration: underline;
}

/* Title */
.sp-v2__title {
  font-family: 'Poppins', sans-serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  color: #000;
  margin: 0 0 20px 0;
  text-transform: uppercase;
}

/* Price */
.sp-v2__price {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid #eee;
}

.sp-v2__price .woocommerce-Price-amount,
.sp-v2__price .price {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #583AF0;
}

.sp-v2__price del {
  font-size: 18px;
  font-weight: 500;
  color: #999;
  text-decoration: line-through;
  margin-right: 8px;
}

.sp-v2__price del .woocommerce-Price-amount {
  font-size: 18px;
  font-weight: 500;
  color: #999;
}

.sp-v2__price ins {
  text-decoration: none;
}

.sp-v2__price ins .woocommerce-Price-amount {
  color: #EE4508;
  font-size: 32px;
}

/* ── ADD TO CART ──────────────────────────────────────────── */
.sp-v2__add-to-cart {
  margin-bottom: 28px;
}

/* Form layout */
.sp-v2__add-to-cart form.cart {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Quantity stepper wrapper */
.sp-v2-qty-stepper {
  display: flex;
  align-items: center;
  border: 2px solid #000;
  border-radius: 50px;
  overflow: hidden;
  background: #fff;
  height: 52px;
}

/* Stepper buttons */
.sp-v2-qty-btn {
  width: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #000;
  font-size: 0;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;
}

.sp-v2-qty-btn:hover {
  background: #D0EA43;
}

.sp-v2-qty-btn:active {
  background: #b8d030;
}

/* Quantity input */
.sp-v2-qty-input {
  width: 48px;
  height: 100%;
  text-align: center;
  border: none;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  background: #fff;
  -moz-appearance: textfield;
  padding: 0;
  outline: none;
}

.sp-v2-qty-input::-webkit-inner-spin-button,
.sp-v2-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to cart button */
.sp-v2-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 36px;
  background: #583AF0;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 2px solid #000;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}

.sp-v2-add-btn:hover {
  background: #4520d9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 58, 240, 0.3);
}

.sp-v2-add-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Out of stock */
.sp-v2__out-of-stock {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #EE4508;
  background: #fff;
  border: 2px solid #EE4508;
  border-radius: 50px;
  padding: 14px 28px;
  text-align: center;
}

/* WooCommerce message after add to cart */
.sp-v2 .woocommerce-message {
  background: #fff;
  border: 2px solid #000;
  border-radius: 25px;
  padding: 16px 24px;
  margin-bottom: 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-v2 .woocommerce-message::before {
  color: #D0EA43;
}

.sp-v2 .woocommerce-message a.button {
  background: #583AF0;
  color: #fff;
  border: 2px solid #000;
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s;
  margin-left: auto;
}

.sp-v2 .woocommerce-message a.button:hover {
  background: #4520d9;
}

/* ── TRUST BADGES ─────────────────────────────────────────── */
.sp-v2__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 2px solid #eee;
}

.sp-v2__trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50px;
  padding: 8px 18px;
}

.sp-v2__trust-item svg {
  flex-shrink: 0;
}

/* ── DESCRIPTION SECTION ──────────────────────────────────── */
.sp-v2__description-wrap {
  margin-top: 56px;
  display: flex;
  justify-content: center;
}

.sp-v2__description {
  max-width: 680px;
  width: 100%;
  background: #fff;
  border: 2px solid #000;
  border-radius: 25px;
  padding: 40px 48px;
}

.sp-v2__description-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 24px 0;
  padding-bottom: 16px;
  border-bottom: 3px solid #D0EA43;
  display: inline-block;
}

.sp-v2__description-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.sp-v2__description-content h2,
.sp-v2__description-content h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  color: #000;
  margin: 28px 0 12px;
}

.sp-v2__description-content h2 {
  font-size: 18px;
}

.sp-v2__description-content h3 {
  font-size: 16px;
}

.sp-v2__description-content p {
  margin: 0 0 16px 0;
}

.sp-v2__description-content strong {
  font-weight: 700;
  color: #000;
}

/* Styled bullet lists */
.sp-v2__description-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.sp-v2__description-content ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}

.sp-v2__description-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  background: #D0EA43;
  border: 2px solid #000;
  border-radius: 50%;
}

.sp-v2__description-content ol {
  padding-left: 24px;
  margin: 0 0 20px 0;
}

.sp-v2__description-content ol li {
  margin-bottom: 10px;
}

.woocommerce div.product div.images .flex-control-thumbs li {
  width: 19%!important;
}

.woocommerce-product-gallery::after, .woocommerce-product-gallery.woocommerce-product-gallery--with-images.woocommerce-product-gallery--columns-4.images::before {
  display: none!important;
}

.woocommerce-product-gallery::before, .woocommerce-product-gallery::after {
  display: none!important;
}

.sp-v2__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 24px;
  border-top: 2px solid #eee;
}

.sp-v2__tag {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50px;
  padding: 7px 18px;
  white-space: nowrap;
}

/* Emojis in descriptions (client uses them a lot) */
.sp-v2__description-content img.emoji,
.sp-v2__description-content img[alt*="✅"],
.sp-v2__description-content img[alt*="🧩"] {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
}

/* ── WooCommerce NOTICES (error, info) ────────────────────── */
.sp-v2 .woocommerce-error,
.sp-v2 .woocommerce-info {
  background: #fff;
  border: 2px solid #000;
  border-radius: 25px;
  padding: 16px 24px;
  margin-bottom: 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  list-style: none;
}

/* ── RELATED PRODUCTS (optional override) ─────────────────── */
.sp-v2 .related.products > h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  margin: 48px 0 28px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 960px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .sp-v2__top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .sp-v2__title {
    font-size: 28px;
  }

  .sp-v2__description {
    padding: 32px 36px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 680px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  .sp-v2 {
    padding: 20px 16px 48px;
  }

  .sp-v2__top {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* On mobile: gallery → title → price → add-to-cart → description
     All stacks naturally in single column, which matches the requirement */

  .sp-v2__info {
    padding-top: 0;
  }

  .sp-v2__badge {
    margin-bottom: 12px;
  }

  .sp-v2__title {
    font-size: 24px;
    margin-bottom: 14px;
  }

  /* Tags wrap */
  .sp-v2__tags {
    gap: 8px;
  }

  .sp-v2__tag {
    font-size: 12px;
    padding: 5px 14px;
  }

  .sp-v2__price .woocommerce-Price-amount,
  .sp-v2__price .price {
    font-size: 24px;
  }

  .sp-v2__price ins .woocommerce-Price-amount {
    font-size: 26px;
  }

  /* Stack quantity + button vertically on very small screens */
  .sp-v2__add-to-cart form.cart {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sp-v2__add-to-cart .sp-v2-qty-stepper {
    justify-content: center;
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
  }

  .sp-v2__add-to-cart .sp-v2-add-btn {
    width: 100%;
    padding: 0 24px;
  }

  /* Trust badges wrap */
  .sp-v2__trust {
    gap: 10px;
  }

  .sp-v2__trust-item {
    font-size: 12px;
    padding: 6px 14px;
  }

  /* Description */
  .sp-v2__description-wrap {
    margin-top: 36px;
  }

  .sp-v2__description {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .sp-v2__description-title {
    font-size: 18px;
  }

  .sp-v2__description-content {
    font-size: 14px;
  }

  /* Gallery thumbnails smaller */
  .sp-v2__gallery .flex-control-thumbs li {
    width: 56px;
    height: auto;
  }

  .sp-v2__gallery .flex-control-thumbs li img {
    border-radius: 10px;
  }
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes sp-v2-fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-v2__gallery {
  animation: sp-v2-fadeUp 0.5s ease-out both;
}

.sp-v2__info {
  animation: sp-v2-fadeUp 0.5s ease-out 0.15s both;
}

.sp-v2__description-wrap {
  animation: sp-v2-fadeUp 0.5s ease-out 0.3s both;
}

/* Hover lift on gallery */
.sp-v2__gallery .flex-viewport:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s;
}