/**
 * Quick View Frontend Styles
 * 
 * @package WC_Builder_Divi_Premium
 * @subpackage Quick_View
 * @since 5.1.0
 */

/* Quick View Wrapper */
.wcbd-quick-view-wrapper {
  position: relative;
  display: block;
}

/* Quick View Button */
.wcbd-qv-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--wcbd-qv-btn-bg, rgb(40, 153, 148));
  color: var(--wcbd-qv-btn-text, #ffffff);
  border: none;
  border-radius: var(--wcbd-qv-btn-radius, 100px);
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wcbd-quick-view-wrapper:hover .wcbd-qv-btn {
  opacity: 1;
}

.wcbd-qv-btn:hover {
  background: var(--wcbd-qv-btn-bg-hover, rgb(36, 172, 143));
  color: var(--wcbd-qv-btn-text-hover, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wcbd-qv-btn .wcbd-qv-icon {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) no-repeat center;
  mask: var(--icon-url) no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.wcbd-qv-btn .wcbd-qv-text {
  font-size: 14px;
  font-weight: 500;
}

/* Position Variants */
.wcbd-qv-position-top-left {
  top: var(--wcbd-qv-offset-y, 10px);
  left: var(--wcbd-qv-offset-x, 10px);
}

.wcbd-qv-position-top-right {
  top: var(--wcbd-qv-offset-y, 10px);
  right: var(--wcbd-qv-offset-x, 10px);
}

.wcbd-qv-position-bottom-left {
  bottom: var(--wcbd-qv-offset-y, 10px);
  left: var(--wcbd-qv-offset-x, 10px);
}

.wcbd-qv-position-bottom-right {
  bottom: var(--wcbd-qv-offset-y, 10px);
  right: var(--wcbd-qv-offset-x, 10px);
}

/* Missing Positions */
.wcbd-qv-position-top-center {
  top: var(--wcbd-qv-offset-y, 10px);
  left: 50%;
  transform: translateX(-50%);
}

.wcbd-qv-position-top-center:hover {
  transform: translate(-50%, -2px);
}

.wcbd-qv-position-bottom-center {
  bottom: var(--wcbd-qv-offset-y, 10px);
  left: 50%;
  transform: translateX(-50%);
}

.wcbd-qv-position-bottom-center:hover {
  transform: translate(-50%, -2px);
}

.wcbd-qv-position-center-left {
  top: 50%;
  left: var(--wcbd-qv-offset-x, 10px);
  transform: translateY(-50%);
}

.wcbd-qv-position-center-left:hover {
  transform: translateY(calc(-50% - 2px));
}

.wcbd-qv-position-center-right {
  top: 50%;
  right: var(--wcbd-qv-offset-x, 10px);
  transform: translateY(-50%);
}

.wcbd-qv-position-center-right:hover {
  transform: translateY(calc(-50% - 2px));
}

.wcbd-qv-position-center-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.wcbd-quick-view-wrapper:hover .wcbd-qv-position-center-center {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.wcbd-qv-position-center-center:hover {
  transform: translate(-50%, calc(-50% - 2px)) !important;
}

/* Modal */
.wcbd-qv-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

.wcbd-qv-modal.active {
  display: flex;
}

.wcbd-qv-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  animation: wcbdFadeIn 0.3s ease;
}

.wcbd-qv-container {
  position: relative;
  width: 90%;
  max-width: var(--wcbd-qv-modal-width, 80vw);
  max-height: var(--wcbd-qv-modal-height, 80vh);
  background: var(--wcbd-qv-modal-bg, #ffffff);
  border-radius: 8px;
  animation: wcbdSlideIn 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wcbd-qv-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.wcbd-qv-close svg {
  stroke: var(--wcbd-qv-close-color, #bcbcbc);
  transition: stroke 0.2s ease;
}

.wcbd-qv-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wcbd-qv-close:hover svg {
  stroke: var(--wcbd-qv-close-hover, rgba(0, 0, 0, 0.9));
}

.wcbd-qv-content {
  flex: 1;
  overflow: auto;
  padding: 40px 60px 40px 40px;
}

/* Loading State */
.wcbd-qv-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

.wcbd-qv-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--wcbd-qv-btn-bg, rgb(40, 153, 148));
  border-radius: 50%;
  animation: wcbdSpin 0.8s linear infinite;
}

.wcbd-qv-product-wrapper {
  display: none;
}

.wcbd-qv-modal.loaded .wcbd-qv-loading {
  display: none;
}

.wcbd-qv-modal.loaded .wcbd-qv-product-wrapper {
  display: block;
}

/* Product Content */
.wcbd-qv-product-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 40px;
}

.wcbd-qv-images {
  position: relative;
}

/* Simple Gallery */
.wcbd-qv-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wcbd-qv-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wcbd-qv-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.wcbd-qv-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.wcbd-qv-thumb:hover {
  opacity: 1;
  border-color: #ddd;
}

.wcbd-qv-thumb.active {
  opacity: 1;
  border-color: var(--wcbd-qv-btn-bg, rgb(40, 153, 148));
}

.wcbd-qv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wcbd-qv-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wcbd-qv-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--wcbd-qv-text-color, #404040);
}

.wcbd-qv-price {
  font-size: 20px;
  font-weight: 600;
}

.wcbd-qv-rating {
  display: flex;
  align-items: center;
}

.wcbd-qv-rating .star-rating span:before {
  color: var(--wcbd-qv-star-color, #f7c104) !important;
}

.wcbd-qv-description {
  color: var(--wcbd-qv-text-color, #404040);
  line-height: 1.6;
}

/* Variable Product Styles */
.wcbd-qv-summary .variations,
.wcbd-qv-summary .single_variation_wrap {
  width: 100%;
}

.wcbd-qv-summary .variations select {
  width: 100%;
  max-width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0 10px;
}

.wcbd-qv-summary .variations .label {
  padding-right: 10px;
  width: 25%;
  text-align: left;
}

.wcbd-qv-summary .variations td.value {
  width: 75%;
}

.wcbd-qv-cart {
  margin-top: 16px;
}

/* Simple Product Form */
.wcbd-qv-cart .cart {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Variable Product Form Structure */
.wcbd-qv-cart .variations_form.cart,
.wcbd-qv-cart .grouped_form.cart {
  display: block;
}

/* Grouped Product Styles */
.wcbd-qv-cart .group_table {
  width: 100%;
  margin-bottom: 15px;
  border: none;
}

.wcbd-qv-cart .group_table td {
  padding: 10px 0;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
}

.wcbd-qv-cart .group_table td:first-child {
  width: 80px;
}

.wcbd-qv-cart .group_table .quantity {
  margin: 0;
}

.wcbd-qv-summary .woocommerce-variation-add-to-cart {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 15px;
  flex-wrap: wrap;
}

.wcbd-qv-cart .quantity {
  width: auto;
}

.wcbd-qv-content .single_add_to_cart_button {
  background-color: var(--wcbd-qv-cart-bg, #404045) !important;
  color: var(--wcbd-qv-cart-text, #ffffff) !important;
  transition: all 0.3s ease;
}

.wcbd-qv-content .single_add_to_cart_button:hover {
  background-color: var(--wcbd-qv-cart-bg-hover, #6a6a79) !important;
  color: var(--wcbd-qv-cart-text-hover, #ffffff) !important;
}

.wcbd-qv-view-details {
  margin-top: 10px;
}

.wcbd-qv-view-details .button {
  background-color: var(--wcbd-qv-details-bg, #404045) !important;
  color: var(--wcbd-qv-details-text, #ffffff) !important;
  width: 100%;
  text-align: center;
  transition: all 0.3s ease;
}

.wcbd-qv-view-details .button:hover {
  background-color: var(--wcbd-qv-details-bg-hover, #6a6a79) !important;
  color: var(--wcbd-qv-details-text-hover, #ffffff) !important;
}

.wcbd-qv-meta {
  font-size: 13px;
  color: #666;
}

/* Animations */
@keyframes wcbdFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes wcbdSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes wcbdSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {

  .wcbd-qv-container {
    max-width: var(--wcbd-qv-modal-mobile-width, 90vw);
    max-height: var(--wcbd-qv-modal-mobile-height, 80vh);
  }

  .wcbd-qv-cart .cart {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .wcbd-qv-product-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .wcbd-qv-content {
    padding: 20px;
  }

  .wcbd-qv-title {
    font-size: 20px;
  }

  .wcbd-qv-price {
    font-size: 18px;
  }

  .wcbd-qv-btn {
    padding: 8px 12px;
  }

  .wcbd-qv-btn .wcbd-qv-text {
    font-size: 12px;
  }
}

@media (max-width: 480px) {

  .wcbd-qv-content {
    padding: 16px;
  }

  .wcbd-qv-product-content {
    gap: 16px;
  }

  .wcbd-qv-title {
    font-size: 18px;
  }

  .wcbd-qv-price {
    font-size: 16px;
  }

  .wcbd-qv-summary {
    gap: 12px;
  }

  .wcbd-qv-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
}
