/**
 * Hooktheme Quick View Styles
 * Modal styling for product quick view feature
 *
 * NOTE: Quick View uses the same CSS as product page.
 * This file only contains Quick View SPECIFIC overrides.
 */

/* ============================================
   Modal Overlay
   ============================================ */

hooktheme-quick-view {
  box-sizing: border-box;
  opacity: 0;
  position: fixed;
  visibility: hidden;
  z-index: -1;
  margin: 0 auto;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-foreground), 0.5);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

hooktheme-quick-view[open] {
  opacity: 1;
  visibility: visible;
  z-index: 101;
}

/* ============================================
   Modal Content Container
   ============================================ */

.hooktheme-quick-view__content {
  --modal-height-offset: 2rem;
  position: relative;
  width: calc(100% - 2rem);
  max-width: var(--page-width);
  max-height: calc(100vh - var(--modal-height-offset) * 2);
  background-color: rgb(var(--color-background));
  overflow: hidden;
  overflow-y: auto;
}

@media screen and (min-width: 750px) {
  .hooktheme-quick-view__content {
    --modal-height-offset: 4rem;
    width: 90%;
  }
}

@media screen and (min-width: 990px) {
  .hooktheme-quick-view__content {
    --modal-height-offset: 5rem;
    width: 85%;
    max-width: 1200px;
  }
}

/* Border radius option */
.hooktheme-quick-view__content.quick_view_border_radius {
  border-radius: 1.5rem;
}

/* ============================================
   Close Button
   ============================================ */

