/* ===== VENDEX Shop フロントエンドスタイル ===== */
:root {
  --vx-blue: #1a6ea5;
  --vx-blue-dark: #155d8a;
  --vx-green: #1e8a4a;
  --vx-warn: #c47900;
  --vx-red: #b32000;
  --vx-border: #dde3ea;
  --vx-radius: 10px;
  --vx-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── 商品グリッド ── */
.vendex-shop { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.vendex-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 20px;
  margin: 20px 0;
}
@media (max-width: 768px) { .vendex-product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .vendex-product-grid { grid-template-columns: 1fr; } }

.vendex-product-card {
  background: #fff;
  border: 1px solid var(--vx-border);
  border-radius: var(--vx-radius);
  overflow: hidden;
  box-shadow: var(--vx-shadow);
  transition: transform .2s, box-shadow .2s;
}
.vendex-product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.vendex-product-thumb { position: relative; aspect-ratio: 1; overflow: hidden; background: #f5f5f5; }
.vendex-product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vendex-product-card:hover .vendex-product-thumb img { transform: scale(1.04); }
.vendex-no-image { display: flex; align-items: center; justify-content: center; color: #aaa; font-size: .85em; }
.vendex-sale-badge { position: absolute; top: 8px; left: 8px; background: #e74c3c; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .75em; font-weight: 700; }
.vendex-product-info { padding: 14px; }
.vendex-product-title { font-size: 1em; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.vendex-product-price { margin: 8px 0; }
.vendex-original-price { text-decoration: line-through; color: #999; font-size: .85em; margin-right: 6px; }
.vendex-current-price { font-size: 1.2em; font-weight: 700; color: #c0392b; }
.vendex-low-stock { color: var(--vx-warn); font-size: .82em; margin: 4px 0; }
.vendex-soldout { color: #999; font-size: .85em; }
.vendex-rating-mini { display: flex; align-items: center; gap: 4px; margin: 4px 0; font-size: .85em; }
.vendex-rating-count { color: #888; }
.vendex-product-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── ボタン ── */
.vendex-btn-primary {
  display: inline-block; background: var(--vx-blue); color: #fff;
  border: none; border-radius: 6px; padding: 10px 18px; font-size: .95em;
  font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .2s;
}
.vendex-btn-primary:hover { background: var(--vx-blue-dark); color: #fff; }
.vendex-btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.vendex-btn-outline {
  display: inline-block; background: transparent; color: var(--vx-blue);
  border: 1.5px solid var(--vx-blue); border-radius: 6px; padding: 9px 16px;
  font-size: .9em; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .2s;
}
.vendex-btn-outline:hover { background: var(--vx-blue); color: #fff; }
.vendex-btn-add-cart { flex: 1; }
.vendex-btn-detail { padding: 10px 12px; font-size: .85em; }
.vendex-btn-block { display: block; width: 100%; box-sizing: border-box; }
.vendex-btn-lg { padding: 14px; font-size: 1.05em; }

/* ── カート通知 ── */
#vendex-cart-notice {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--vx-green); color: #fff; padding: 12px 20px;
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  font-size: .92em;
}

/* ── カートページ ── */
.vendex-cart-wrap, .vendex-checkout-wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.vendex-page-title { font-size: 1.5em; font-weight: 700; margin-bottom: 24px; border-bottom: 2px solid var(--vx-border); padding-bottom: 12px; }
.vendex-cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 680px) { .vendex-cart-layout { grid-template-columns: 1fr; } }
.vendex-cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--vx-border); align-items: center; }
.vendex-cart-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--vx-border); background: #f5f5f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vendex-cart-item-body { flex: 1; }
.vendex-cart-item-name { font-weight: 600; margin: 0 0 4px; }
.vendex-cart-item-price { color: #c0392b; font-weight: 600; margin: 0 0 8px; }
.vendex-cart-qty { display: flex; align-items: center; gap: 6px; }
.vendex-qty-btn { width: 28px; height: 28px; border: 1px solid var(--vx-border); background: #f5f5f5; border-radius: 4px; cursor: pointer; font-size: 1em; }
.vendex-qty-input { width: 48px; text-align: center; border: 1px solid var(--vx-border); border-radius: 4px; padding: 4px; }
.vendex-cart-item-subtotal { text-align: right; }
.vendex-remove-item { background: none; border: none; color: var(--vx-red); font-size: .8em; cursor: pointer; margin-top: 6px; }

/* カートサイドバー */
.vendex-cart-sidebar { background: #f9fafc; border: 1px solid var(--vx-border); border-radius: var(--vx-radius); padding: 20px; }
.vendex-sidebar-title { font-weight: 700; margin: 0 0 10px; }
.vendex-coupon-input { display: flex; gap: 8px; margin-bottom: 8px; }
.vendex-coupon-input input { flex: 1; border: 1px solid var(--vx-border); border-radius: 6px; padding: 8px 10px; }
#vendex-coupon-msg { font-size: .85em; color: var(--vx-red); min-height: 16px; }
.vendex-cart-summary { margin: 16px 0; }
.vendex-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95em; }
.vendex-discount-row { color: var(--vx-green); }
.vendex-total-row { font-weight: 700; font-size: 1.05em; border-top: 1px solid var(--vx-border); padding-top: 10px; margin-top: 6px; }

/* ── チェックアウト ── */
.vendex-checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 680px) { .vendex-checkout-layout { grid-template-columns: 1fr; } }
.vendex-form-section { background: #fff; border: 1px solid var(--vx-border); border-radius: var(--vx-radius); padding: 20px; margin-bottom: 16px; }
.vendex-form-section h3 { margin: 0 0 16px; font-size: 1em; font-weight: 700; color: var(--vx-blue); }
.vendex-field { margin-bottom: 14px; }
.vendex-field label { display: block; font-size: .85em; font-weight: 600; color: #374151; margin-bottom: 5px; }
.vendex-field input, .vendex-field select, .vendex-input { width: 100%; padding: 10px 12px; border: 1px solid var(--vx-border); border-radius: 6px; font-size: .95em; box-sizing: border-box; }
.vendex-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: #c00; }
.vendex-payment-option { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px solid var(--vx-border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.vendex-payment-option:has(input:checked) { border-color: var(--vx-blue); background: #f0f6fc; }
.vendex-payment-label { font-weight: 600; margin-left: 6px; }
.vendex-payment-note { font-size: .8em; color: #666; margin-left: 22px; }
.vendex-checkout-summary { background: #f9fafc; border: 1px solid var(--vx-border); border-radius: var(--vx-radius); padding: 20px; }
.vendex-checkout-item { display: flex; justify-content: space-between; padding: 5px 0; font-size: .9em; }
.vendex-checkout-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1em; padding: 12px 0 16px; border-top: 1px solid var(--vx-border); margin-top: 8px; }
.vendex-checkout-note { font-size: .8em; color: #888; text-align: center; margin-top: 8px; }

/* ── サンキューページ ── */
.vendex-thankyou { text-align: center; padding: 40px 20px; max-width: 560px; margin: 0 auto; }
.vendex-thankyou-icon { width: 64px; height: 64px; background: var(--vx-green); color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8em; margin-bottom: 16px; }
.vendex-thankyou h2 { font-size: 1.4em; margin-bottom: 6px; }
.vendex-thankyou-sub { color: #555; margin-bottom: 20px; }
.vendex-thankyou-detail { text-align: left; background: #f9f9f9; border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.vendex-bank-info { background: #e8f3fd; border-left: 4px solid var(--vx-blue); padding: 12px; margin-top: 12px; border-radius: 0 6px 6px 0; font-size: .9em; line-height: 1.7; }
.vendex-thankyou-note { color: #666; font-size: .85em; margin-bottom: 20px; }

/* ── 星評価 ── */
.vendex-stars { font-size: 1em; }
.star.filled { color: #f59e0b; }
.star.empty  { color: #d1d5db; }
.star-selectable { font-size: 1.6em; cursor: pointer; color: #f59e0b; }
.star-selectable.active { color: #f59e0b; }

/* ── レビューフォーム ── */
.vendex-review-form-wrap { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--vx-border); }
.vendex-review-form .vendex-field { margin-bottom: 12px; }

/* ── バッジ ── */
.vendex-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: .8em; font-weight: 700; }
.badge-ok   { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }

/* ── 注文テーブル ── */
.vendex-order-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.vendex-order-table th { width: 120px; text-align: left; padding: 8px 12px; background: #f5f7fa; color: #555; font-size: .88em; font-weight: 600; border-bottom: 1px solid var(--vx-border); }
.vendex-order-table td { padding: 8px 12px; border-bottom: 1px solid var(--vx-border); font-size: .9em; }

/* ── アラート ── */
.vendex-alert-error   { background: #fee2e2; color: #991b1b; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.vendex-alert-success { background: #d1fae5; color: #065f46; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.vendex-empty { text-align: center; padding: 40px; color: #888; }
.vendex-empty-cart { text-align: center; padding: 60px 20px; }

/* ── カートアイコン（ヘッダー用） ── */
.vxshop-cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  padding: 4px;
}
.vxshop-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
  transition: transform .2s;
}
.vxshop-cart-badge.vxshop-badge-empty { display: none; }
.vxshop-cart-icon:hover .vxshop-cart-badge { transform: scale(1.2); }
.vxshop-cart-label { font-size: .9em; }
