/* ========== 商城全局 ========== */
:root { --red: #c8102e; }

.shop-wrap { padding: 28px 0 60px; min-height: 60vh; }

.shop-page-title {
  font-size: 20px; font-weight: 700; color: #222;
  margin-bottom: 24px; padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

/* ========== 分类导航 ========== */
.shop-cat-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px; padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.shop-cat-btn {
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid #ddd; color: #555;
  font-size: 14px; text-decoration: none;
  transition: all .2s;
}
.shop-cat-btn:hover, .shop-cat-btn.active {
  background: var(--red); color: #fff; border-color: var(--red);
}

/* ========== 区块标题 ========== */
.shop-section-title {
  font-size: 18px; font-weight: 700; color: #222;
  margin: 24px 0 16px; display: flex; align-items: center; gap: 10px;
}
.shop-section-title::before {
  content: ''; display: inline-block; width: 4px; height: 18px;
  background: var(--red); border-radius: 2px;
}
.shop-count { font-size: 13px; font-weight: 400; color: #999; }

/* ========== 商品网格 ========== */
.shop-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-bottom: 32px;
}

/* ========== 商品卡片 ========== */
.shop-product-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden;
  transition: box-shadow .2s, transform .2s; background: #fff;
}
.shop-product-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-3px);
}
/* 骨架屏动画 */
@keyframes skeleton-shine {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shop-product-img {
  position: relative; width: 100%; padding-top: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shine 1.4s infinite linear;
  overflow: hidden;
}
.shop-product-img img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s;
  opacity: 0; transition: opacity .3s, transform .3s;
}
.shop-product-img img.loaded {
  opacity: 1;
}
.shop-product-card:hover .shop-product-img img { transform: scale(1.05); }
.shop-product-no-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 13px;
}
.shop-product-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--red); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
}
.shop-product-info { padding: 12px 14px 14px; }
.shop-product-name {
  font-size: 14px; font-weight: 600; color: #222;
  margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.4;
}
.shop-product-desc {
  font-size: 12px; color: #999; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-product-price-row { display: flex; align-items: baseline; gap: 6px; }
.shop-product-price { font-size: 17px; font-weight: 700; color: var(--red); }
.shop-product-original { font-size: 12px; color: #bbb; text-decoration: line-through; }

/* ========== 空状态 ========== */
.shop-empty { text-align: center; padding: 60px 0; color: #999; font-size: 15px; }

/* ========== 分页 ========== */
.shop-pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; }
.shop-page-btn {
  padding: 5px 12px; border: 1px solid #ddd; border-radius: 4px;
  color: #555; font-size: 13px; text-decoration: none;
}
.shop-page-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ========== 商品详情 ========== */
.shop-breadcrumb {
  font-size: 13px; color: #999; margin-bottom: 20px;
  display: flex; align-items: center; gap: 6px;
}
.shop-breadcrumb a { color: #666; text-decoration: none; }
.shop-breadcrumb a:hover { color: var(--red); }

.shop-product-detail {
  display: grid; grid-template-columns: 480px 1fr;
  gap: 40px; margin-bottom: 40px;
}

.shop-product-main-img {
  border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shine 1.4s infinite linear;
}
.shop-product-main-img img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  opacity: 0; transition: opacity .3s;
}
.shop-product-main-img img.loaded { opacity: 1; }
.shop-product-no-img.large {
  width: 100%; aspect-ratio: 1; display: flex;
  align-items: center; justify-content: center; color: #ccc;
}
.shop-product-thumbs {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.shop-thumb {
  width: 60px; height: 60px; object-fit: cover;
  border: 2px solid #e8e8e8; border-radius: 4px; cursor: pointer;
  transition: border-color .2s;
}
.shop-thumb.active, .shop-thumb:hover { border-color: var(--red); }

.shop-product-title { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 10px; }
.shop-product-summary { font-size: 14px; color: #777; margin-bottom: 16px; }

.shop-product-price-section { margin-bottom: 14px; }
.shop-price-big { font-size: 30px; font-weight: 700; color: var(--red); }
.shop-price-origin { font-size: 14px; color: #bbb; text-decoration: line-through; margin-left: 8px; }

.shop-rating-summary {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.shop-stars { color: #f5a623; font-size: 16px; }
.shop-rating-num { font-size: 13px; color: #999; }

.shop-stock { font-size: 13px; color: #666; margin-bottom: 20px; }
.shop-instock { color: #389e0d; font-weight: 600; }
.shop-outstock { color: #cf1322; font-weight: 600; }

.shop-add-cart-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.shop-qty-wrap { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.shop-qty-wrap.small { }
.qty-btn {
  width: 34px; height: 34px; background: #f5f5f5; border: none;
  cursor: pointer; font-size: 16px; color: #555;
  transition: background .2s;
}
.qty-btn:hover { background: #e8e8e8; }
.shop-qty-wrap input[type=number] {
  width: 50px; height: 34px; border: none; border-left: 1px solid #ddd;
  border-right: 1px solid #ddd; text-align: center; font-size: 14px;
  -moz-appearance: textfield;
}
.shop-qty-wrap input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.shop-btn-cart {
  padding: 0 28px; height: 44px; background: var(--red); color: #fff;
  border: none; border-radius: 4px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.shop-btn-cart:hover { background: #a50d26; }
.shop-btn-cart:disabled { background: #ccc; cursor: not-allowed; }

.shop-cart-msg { font-size: 13px; margin-top: 6px; min-height: 20px; }
.shop-cart-msg.ok { color: #389e0d; }
.shop-cart-msg.err { color: var(--red); }

/* Tab */
.shop-detail-tabs { margin-top: 20px; }
.shop-tab-nav {
  display: flex; border-bottom: 2px solid #eee; margin-bottom: 24px;
}
.shop-tab-btn {
  padding: 10px 24px; border: none; background: none;
  font-size: 15px; color: #666; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s;
}
.shop-tab-btn.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.shop-tab-panel { display: none; }
.shop-tab-panel.active { display: block; }
.shop-detail-content img { max-width: 100%; height: auto; }

/* 评价 */
.shop-review-form-wrap {
  background: #f9f9f9; border-radius: 6px; padding: 24px;
  margin-bottom: 32px;
}
.shop-review-form-wrap h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.shop-review-form { display: flex; flex-direction: column; gap: 14px; }
.shop-review-row { display: flex; flex-direction: column; gap: 4px; }
.shop-review-row label { font-size: 13px; color: #555; font-weight: 600; }
.shop-review-row input, .shop-review-row textarea {
  border: 1px solid #ddd; border-radius: 4px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; resize: vertical;
}
.shop-review-row input:focus, .shop-review-row textarea:focus {
  outline: none; border-color: var(--red);
}

.star-select { display: flex; gap: 4px; cursor: pointer; }
.star-opt { font-size: 26px; color: #ddd; transition: color .1s; }
.star-opt.hover, .star-opt.selected { color: #f5a623; }

.shop-reviews-list { display: flex; flex-direction: column; gap: 16px; }
.shop-review-item {
  border-bottom: 1px solid #f0f0f0; padding-bottom: 16px;
}
.shop-review-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.shop-reviewer { font-weight: 600; font-size: 14px; color: #333; }
.shop-verified-badge {
  background: #e6f7ff; color: #1890ff;
  font-size: 11px; padding: 1px 6px; border-radius: 10px;
}
.shop-review-stars { color: #f5a623; font-size: 14px; }
.shop-review-date { font-size: 12px; color: #bbb; margin-left: auto; }
.shop-review-content { font-size: 14px; color: #555; line-height: 1.6; }

/* ========== 购物车 ========== */
.shop-cart-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 24px;
}
.shop-cart-table { width: 100%; border-collapse: collapse; }
.shop-cart-table th, .shop-cart-table td {
  padding: 12px 16px; border-bottom: 1px solid #eee;
  font-size: 14px; text-align: left;
}
.shop-cart-table th { background: #f9f9f9; font-weight: 600; color: #555; }
.shop-cart-product { display: flex; align-items: center; gap: 10px; }
.shop-cart-product img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.shop-cart-product a { color: #333; text-decoration: none; font-weight: 500; }
.shop-cart-product a:hover { color: var(--red); }

.shop-remove-btn {
  background: none; border: none; color: #bbb; cursor: pointer;
  font-size: 13px; padding: 4px 8px; border-radius: 3px;
}
.shop-remove-btn:hover { color: var(--red); background: #fff0f0; }

.shop-summary-card {
  background: #f9f9f9; border: 1px solid #e8e8e8;
  border-radius: 6px; padding: 20px; position: sticky; top: 80px;
}
.shop-summary-row {
  display: flex; justify-content: space-between;
  font-size: 14px; margin-bottom: 10px;
}
.shop-summary-row.total { font-size: 16px; font-weight: 700; padding-top: 10px; border-top: 1px solid #e8e8e8; margin-top: 6px; }
.shop-summary-total { color: var(--red); font-size: 20px; font-weight: 700; }

.shop-empty-cart {
  text-align: center; padding: 80px 0;
}
.shop-empty-icon { font-size: 60px; margin-bottom: 16px; }
.shop-empty-cart p { font-size: 16px; color: #999; margin-bottom: 24px; }

/* ========== 按钮 ========== */
.shop-btn-primary {
  display: inline-block; padding: 10px 28px;
  background: var(--red); color: #fff; border: none; border-radius: 4px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: background .2s;
}
.shop-btn-primary:hover { background: #a50d26; color: #fff; }
.shop-btn-primary.block { display: block; width: 100%; box-sizing: border-box; }
.shop-btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.shop-btn-default {
  display: inline-block; padding: 8px 20px;
  border: 1px solid #ddd; color: #555; border-radius: 4px;
  font-size: 14px; text-decoration: none; text-align: center;
  transition: all .2s;
}
.shop-btn-default:hover { border-color: var(--red); color: var(--red); }

.shop-btn-link {
  display: block; text-align: center; margin-top: 10px;
  font-size: 13px; color: #888; text-decoration: none;
}
.shop-btn-link:hover { color: var(--red); }

/* ========== 结算 ========== */
.shop-checkout-layout {
  display: grid; grid-template-columns: 1fr 340px; gap: 24px;
}
.shop-form-card {
  background: #fff; border: 1px solid #e8e8e8;
  border-radius: 6px; padding: 24px; margin-bottom: 20px;
}
.shop-form-title {
  font-size: 16px; font-weight: 700; color: #222;
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.shop-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.shop-form-row label { font-size: 13px; font-weight: 600; color: #555; }
.shop-form-row label em { color: var(--red); }
.shop-form-row input, .shop-form-row textarea, .shop-form-row select {
  border: 1px solid #ddd; border-radius: 4px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; resize: vertical;
}
.shop-form-row input:focus, .shop-form-row textarea:focus, .shop-form-row select:focus {
  outline: none; border-color: var(--red);
}

.shop-payment-options { display: flex; flex-direction: column; gap: 12px; }
.shop-payment-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid #ddd; border-radius: 6px;
  cursor: pointer; transition: border-color .2s;
}
.shop-payment-opt input[type=radio] { accent-color: var(--red); }
.shop-payment-opt:has(input:checked) { border-color: var(--red); background: #fff8f8; }
.shop-payment-icon { font-size: 22px; }
.shop-payment-opt span:nth-child(3) { font-weight: 600; font-size: 14px; }
.shop-payment-opt small { font-size: 12px; color: #999; margin-left: auto; }

.shop-transfer-info {
  margin-top: 12px; background: #fffbe6; border: 1px solid #ffe58f;
  border-radius: 4px; padding: 12px 16px;
}
.shop-transfer-info pre { font-size: 13px; color: #555; white-space: pre-wrap; margin: 6px 0 0; }

.shop-order-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.shop-order-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.shop-order-item-info { flex: 1; }
.shop-order-item-name { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 2px; }
.shop-order-item-price { font-size: 12px; color: #999; }
.shop-order-item-sub { font-size: 14px; font-weight: 700; color: var(--red); white-space: nowrap; }
.shop-summary-divider { border-top: 1px solid #e8e8e8; margin: 12px 0; }

/* ========== 订单成功 ========== */
.shop-order-success {
  text-align: center; padding: 32px 0 24px;
  border-bottom: 1px solid #eee; margin-bottom: 24px;
}
.shop-success-icon { font-size: 50px; margin-bottom: 12px; }
.shop-order-success h2 { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 10px; }
.shop-order-success p { font-size: 14px; color: #666; margin-bottom: 6px; }
.shop-payment-tip { color: #555; }
.shop-transfer-box {
  max-width: 400px; margin: 12px auto 0;
  background: #fffbe6; border: 1px solid #ffe58f;
  border-radius: 4px; padding: 12px 16px; text-align: left;
}
.shop-transfer-box pre { font-size: 13px; white-space: pre-wrap; margin: 0; }

/* ========== 订单详情 ========== */
.shop-order-detail-wrap { max-width: 860px; }
.shop-order-card {
  background: #fff; border: 1px solid #e8e8e8;
  border-radius: 6px; padding: 20px; margin-bottom: 20px;
}
.shop-order-card-title {
  font-size: 15px; font-weight: 700; color: #222;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.shop-order-info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.shop-order-info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.shop-order-info-grid label { font-size: 12px; color: #999; }
.shop-order-info-grid span { font-size: 14px; color: #333; }

.shop-status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px;
}
.badge-warn { background: #fff7e6; color: #d46b08; }
.badge-info { background: #e6f7ff; color: #1890ff; }
.badge-success { background: #f6ffed; color: #389e0d; }
.badge-default { background: #f5f5f5; color: #999; }

.shop-order-items-table { width: 100%; border-collapse: collapse; }
.shop-order-items-table th, .shop-order-items-table td {
  padding: 10px 14px; border-bottom: 1px solid #eee;
  font-size: 13px; text-align: left;
}
.shop-order-items-table th { background: #f9f9f9; font-weight: 600; color: #666; }
.shop-order-total { color: var(--red); font-weight: 700; font-size: 15px; }

/* 物流时间线 */
.shop-logistics-timeline { padding: 4px 0; }
.shop-log-item {
  display: flex; gap: 16px; padding-bottom: 20px;
  position: relative;
}
.shop-log-item::before {
  content: ''; position: absolute; left: 7px; top: 20px; bottom: 0;
  width: 2px; background: #e8e8e8;
}
.shop-log-item:last-child::before { display: none; }
.shop-log-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1;
}
.shop-log-status { font-size: 14px; font-weight: 600; color: #222; margin-bottom: 3px; }
.shop-log-carrier { font-size: 13px; color: #555; margin-bottom: 3px; }
.shop-log-remark { font-size: 13px; color: #777; margin-bottom: 3px; }
.shop-log-time { font-size: 12px; color: #bbb; }

.shop-review-quick {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
  font-size: 14px; color: #333;
}
.shop-order-actions { margin-top: 20px; display: flex; gap: 12px; }

/* ========== 购物车图标 ========== */
.cart-icon-wrap {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; color: #555; font-size: 14px;
  position: relative;
}
.cart-icon-wrap:hover { color: var(--red); }
.cart-badge {
  position: absolute; top: -8px; right: -10px;
  background: var(--red); color: #fff;
  font-size: 10px; line-height: 16px; width: 16px; height: 16px;
  border-radius: 50%; text-align: center; display: none;
}
.cart-badge.show { display: block; }

/* ========== 服务标签 ========== */
.shop-service-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}
.shop-service-tags span {
  font-size: 12px; color: #52c41a; font-weight: 600;
}

/* ========== 评价总览 ========== */
.shop-rating-overview {
  display: flex; align-items: center; gap: 20px;
  background: #fffbe6; border: 1px solid #ffe58f;
  border-radius: 6px; padding: 16px 24px; margin-bottom: 24px;
}
.shop-rating-score {
  font-size: 48px; font-weight: 700; color: #f5a623; line-height: 1;
}

/* ========== 详情内容（淘宝风格） ========== */
.shop-detail-content {
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 15px;
  color: #333;
}
.shop-detail-content img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block;
  margin: 4px 0;
}
.shop-detail-content video {
  max-width: 100% !important;
  width: 100% !important;
  display: block;
  margin: 8px 0;
}
.shop-detail-content p {
  margin: 8px 0;
}
.shop-detail-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.shop-detail-content table td,
.shop-detail-content table th {
  border: 1px solid #e8e8e8;
  padding: 8px 12px;
}
.shop-detail-content table th {
  background: #f5f5f5;
  font-weight: 600;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-product-detail { grid-template-columns: 360px 1fr; }
}
@media (max-width: 900px) {
  .shop-cart-layout { grid-template-columns: 1fr; }
  .shop-checkout-layout { grid-template-columns: 1fr; }
  .shop-product-detail { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-order-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .shop-grid { grid-template-columns: 1fr; }
}