.hooktheme-quick-view__toggle {
  background-color: rgb(var(--color-background));
  border: 0.1rem solid rgba(var(--color-foreground), 0.1);
  border-radius: 50%;
  color: rgba(var(--color-foreground), 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 1.2rem;
  z-index: 10;
  width: 4rem;
  height: 4rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.hooktheme-quick-view__toggle:hover {
  color: rgba(var(--color-foreground), 0.75);
  background-color: rgba(var(--color-foreground), 0.04);
}

.hooktheme-quick-view__toggle .icon {
  height: 2rem;
  width: 2rem;
}

@media screen and (min-width: 750px) {
  .hooktheme-quick-view__toggle {
    top: 1.5rem;
    right: 1.5rem;
  }
}

/* ============================================
   Content Info Container
   ============================================ */

.hooktheme-quick-view__content-info {
  position: relative;
}

/* ============================================
   Quick View Product Layout Overrides
   ============================================ */

/* Remove container padding in Quick View */
hooktheme-quick-view .container,
hooktheme-quick-view .container-fluid {
  padding-left: 0;
  padding-right: 0;
}

/* Remove section padding in Quick View */
hooktheme-quick-view [class*="section-"][class*="-padding"] {
  padding-top: 0;
  padding-bottom: 0;
}

/* Product grid adjustments */
hooktheme-quick-view .product.row {
  --bs-gutter-x: 0;
  margin: 0;
}

hooktheme-quick-view .product.row > [class*="col-"] {
  padding: 0;
}

/* Media container adjustments */
hooktheme-quick-view .product__media_container {
  padding: 1.5rem;
}

/* Product info container adjustments */
hooktheme-quick-view .product__info-container {
  padding: 1.5rem;
  padding-top: 2.5rem;
}

@media screen and (min-width: 750px) {
  hooktheme-quick-view .product__media_container {
    padding: 2rem;
  }

  hooktheme-quick-view .product__info-container {
    padding: 2rem;
    padding-right: 3rem;
  }
}

/* Disable sticky in Quick View */
hooktheme-quick-view .product__info-container--sticky {
  position: relative;
  top: auto;
}

/* ============================================
   Gallery Adjustments for Quick View
   ============================================ */

/* Limit gallery height in Quick View */
hooktheme-quick-view media-gallery {
  max-height: 60vh;
}

hooktheme-quick-view .product__media-list {
  max-height: 50vh;
}

hooktheme-quick-view .thumbnail-slider {
  max-height: 10vh;
}

@media screen and (min-width: 750px) {
  hooktheme-quick-view media-gallery {
    max-height: none;
  }

  hooktheme-quick-view .product__media-list {
    max-height: none;
  }

  hooktheme-quick-view .thumbnail-slider {
    max-height: none;
  }
}

/* Hide elements not needed in Quick View */
hooktheme-quick-view .skip-to-content-link {
  display: none;
}

/* ============================================
   Typography Adjustments
   ============================================ */

/* Product title - add link styling */
hooktheme-quick-view .product__title {
  padding-right: 4rem;
  @media screen and (min-width: 750px) {
    font-size: 3rem;
  }
}
hooktheme-quick-view .quick-add-hidden {
  display: none;
}
hooktheme-quick-view .product__title a {
  color: inherit;
  text-decoration: none;
}

hooktheme-quick-view .product__title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

/* View details link */
hooktheme-quick-view .product__view-details {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
}

hooktheme-quick-view .product__view-details svg {
  width: 2rem;
  margin-left: 0.5rem;
}

/* ============================================
   Form Adjustments
   ============================================ */

hooktheme-quick-view .product-form__buttons {
  margin-top: 2rem;
}

hooktheme-quick-view .product-form__cart--box {
  gap: 1.5rem;
  flex-wrap: wrap;
}

hooktheme-quick-view .product-form__submit {
  flex-grow: 1;
}

/* ============================================
   Drawer Style (Optional)
   ============================================ */

hooktheme-quick-view.hooktheme-quick-view--drawer {
  right: 0;
  left: auto;
  width: 100%;
  max-width: 55rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  background: transparent;
}

hooktheme-quick-view.hooktheme-quick-view--drawer .hooktheme-quick-view__content {
  position: relative;
  left: 0;
  transform: none;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
}

hooktheme-quick-view.hooktheme-quick-view--drawer[open] {
  transform: translateX(0);
}

@media screen and (max-width: 749px) {
  hooktheme-quick-view.hooktheme-quick-view--drawer {
    max-width: 100%;
  }
}

/* Drawer overlay */
hooktheme-quick-view.hooktheme-quick-view--drawer::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(var(--color-foreground), 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: -1;
}

hooktheme-quick-view.hooktheme-quick-view--drawer[open]::before {
  opacity: 1;
  visibility: visible;
}

/* Drawer layout - stack vertically */
hooktheme-quick-view.hooktheme-quick-view--drawer .product.row {
  flex-direction: column;
}

hooktheme-quick-view.hooktheme-quick-view--drawer .product.row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

/* ============================================
   Loading State
   ============================================ */

.hooktheme-quick-view-trigger.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}
.hooktheme-quick-view-trigger.loading:after {
  content: "";
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 1.6rem;
  height: 1.6rem;
  border-top-color: transparent;
  border-radius: 50%;
  animation: hooktheme-spin .6s linear infinite;
}

@keyframes hooktheme-spin {
  to {
    transform: rotate(360deg);
  }
}
hooktheme-quick-view .product__media {
  cursor: default;
}
/* ============================================
   Disable Animations in Quick View
   ============================================ */

hooktheme-quick-view .scroll-trigger.scroll-trigger {
  animation: none;
  opacity: 1;
}

/* ============================================
   RTL Support
   ============================================ */

[dir='rtl'] hooktheme-quick-view .hooktheme-quick-view__toggle {
  right: auto;
  left: 1rem;
}

[dir='rtl'] hooktheme-quick-view .product__title {
  padding-right: 0;
  padding-left: 4rem;
}

[dir='rtl'] hooktheme-quick-view .product__view-details svg {
  margin-left: 0;
  margin-right: 0.5rem;
  transform: rotate(180deg);
}

@media screen and (min-width: 750px) {
  [dir='rtl'] hooktheme-quick-view .hooktheme-quick-view__toggle {
    left: 1.5rem;
  }

  [dir='rtl'] hooktheme-quick-view .product__info-container {
    padding-right: 2rem;
    padding-left: 3rem;
  }
}

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

@media screen and (max-width: 749px) {
  hooktheme-quick-view .product.row {
    flex-direction: column;
  }

  hooktheme-quick-view .product.row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  hooktheme-quick-view .product__media_container,
  hooktheme-quick-view .product__info-container {
    padding: 1.5rem;
  }
}
hooktheme-quick-view .product__media-item:not(:first-child) {
  display: none;
}