/* Fashion Horizon - Global Styles */

/* 1. 基础重置与字体设置 */
:root {
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #666666;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-secondary);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 图片基础设置 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2. 布局辅助工具类 */
/* 自定义高度，补充Tailwind默认缺失的vh比例 */
.h-screen-80 {
  height: 80vh;
}
.h-screen-60 {
  height: 60vh;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .h-screen-80 {
    height: 60vh;
  }
  .h-screen-60 {
    height: 50vh;
  }
}

/* 3. 组件：轮播图 (Carousel) */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.carousel-caption {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  text-align: center;
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 4. 交互效果：悬停放大 (Hover Zoom) */
.hover-zoom-container {
  position: relative;
  overflow: hidden;
  display: block;
  cursor: pointer;
}

.hover-zoom-img {
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hover-zoom-container:hover .hover-zoom-img {
  transform: scale(1.05);
}

/* 遮罩层与文字揭示 */
.hover-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.4s ease, background-color 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.hover-zoom-container:hover .hover-overlay {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.4);
}

.hover-text {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease 0.1s, opacity 0.4s ease 0.1s;
}

.hover-zoom-container:hover .hover-text {
  transform: translateY(0);
  opacity: 1;
}

/* 5. 导航栏样式 */
.nav-link {
  position: relative;
  font-weight: 300;
  letter-spacing: 0.05em;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 50%;
  background-color: currentColor;
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* 6. 瀑布流布局 (Masonry Grid for Trends) */
.masonry-grid {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 640px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 2px;
}

/* 7. 通用动画 */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 8. 单品详情页特定样式 */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1.5fr 1fr;
        height: calc(100vh - 80px); /* 减去header高度 */
        overflow: hidden;
    }
    
    .detail-gallery {
        height: 100%;
        overflow-y: auto;
        /* 隐藏滚动条 */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .detail-gallery::-webkit-scrollbar {
        display: none;
    }

    .detail-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 4rem;
    }
}