/* ==========================================================================
   IRIS OHYAMA - Products Page Styles
   Tmall-style product grid + Detail view + Image gallery
   ========================================================================== */

/* Page Header Banner
   ========================================================================== */
.products-banner {
  background: linear-gradient(135deg, #e60012 0%, #ff4757 50%, #ff6b81 100%);
  color: #fff;
  padding: 40px var(--spacing-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.products-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -10%;
  width: 120%;
  height: 200%;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.products-banner__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-sm);
  position: relative;
  z-index: 1;
}

.products-banner__subtitle {
  font-size: var(--font-size-base);
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* Page Layout Override for Products
   ========================================================================== */
.products-page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl) var(--spacing-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Sidebar Category Menu Enhancements
   ========================================================================== */
.sidebar-nav__link--active {
  background-color: rgba(230, 0, 18, 0.06);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  border-left: 3px solid var(--color-primary);
}

.sidebar-nav__item-icon {
  margin-right: var(--spacing-sm);
  font-size: 16px;
  vertical-align: middle;
}

.sidebar-nav__item-count {
  float: right;
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  padding: 1px 8px;
  border-radius: 10px;
  margin-top: 2px;
}

.sidebar-nav__link--active .sidebar-nav__item-count {
  background-color: rgba(230, 0, 18, 0.1);
  color: var(--color-primary);
}

/* Content Area Header
   ========================================================================== */
.content-area__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-border);
}

.content-area__category-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin: 0;
}

.content-area__count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Product Grid - Tmall Style
   ========================================================================== */
.product-list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

/* Product Card - Large Image Tmall Style
   ========================================================================== */
.product-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--color-primary);
}

.product-card:hover .product-card__image-wrapper {
  overflow: hidden;
}

.product-card:hover .product-card__img img,
.product-card:hover .product-card__placeholder {
  transform: scale(1.05);
}

.product-card__image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #f8f8f8 0%, #efefef 100%);
}

.product-card__img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Placeholder when image fails */
.product-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: transform 0.4s ease;
  position: relative;
}

.product-card__placeholder-icon {
  font-size: 48px;
  opacity: 0.4;
}

.product-card__placeholder-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  text-align: center;
  padding: 0 var(--spacing-sm);
}

.product-card__placeholder-index {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Category color bands for placeholders */
.product-card__placeholder--sanrio {
  background: linear-gradient(135deg, #ffe0ec 0%, #ffb6c1 100%);
}
.product-card__placeholder--storage {
  background: linear-gradient(135deg, #e0f0ff 0%, #b0d4f1 100%);
}
.product-card__placeholder--daily {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}
.product-card__placeholder--kitchen {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}
.product-card__placeholder--garden {
  background: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%);
}
.product-card__placeholder--pet {
  background: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%);
}
.product-card__placeholder--appliance {
  background: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%);
}
.product-card__placeholder--furniture {
  background: linear-gradient(135deg, #efebe9 0%, #bcaaa4 100%);
}
.product-card__placeholder--outdoor {
  background: linear-gradient(135deg, #e0f2f1 0%, #80cbc4 100%);
}

.product-card__info {
  padding: var(--spacing-md);
}

.product-card__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.product-card__tag {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--font-size-xs);
  padding: 2px 10px;
  border-radius: 2px;
  z-index: 2;
  font-weight: var(--font-weight-medium);
}

/* Detail View
   ========================================================================== */
.product-detail {
  display: none;
  animation: fadeIn 0.3s ease;
}

.product-detail--active {
  display: block;
}

.product-detail__back {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-light);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-lg);
}

.product-detail__back:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.product-detail__main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

/* Image Gallery */
.product-gallery {
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-lg));
  align-self: start;
}

.product-gallery__main {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #f8f8f8, #efefef);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--color-border-light);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__main-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
}

.product-gallery__main-placeholder-icon {
  font-size: 64px;
  opacity: 0.4;
}

.product-gallery__thumbnails {
  display: flex;
  gap: var(--spacing-sm);
}

.product-gallery__thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-gallery__thumb:hover {
  border-color: var(--color-text-muted);
}

.product-gallery__thumb--active {
  border-color: var(--color-primary);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumb-placeholder {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* Product Info */
.product-info__name {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-tight);
}

.product-info__desc {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  line-height: var(--line-height-base);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.product-info__params-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-md);
}

.product-info__params-table {
  width: 100%;
  border-collapse: collapse;
}

.product-info__params-table tr:nth-child(odd) {
  background-color: var(--color-bg-alt);
}

.product-info__params-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.product-info__params-table td:first-child {
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  width: 120px;
  white-space: nowrap;
}

.product-info__params-table td:last-child {
  color: var(--color-text-light);
}

/* Video Section */
.product-video {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-2xl);
  border-top: 2px solid var(--color-border);
}

.product-video__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-lg);
}

.product-video__container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}

.product-video__player {
  width: 100%;
  max-height: 500px;
  display: block;
  border-radius: var(--radius-md);
}

.product-video__placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  color: #888;
}

.product-video__play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.product-video__text {
  font-size: var(--font-size-sm);
  color: #888;
}

/* List view wrapper */
.product-list-view {
  display: block;
}

.product-list-view--hidden {
  display: none;
}

/* Responsive for products page
   ========================================================================== */
@media (max-width: 1024px) {
  .products-page-layout {
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-md);
  }
  .product-list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .products-page-layout {
    grid-template-columns: 1fr;
  }
  .product-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-detail__main {
    grid-template-columns: 1fr;
  }
  .product-gallery {
    position: static;
  }
}
