/* ============================================================================
   NV PRODUCT WIDGETS - Nordic Precision Theme
   Lightweight Elementor widgets for WooCommerce product pages
   v1.1.0
   ============================================================================ */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Manrope:wght@400;500;700&family=Space+Grotesk:wght@700;800&display=swap');

/* ============================================================================
   PRODUCT GALLERY
   ============================================================================ */

.nv-pw-gallery {
  width: 100%;
}

.nv-pw-gallery--thumbs-left {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
}

.nv-pw-gallery--thumbs-left .nv-pw-gallery__thumbs {
  order: -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.nv-pw-gallery__main {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #FFFFFF;
}

.nv-pw-gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nv-pw-gallery__track::-webkit-scrollbar {
  display: none;
}

.nv-pw-gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.nv-pw-gallery__slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

/* --- Gallery dots — hard reset to prevent theme/Elementor button overrides --- */
.nv-pw-gallery__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
}

button.nv-pw-gallery__dot,
.nv-pw-gallery__dots .nv-pw-gallery__dot,
.nv-pw-gallery .nv-pw-gallery__dot,
.elementor-widget-nv-product-gallery .nv-pw-gallery__dot {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  min-height: 10px !important;
  max-width: 10px !important;
  max-height: 10px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #D4D4D0 !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  box-shadow: none !important;
  outline: none;
  transition: background 0.2s ease;
  display: inline-block !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  text-indent: -9999px;
  overflow: hidden;
}

button.nv-pw-gallery__dot.is-active,
.nv-pw-gallery__dots .nv-pw-gallery__dot.is-active,
.nv-pw-gallery .nv-pw-gallery__dot.is-active,
.elementor-widget-nv-product-gallery .nv-pw-gallery__dot.is-active {
  background: #111318 !important;
}

button.nv-pw-gallery__dot:hover,
.nv-pw-gallery__dots .nv-pw-gallery__dot:hover {
  background: #6a747f !important;
}

