/**
 * Single Product Showcase Widget Styles
 *
 * @package InLightStudios
 * @since   1.0.0
 */

/* ============================================================
   Container & Layout
   ============================================================ */

.ils-sps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  width: 100%;
  align-items: start;
  position: relative;
}

.ils-sps__gallery {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0; /* prevent grid blowout */
}

.ils-sps__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   Main Image
   ============================================================ */

.ils-sps__main-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #ffffff;
  border-radius: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ils-sps__main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
}

.ils-sps__main-img.ils-loading {
  opacity: 0.35;
}

/* ============================================================
   Thumbnails
   ============================================================ */

.ils-sps__thumbs-container {
  position: relative;
  padding: 0 44px; /* space for arrows */
}

/* Swiper override: prevent overflow on the container */
.ils-sps__thumbs-swiper {
  overflow: hidden;
  width: 100%;
}

/* Each slide is a fixed square */
.ils-sps__thumbs-swiper .swiper-wrapper {
  display: flex;
  align-items: center;
}

.ils-sps__thumbs-swiper .swiper-slide {
  width: 76px !important;
  height: 76px !important;
  flex-shrink: 0;
}

/* Thumbnail button */
.ils-sps__thumb {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 2px solid transparent;
  background: #ffffff;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
  opacity: 0.55;
  overflow: hidden;
}

.ils-sps__thumb:hover {
  opacity: 1;
}

.ils-sps__thumb.is-active {
  opacity: 1;
  border-color: #111827;
}

.ils-sps__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Thumb navigation arrows */
.ils-sps__thumb-prev,
.ils-sps__thumb-next {
  padding: 10px !important;
  position: absolute;
  top: 50%;
  transform: translateY(0%);
  width: 12px !important;
  height: 12px !important;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d1d5db;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  /* reset Swiper default pseudo-element sizing */
}

.ils-sps__thumb-prev::after,
.ils-sps__thumb-next::after {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #111827;
}

.ils-sps__thumb-prev:hover,
.ils-sps__thumb-next:hover {
  background: #ffffff;
  border-color: #111827;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.ils-sps__thumb-prev.swiper-button-disabled,
.ils-sps__thumb-next.swiper-button-disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.ils-sps__thumb-prev {
  left: 0;
}

.ils-sps__thumb-next {
  right: 0;
}

/* ============================================================
   Brand
   ============================================================ */

.ils-sps__brand {
  display: inline-block;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
  width: fit-content;
}

/* ============================================================
   Title
   ============================================================ */

.ils-sps__title {
  font-size: 32px;
  font-weight: 400;
  color: #111827;
  line-height: 1.25;
  margin: 0 0 24px 0;
  letter-spacing: -0.3px;
}

/* ============================================================
   Actions row  —  Quantity + Button side by side
   ============================================================ */

.ils-sps__actions {
  display: flex;
  align-items: stretch;
  gap: 20px !important;
  margin-bottom: 24px;
  width: 100%;
}

/* ── Quantity ─────────────────────────────────────────────── */

.ils-sps__quantity {
  display: flex;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 4px 0 0 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.ils-sps__qty-btn {
  width: 44px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: #6b7280;
  border: none;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  line-height: 1;
  user-select: none;
}

.ils-sps__qty-minus {
  border-right: 1px solid #e5e7eb;
}

.ils-sps__qty-plus {
  border-left: 1px solid #e5e7eb;
}

.ils-sps__qty-btn:hover {
  background-color: #f9fafb;
  color: #111827;
}

.ils-sps__qty-input {
  width: 56px;
  height: 50px;
  text-align: center;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  background-color: #ffffff;
  -moz-appearance: textfield;
  border: none !important;
}

.ils-sps__qty-input::-webkit-outer-spin-button,
.ils-sps__qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ils-sps__qty-input:focus {
  outline: none;
}

/* ── Button ───────────────────────────────────────────────── */

.ils-sps__button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 32px;
  background-color: #dc2626;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  border: none;
  /* Join flush to qty selector */
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
}

.ils-sps__button:hover {
  background-color: #b91c1c;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.ils-sps__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Categories & Tags
   ============================================================ */

.ils-sps__categories,
.ils-sps__tags {
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 4px;
}

.ils-sps__meta-label {
  color: #111827;
  font-weight: 600;
}

.ils-sps__category-link,
.ils-sps__tag-link {
  color: #dc2626;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}

.ils-sps__category-link:hover,
.ils-sps__tag-link:hover {
  color: #b91c1c;
}

/* ============================================================
   Description
   ============================================================ */

.ils-sps__description {
  font-size: 14px;
  line-height: 1.85;
  color: #4b5563;
  margin-top: 14px;
  margin-bottom: 20px;
}

.ils-sps__description p {
  margin: 0 0 10px 0;
}

.ils-sps__description p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Bullet points
   ============================================================ */

.ils-sps__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ils-sps__bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.ils-sps__bullet-icon {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background-color: #dc2626;
  border-radius: 50%;
  margin-top: 6px;
}

.ils-sps__bullet-text {
  flex: 1;
}

/* ============================================================
   Quick Add-ons
   ============================================================ */

.ils-sps__addons {
  margin-top: 4px;
}

.ils-sps__addons-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
  text-transform: none;
  letter-spacing: 0;
}

.ils-sps__addons-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

.ils-sps__addon-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Custom checkbox */
.ils-sps__addon-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  accent-color: #dc2626;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
  position: relative;
}

.ils-sps__addon-checkbox:hover {
  border-color: #9ca3af;
}

.ils-sps__addon-checkbox:checked {
  background-color: #dc2626;
  border-color: #dc2626;
}

.ils-sps__addon-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ils-sps__addon-checkbox:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.ils-sps__addon-label {
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
  font-weight: 400;
}

/* ============================================================
   Product Options
   ============================================================ */

.ils-sps__options {
  margin-top: 4px;
  margin-bottom: 20px;
}

.ils-sps__options-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
  text-transform: none;
  letter-spacing: 0;
}

