/* ========== Product Detail ========== */
.product-detail {
  padding: 40px 0 80px;
  background: var(--white);
}

.product-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 80px;
}

/* Gallery */
.product-gallery {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.product-main-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.product-thumbs {
  display: flex;
  gap: 12px;
}

.product-thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.product-thumb:hover,
.product-thumb.active {
  border-color: var(--red-500);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info */
.product-info { }

.product-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}

.badge-new {
  background: var(--red-50);
  color: var(--red-500);
}

.badge-hot {
  background: #FEF3C7;
  color: #D97706;
}

.product-info h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.3;
  margin-bottom: 16px;
}

.product-desc {
  font-size: 16px;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.7;
}

.product-detail .ey-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 18px 20px;
  margin: 0 0 18px;
  background: linear-gradient(180deg, var(--gray-50), rgba(255,255,255,0.90));
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-detail .ey-price > span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.product-detail .ey-price #users_price {
  font-size: 38px;
  line-height: 1;
  color: var(--red-500);
}

.product-detail .ey-number {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin: 6px 0 18px;
}

.product-detail .ey-number > label {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
}

.product-detail .ey-number .btn-input {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.product-detail .ey-number .btn-input button.layui-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 18px;
  line-height: 40px;
  transition: background 0.2s ease, color 0.2s ease;
}

.product-detail .ey-number .btn-input button.layui-btn:hover {
  background: var(--red-50);
  color: var(--red-600);
}

.product-detail .ey-number .btn-input input.layui-input {
  width: 60px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--gray-200);
  border-right: 1px solid var(--gray-200);
  border-radius: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
}

.product-detail .ey-number .btn-input input.layui-input:focus-visible {
  outline: 2px solid var(--red-300);
  outline-offset: -2px;
}

.product-price-box {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.product-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--red-500);
}

.product-price small {
  font-size: 18px;
  font-weight: 600;
}

.product-original-price {
  font-size: 16px;
  color: var(--gray-400);
  text-decoration: line-through;
}

.product-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.product-actions .btn {
  flex: 1;
  min-width: 140px;
}

.product-detail .product-actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-md);
  text-decoration: none;
  user-select: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.product-detail .product-actions a.btn.btn-primary {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: var(--white);
  box-shadow: var(--shadow-pink);
}

.product-detail .product-actions a.btn.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(244,63,94,0.30);
}

.product-detail .product-actions a.btn.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.product-detail .product-actions a.btn.btn-outline:hover {
  transform: translateY(-1px);
  border-color: var(--red-300);
  color: var(--red-600);
  box-shadow: var(--shadow-md);
}

.product-detail .product-actions a.btn:focus-visible {
  outline: 2px solid var(--red-300);
  outline-offset: 2px;
}

/* Features */
.product-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-500);
  flex-shrink: 0;
}

.feature-text {
  font-size: 14px;
  color: var(--gray-700);
}

/* Package Options */
.package-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.package-options {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.package-option {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.package-option:hover {
  border-color: var(--gray-300);
}

.package-option.active {
  border-color: var(--red-500);
  background: var(--red-50);
}

.package-option input {
  display: none;
}

.package-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.package-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--red-500);
}

.package-original-price {
  font-size: 12px;
  color: var(--gray-400);
  text-decoration: line-through;
  margin-top: 4px;
}

.product-detail .ey-spec {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  margin: 0 0 18px;
  background: linear-gradient(180deg, var(--gray-50), rgba(255,255,255,0.90));
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-detail .ey-spec .product-spec-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-detail .ey-spec .product-spec-name {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
  min-width: 72px;
}

.product-detail .ey-spec .product-spec-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.product-detail .ey-spec a.product-spec-btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
}

.product-detail .ey-spec a.product-spec-btn:hover {
  transform: translateY(-1px);
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-600);
}

.product-detail .ey-spec a.product-spec-btn:focus-visible {
  outline: 2px solid var(--red-300);
  outline-offset: 2px;
}

.product-detail .ey-spec a.product-spec-btn.btn-danger {
  color: var(--white);
  border-color: transparent;
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  box-shadow: var(--shadow-pink);
}

.product-detail .ey-spec a.product-spec-btn.btn-danger:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: var(--white);
  box-shadow: var(--shadow-pink);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(244,63,94,0.30);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-outline:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

/* Tabs */
.product-tabs {
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 32px;
}

.tab-buttons {
  display: flex;
  gap: 32px;
}

.tab-btn {
  padding: 16px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--gray-700); }

.tab-btn.active {
  color: var(--red-500);
  border-bottom-color: var(--red-500);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.tab-content p {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 16px;
}

.tab-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.tab-content li {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Related Products */
.related-products {
  margin-top: 80px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  border-color: transparent;
}

.product-card-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  position: relative;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.08);
}

.product-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover .product-card-overlay {
  opacity: 1;
}

.product-card-content {
  padding: 20px;
}

.product-card-category {
  font-size: 12px;
  color: var(--red-500);
  font-weight: 500;
  margin-bottom: 8px;
}

.product-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.product-card-tags span {
  padding: 4px 8px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  border-radius: 4px;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--red-500);
}

.product-card-price span {
  font-size: 14px;
  font-weight: 500;
}

.entry-page-nav {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.entry-page-prev,
.entry-page-next {
  flex: 1;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.7;
}

.entry-page-next {
  text-align: right;
}

.entry-page-prev a,
.entry-page-next a {
  color: var(--gray-900);
  font-weight: 600;
  transition: color 0.2s;
}

.entry-page-prev a:hover,
.entry-page-next a:hover {
  color: var(--red-600);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .product-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-gallery {
    position: relative;
    top: 0;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }

  .product-main {
    display: block;
    margin-bottom: 40px;
  }
  
  .product-gallery {
    margin: 0 -16px 24px -16px;
    width: auto;
  }
  
  .product-main-image {
    border-radius: 0;
    aspect-ratio: 1/1;
  }
  
  .product-thumbs {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .product-info h1 { font-size: 24px; }
  
  .product-price-box {
    padding: 16px;
    flex-wrap: wrap;
  }
  
  .product-features { grid-template-columns: 1fr; }
  .product-actions { flex-direction: column; }
  .product-actions .btn { width: 100%; }

  .product-detail .ey-price #users_price {
    font-size: 34px;
  }

  .product-detail .ey-number .btn-input input.layui-input {
    width: 56px;
  }
  
  .package-options { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .package-option { 
    min-width: 0;
    width: auto;
    flex: none;
  }
  
  .package-option:last-child {
    grid-column: span 2;
  }
  
  .tab-buttons { gap: 16px; overflow-x: auto; padding-bottom: 4px; }
  .tab-btn { font-size: 14px; white-space: nowrap; }
  
  .products-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
  }
  
  .product-card-content {
    padding: 12px;
  }
  
  .product-card-title {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .product-card-price {
    font-size: 16px;
  }
  
  .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
  }

  .product-detail .ey-spec .product-spec-group {
    flex-direction: column;
    gap: 10px;
  }

  .product-detail .ey-spec .product-spec-name {
    min-width: 0;
  }

  .entry-page-nav {
    flex-direction: column;
  }

  .entry-page-next {
    text-align: left;
  }
}
