/* TechOut Product Page — Editorial Lookbook Layout
   3-column image-first luxury fashion experience */

/* ============================================
   PRODUCT PAGE WRAPPER
   ============================================ */

.product-page {
  padding: var(--space-6) var(--container-padding);
  max-width: var(--container-2xl);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .product-page {
    padding: var(--space-8) var(--container-padding);
  }
}

@media (min-width: 1024px) {
  .product-page {
    padding: var(--space-10) var(--container-padding);
  }
}

/* ============================================
   3-COLUMN LAYOUT
   ============================================ */

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* Tablet: 2-column (lookbook + info) */
@media (min-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

/* Desktop: 3-column (featured + lookbook + info) */
@media (min-width: 1024px) {
  .product-layout {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-3);
  }
}

@media (min-width: 1200px) {
  .product-layout {
    gap: var(--space-4);
  }
}

/* ============================================
   FEATURED IMAGE (Left Column)
   ============================================ */

.product-gallery__featured {
  display: none;
}

@media (min-width: 1024px) {
  .product-gallery__featured {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    height: calc(100vh - var(--header-h) - var(--space-12));
    height: calc(100dvh - var(--header-h) - var(--space-12));
  }
}

.product-gallery__featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  background-color: var(--bg-secondary);
}

/* ============================================
   LOOKBOOK GALLERY (Center Column)
   ============================================ */

.product-gallery__lookbook {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Desktop: scrollable vertically */
@media (min-width: 1024px) {
  .product-gallery__lookbook {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    height: calc(100vh - var(--header-h) - var(--space-12));
    height: calc(100dvh - var(--header-h) - var(--space-12));
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: var(--space-2);
    gap: var(--space-2);
    scroll-snap-type: y mandatory;
  }

  .product-gallery__lookbook::-webkit-scrollbar {
    display: none;
  }
}

/* Tablet: also scrollable */
@media (min-width: 768px) and (max-width: 1023px) {
  .product-gallery__lookbook {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    max-height: calc(100vh - var(--header-h) - var(--space-12));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .product-gallery__lookbook::-webkit-scrollbar {
    display: none;
  }
}

/* Mobile: horizontal swipe */
@media (max-width: 767px) {
  .product-gallery__lookbook {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-3);
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 calc(-1 * var(--container-padding));
    padding: 0 var(--container-padding);
  }

  .product-gallery__lookbook::-webkit-scrollbar {
    display: none;
  }
}

.product-gallery__lookbook-image {
  width: 100%;
  min-height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  background-color: var(--bg-secondary);
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Mobile: full-width snap items */
@media (max-width: 767px) {
  .product-gallery__lookbook-image {
    width: calc(100vw - 2 * var(--container-padding));
    scroll-snap-align: center;
  }
}

/* ============================================
   LOOKBOOK IMAGE ITEM + COUNTER (Mobile only)
   ============================================ */

.product-gallery__lookbook-item {
  position: relative;
  flex-shrink: 0;
}

.product-gallery__counter {
  display: none;
}

@media (max-width: 767px) {
  .product-gallery__counter {
    display: block;
    position: absolute;
    bottom: var(--space-4);
    left: var(--space-4);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-white);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    pointer-events: none;
  }
}

/* ============================================
   PRODUCT INFO PANEL (Right Column)
   ============================================ */

.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .product-info {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    height: fit-content;
    max-height: calc(100vh - var(--header-h) - var(--space-12));
    max-height: calc(100dvh - var(--header-h) - var(--space-12));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-300) transparent;
  }
}

.product-info::-webkit-scrollbar {
  width: 4px;
}

.product-info::-webkit-scrollbar-thumb {
  background-color: var(--color-gray-300);
  border-radius: var(--radius-full);
}

/* ============================================
   PRODUCT HEADER (Title + Price + Wishlist)
   ============================================ */

.product-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-header__top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.product-header__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  flex: 1;
}

.product-header__wishlist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.product-header__wishlist-btn:hover {
  border-color: var(--color-black);
}

.product-header__wishlist-btn.active {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
}

.product-header__wishlist-btn svg {
  width: 16px;
  height: 16px;
}