.ils-sps__options-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

.ils-sps__option-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ils-sps__option-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #ffffff !important;
  accent-color: #dc2626 !important;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
  position: relative;
}

.ils-sps__option-checkbox:hover {
  border-color: #9ca3af;
}

.ils-sps__option-checkbox:checked {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  accent-color: #dc2626 !important;
}

.ils-sps__option-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ils-sps__option-checkbox:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.ils-sps__option-label {
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
  font-weight: 400;
}

/* ============================================================
   Specifications
   ============================================================ */

.ils-sps__specifications {
  margin-bottom: 24px;
}

.ils-sps__specifications .ils-sps__section-title,
.ils-sps__additional-info .ils-sps__section-title,
.ils-sps__hired-together .ils-sps__section-title,
.ils-sps__related-products .ils-sps__section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.ils-sps__specifications-content,
.ils-sps__additional-info-content {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

/* ============================================================
   Additional Information
   ============================================================ */

.ils-sps__additional-info {
  margin-bottom: 24px;
}

/* ============================================================
   Product Detail Section
   ============================================================ */

.ils-sps__product-detail {
  margin-bottom: 24px;
}

.ils-sps__detail-image {
  margin-bottom: 12px;
}

.ils-sps__detail-image img {
  max-width: 200px;
  border-radius: 4px;
}

.ils-sps__detail-heading {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.ils-sps__detail-description {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  margin: 0 0 0 0;
}

/* ============================================================
   Frequently Hired Together
   ============================================================ */

.ils-sps__hired-together {
  margin-bottom: 24px;
}

.ils-sps__hired-together-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ils-sps__hired-item {
  display: flex;
  align-items: center;
}

.ils-sps__hired-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.ils-sps__hired-link:hover {
  opacity: 0.8;
}

.ils-sps__hired-image {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}

.ils-sps__hired-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ils-sps__hired-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ils-sps__hired-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.ils-sps__hired-price {
  font-size: 13px;
  color: #6b7280;
}

/* ============================================================
   Related Products
   ============================================================ */

.ils-sps__related-products {
  margin-bottom: 24px;
}

.ils-sps__related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ils-sps__related-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.ils-sps__related-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ils-sps__related-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ils-sps__related-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.ils-sps__related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ils-sps__related-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ils-sps__related-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  line-height: 1.3;
}

.ils-sps__related-price {
  font-size: 13px;
  color: #6b7280;
}

/* ============================================================
   Interactive Gallery Cards (full-width)
   ============================================================ */

.ils-sps__interactive-gallery {
  grid-column: 1 / -1;
  margin-bottom: 32px;
  min-width: 0;
  overflow: hidden;
}

.ils-sps__interactive-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  min-width: 0;
}