/* --- Gallery thumbnails — hard reset to prevent teal/theme overrides --- */
button.nv-pw-gallery__thumb,
.nv-pw-gallery__thumbs .nv-pw-gallery__thumb,
.nv-pw-gallery .nv-pw-gallery__thumb,
.elementor-widget-nv-product-gallery .nv-pw-gallery__thumb {
  flex: 0 0 auto;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  border: 2px solid #E6E8EC !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  background: #FFFFFF !important;
  transition: border-color 0.2s ease;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  line-height: 0 !important;
  font-size: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

button.nv-pw-gallery__thumb.is-active,
.nv-pw-gallery .nv-pw-gallery__thumb.is-active {
  border-color: #0f766e !important;
}

button.nv-pw-gallery__thumb:hover,
.nv-pw-gallery .nv-pw-gallery__thumb:hover {
  border-color: #0b5e58 !important;
}

button.nv-pw-gallery__thumb img,
.nv-pw-gallery__thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.nv-pw-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nv-pw-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

/* ============================================================================
   PRODUCT TITLE
   ============================================================================ */

.nv-pw-product-title {
  font-family: 'Sora', -apple-system, sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  color: #111318;
  margin: 6px 0 10px;
  word-break: break-word;
}

/* ============================================================================
   PRODUCT PRICE
   ============================================================================ */

.nv-pw-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 8px 0 14px;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

.nv-pw-price ins {
  text-decoration: none;
  font-size: clamp(30px, 3.8vw, 52px);
  font-weight: 800;
  line-height: 1;
  color: #111318;
}

.nv-pw-price del {
  color: #6a747f;
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 700;
  text-decoration-thickness: 3px;
}

.nv-pw-price .amount {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

/* ============================================================================
   ADD TO CART
   ============================================================================ */

.nv-pw-add-to-cart .single_add_to_cart_button {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: none;
  background: #0f766e !important;
  color: #FFFFFF !important;
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 12px 20px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nv-pw-add-to-cart .single_add_to_cart_button:hover {
  background: #0b5e58 !important;
}

.nv-pw-add-to-cart .single_add_to_cart_button:active {
  transform: scale(0.98);
}

.nv-pw-add-to-cart .variations {
  margin-bottom: 16px;
}

.nv-pw-add-to-cart .variations label {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #111318;
  display: block;
  margin-bottom: 8px;
}

.nv-pw-add-to-cart select {
  border-radius: 10px;
  border: 1px solid #E6E8EC;
  padding: 10px 12px;
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 14px;
  color: #111318;
  background: #FFFFFF;
  width: 100%;
  margin-bottom: 12px;
}

.nv-pw-add-to-cart select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.nv-pw-add-to-cart .quantity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.nv-pw-add-to-cart .quantity label {
  margin-bottom: 0;
  margin-right: 8px;
}

.nv-pw-add-to-cart .quantity input {
  border-radius: 10px;
  border: 1px solid #E6E8EC;
  padding: 8px 12px;
  width: 70px;
  font-family: 'Manrope', -apple-system, sans-serif;
  text-align: center;
}

.nv-pw-add-to-cart .quantity input:focus {
  outline: none;
  border-color: #0f766e;
}

/* ============================================================================
   FAQ ACCORDION
   ============================================================================ */

.nv-pw-faq {
  width: 100%;
}

.nv-pw-faq__title {
  font-family: 'Sora', -apple-system, sans-serif;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  color: #111318;
  margin: 0 0 16px;
}

.nv-pw-faq__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nv-pw-faq__item {
  border: 1px solid #E6E8EC;
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.nv-pw-faq__item[open] {
  box-shadow: 0 2px 8px rgba(17, 19, 24, 0.06);
}

.nv-pw-faq__question {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #111318;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.2s ease;
}

.nv-pw-faq__question:hover {
  background: #F8F7F3;
}

.nv-pw-faq__question::-webkit-details-marker {
  display: none;
}

.nv-pw-faq__question::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: #5F6874;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

details[open] .nv-pw-faq__question::after {
  content: '−';
  color: #0f766e;
}

.nv-pw-faq__answer {
  padding: 0 20px 16px;
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #5F6874;
  background: #FFFFFF;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nv-pw-faq__answer a {
  color: #0f766e;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nv-pw-faq__answer a:hover {
  color: #0b5e58;
  text-decoration: underline;
}

/* ============================================================================
   ELEMENTOR EDITOR PLACEHOLDER
   ============================================================================ */

.nv-pw-editor-placeholder {
  border: 2px dashed #E6E8EC;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  background: #FAFAF8;
}

.nv-pw-editor-placeholder__icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
  opacity: 0.5;
}

.nv-pw-editor-placeholder__title {
  font-family: 'Sora', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111318;
  margin: 0 0 4px;
}

.nv-pw-editor-placeholder__desc {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 13px;
  color: #5F6874;
  margin: 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 680px) {
  .nv-pw-gallery--thumbs-left {
    display: block;
  }

  .nv-pw-gallery--thumbs-left .nv-pw-gallery__thumbs {
    flex-direction: row;
    order: 0;
    max-height: none;
  }

  /* CRITICAL: Hide thumbnails on mobile — show dots only */
  .nv-pw-gallery__thumbs {
    display: none !important;
  }

  .nv-pw-product-title {
    font-size: 26px;
  }

  .nv-pw-price {
    margin: 6px 0 12px;
  }

  .nv-pw-price ins {
    font-size: 28px;
  }

  .nv-pw-price del {
    font-size: 18px;
  }

  .nv-pw-add-to-cart .single_add_to_cart_button {
    min-height: 48px;
    font-size: 16px;
  }

  .nv-pw-faq__title {
    font-size: 24px;
  }

  .nv-pw-faq__question {
    padding: 14px 16px;
    font-size: 15px;
  }

  .nv-pw-faq__answer {
    padding: 0 16px 14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .nv-pw-gallery__dots {
    padding: 10px 0 2px;
    gap: 6px;
  }

  button.nv-pw-gallery__dot,
  .nv-pw-gallery__dots .nv-pw-gallery__dot,
  .elementor-widget-nv-product-gallery .nv-pw-gallery__dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
  }

  .nv-pw-product-title {
    font-size: 22px;
    margin: 4px 0 8px;
  }

  .nv-pw-price {
    margin: 4px 0 10px;
  }

  .nv-pw-price ins {
    font-size: 24px;
  }

  .nv-pw-price del {
    font-size: 16px;
  }

  .nv-pw-add-to-cart .single_add_to_cart_button {
    min-height: 44px;
    font-size: 15px;
  }

  .nv-pw-faq__question {
    padding: 12px 14px;
    font-size: 14px;
  }

  .nv-pw-faq__answer {
    padding: 0 14px 12px;
    font-size: 13px;
  }

  .nv-pw-faq__question::after {
    font-size: 18px;
    margin-left: 10px;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.nv-pw-add-to-cart {
  width: 100%;
}

/* Ensure all widgets respect container width */
.elementor-widget-nv-product-gallery,
.elementor-widget-nv-product-title,
.elementor-widget-nv-product-price,
.elementor-widget-nv-add-to-cart,
.elementor-widget-nv-faq {
  width: 100%;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.nv-pw-gallery__dot:focus,
.nv-pw-gallery__thumb:focus,
.nv-pw-faq__question:focus,
.nv-pw-add-to-cart .single_add_to_cart_button:focus {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .nv-pw-gallery__dot,
  .nv-pw-gallery__thumb,
  .nv-pw-add-to-cart .single_add_to_cart_button,
  .nv-pw-faq__question,
  .nv-pw-faq__answer {
    transition: none !important;
    animation: none !important;
  }
}