.product-header__price {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.product-header__price-current {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}

.product-header__price-compare {
  font-size: var(--text-lg);
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-header__price-badge {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background-color: var(--color-black);
  color: var(--color-white);
  border-radius: var(--radius-full);
}

/* ============================================
   SIZE SELECTOR
   ============================================ */

.product-option {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.product-option__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.product-option__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.product-option__value {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.size-guide-link {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: auto;
}

.size-guide-link:hover {
  color: var(--text-primary);
}

.size-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.size-selector__option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.size-selector__option:hover {
  border-color: var(--color-black);
}

.size-selector__option.active {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
}

.size-selector__option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  position: relative;
}

.size-selector__option.disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 1px;
  background-color: var(--color-gray-400);
  transform: rotate(-45deg);
}

/* ============================================
   COLOR SELECTOR
   ============================================ */
.color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.color-selector__option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.color-selector__option:hover {
  border-color: var(--color-black);
}
.color-selector__option.active {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
}
.color-selector__option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  position: relative;
}
.color-selector__option.disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 1px;
  background-color: var(--color-gray-400);
  transform: rotate(-45deg);
}

/* ============================================
   PRODUCT ACTIONS (Add to Cart + Buy Now)
   ============================================ */

.product-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.product-actions__row {
  display: flex;
  gap: var(--space-3);
}

.product-actions__row .btn {
  flex: 1;
}

.btn-add-to-cart {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
}

.btn-buy-now {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
}

/* ============================================
   PRODUCT TABS
   ============================================ */

.product-tabs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-light);
}

.product-tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-tabs__nav::-webkit-scrollbar {
  display: none;
}

.product-tabs__btn {
  flex-shrink: 0;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.product-tabs__btn:hover {
  color: var(--text-primary);
}

.product-tabs__btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--color-black);
}

.product-tabs__panels {
  padding: var(--space-5) 0;
}

.product-tabs__panel {
  display: none;
}

.product-tabs__panel.active {
  display: block;
}

.product-tabs__panel h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

.product-tabs__panel p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.product-tabs__panel p:last-child {
  margin-bottom: 0;
}

.product-tabs__panel ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-tabs__panel ul li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  padding-left: var(--space-4);
  position: relative;
}

.product-tabs__panel ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: var(--radius-full);
}

/* ============================================
   STICKY ADD TO CART (Mobile)
   ============================================ */

.sticky-add-to-cart {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--container-padding);
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  z-index: var(--z-sticky);
}

@media (max-width: 767px) {
  .sticky-add-to-cart {
    display: block;
  }
}

.sticky-add-to-cart__container {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sticky-add-to-cart__info {
  flex: 1;
  min-width: 0;
}

.sticky-add-to-cart__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-add-to-cart__price {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.sticky-add-to-cart__btn {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-6);
}

/* ============================================
   PRODUCT NOTIFICATION
   ============================================ */

.product-notification {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-black);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-base);
  z-index: var(--z-toast);
}

.product-notification.active {
  transform: translateY(0);
  opacity: 1;
}

.product-notification__icon {
  width: 24px;
  height: 24px;
  color: #4caf50;
}

.product-notification__text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.product-notification__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.product-notification__close:hover {
  opacity: 1;
}

.product-notification__close svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   RELATED PRODUCTS
   ============================================ */

.related-products {
  padding: var(--section-spacing-mobile) var(--container-padding);
  background-color: var(--bg-secondary);
}

@media (min-width: 768px) {
  .related-products {
    padding: var(--section-spacing) var(--container-padding);
  }
}

.related-products__container {
  max-width: var(--container-2xl);
  margin: 0 auto;
}

.related-products__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.related-products__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.related-products__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.related-products__link:hover {
  color: var(--text-primary);
}

.related-products__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.related-products__link:hover svg {
  transform: translateX(4px);
}

@media (max-width: 767px) {
  .related-products .shop-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .related-products .shop-product-card {
    display: flex;
    flex-direction: column;
  }

  .related-products .shop-product-card__image-wrapper {
    aspect-ratio: 3/4;
    flex-shrink: 0;
  }

  .related-products .shop-product-card__content {
    flex: 1;
    padding: 10px;
  }

  .related-products .shop-product-card__title {
    font-size: var(--text-sm);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .related-products .shop-product-card__vendor {
    font-size: 9px;
  }

  .related-products .shop-product-card__price-current {
    font-size: var(--text-sm);
  }
}

/* ============================================
   PRODUCT LOADING STATE
   ============================================ */

.product-skeleton {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  padding: var(--space-10) var(--container-padding);
  max-width: var(--container-2xl);
  margin: 0 auto;
}

.skeleton-image {
  aspect-ratio: 3/4;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.skeleton-line {
  height: 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-line--short {
  width: 60%;
}

.skeleton-line--medium {
  width: 80%;
}

.skeleton-button {
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