.ils-sps__gallery-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #f9fafb;
  min-width: 0;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

a.ils-sps__gallery-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.ils-sps__gallery-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ils-sps__gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

a.ils-sps__gallery-card:hover .ils-sps__gallery-card-image img {
  transform: scale(1.05);
}

.ils-sps__gallery-card-heading {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* ============================================================
   FAQs
   ============================================================ */

.ils-sps__faqs {
  grid-column: 1 / -1;
  margin-bottom: 32px;
}

.ils-sps__faqs-heading {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 20px 0;
}

.ils-sps__faqs-list {
  display: flex;
  flex-direction: column;
}

.ils-sps__faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.ils-sps__faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  transition: color 0.2s;
}

.ils-sps__faq-question:hover {
  color: #dc2626;
}

.ils-sps__faq-toggle {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
  margin-left: 16px;
}

.ils-sps__faq-toggle::before,
.ils-sps__faq-toggle::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.2s;
}

.ils-sps__faq-toggle::before {
  width: 14px;
  height: 2px;
  top: 9px;
  left: 3px;
}

.ils-sps__faq-toggle::after {
  width: 2px;
  height: 14px;
  top: 3px;
  left: 9px;
}

.ils-sps__faq-question[aria-expanded="true"] .ils-sps__faq-toggle::after {
  transform: rotate(90deg);
}

.ils-sps__faq-answer {
  display: none;
  padding: 0 0 16px 0;
}

.ils-sps__faq-answer.is-open {
  display: block;
}

.ils-sps__faq-answer-text {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

/* ============================================================
   Placeholder (editor only)
   ============================================================ */

.ils-sps__placeholder {
  padding: 48px 32px;
  text-align: center;
  background-color: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #6b7280;
}

.ils-sps__placeholder p {
  margin: 0;
  font-size: 14px;
}

/* ============================================================
   Screen reader only
   ============================================================ */

.ils-sps__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   Focus states
   ============================================================ */

.ils-sps__thumb:focus-visible,
.ils-sps__qty-btn:focus-visible,
.ils-sps__button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.ils-sps__qty-input:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .ils-sps {
    gap: 40px;
  }

  .ils-sps__title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .ils-sps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ils-sps__title {
    font-size: 24px;
    margin-bottom: 18px;
  }

  .ils-sps__addons-list {
    grid-template-columns: 1fr;
  }

  .ils-sps__thumbs-container {
    padding: 0 38px;
  }

  .ils-sps__thumbs-swiper .swiper-slide {
    width: 68px !important;
    height: 68px !important;
  }

  .ils-sps__interactive-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
  }

  .ils-sps__related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ils-sps__title {
    font-size: 22px;
  }

  .ils-sps__thumbs-swiper .swiper-slide {
    width: 58px !important;
    height: 58px !important;
  }

  .ils-sps__qty-btn {
    width: 38px;
    height: 46px;
  }

  .ils-sps__qty-input {
    width: 48px;
    height: 46px;
  }

  .ils-sps__button {
    height: 46px;
    font-size: 14px;
    padding: 0 20px;
  }

  .ils-sps__interactive-gallery-grid {
    grid-template-columns: 1fr;
  }

  .ils-sps__thumb-prev,
  .ils-sps__thumb-next {
    width: 28px;
    height: 28px;
  }
}

@media print {
  .ils-sps__thumbs-container,
  .ils-sps__actions,
  .ils-sps__addons {
    display: none;
  }

  .ils-sps {
    grid-template-columns: 1fr;
  }
}
