.vmart-dot {
  --vmart-border: #e6e8ec;
  --vmart-soft: #f8fafc;
  --vmart-text: #111827;
  --vmart-muted: #6b7280;
  --vmart-accent: #0f766e;
  --vmart-accent-dark: #115e59;
  --vmart-warning: #b45309;
  --vmart-fav: #d97706;
  --vmart-fav-soft: #fff7d6;
  --vmart-fav-active: #fff1b8;
  --vmart-error: #b91c1c;
  color: var(--vmart-text);
  font-size: 14px;
}

.vmart-dot *,
.vmart-dot *::before,
.vmart-dot *::after {
  box-sizing: border-box;
}

.vmart-dot-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 190px) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--vmart-border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
  backdrop-filter: blur(10px);
}

.vmart-dot-search,
.vmart-dot-category-filter,
.vmart-dot-qty {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--vmart-border);
  border-radius: 10px;
  background: #fff;
  color: var(--vmart-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vmart-dot-search,
.vmart-dot-category-filter {
  padding: 0 12px;
}

.vmart-dot-search:focus,
.vmart-dot-category-filter:focus,
.vmart-dot-qty:focus {
  border-color: var(--vmart-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.vmart-dot-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.vmart-dot .button,
.vmart-dot button.button,
.vmart-dot a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--vmart-accent);
  border-radius: 10px;
  background: var(--vmart-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.vmart-dot .button:hover,
.vmart-dot button.button:hover,
.vmart-dot a.button:hover {
  background: var(--vmart-accent-dark);
  border-color: var(--vmart-accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

.vmart-dot .button:disabled,
.vmart-dot button.button:disabled,
.vmart-dot .button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.vmart-dot-cart-link {
  background: #fff !important;
  color: var(--vmart-accent) !important;
}

.vmart-dot-cart-link:hover {
  background: var(--vmart-soft) !important;
  color: var(--vmart-accent-dark) !important;
}

.vmart-dot-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--vmart-accent);
  color: #fff;
  font-size: 12px;
}

.vmart-dot-notice {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--vmart-border);
  background: var(--vmart-soft);
  font-weight: 600;
}

.vmart-dot-notice.is-success {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.08);
  color: var(--vmart-accent-dark);
}

.vmart-dot-notice.is-error {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(185, 28, 28, 0.08);
  color: var(--vmart-error);
}

.vmart-dot-notice.is-info {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(180, 83, 9, 0.08);
  color: var(--vmart-warning);
}

.vmart-dot-table-wrap {
  width: 100%;
  overflow: visible;
  border: 1px solid var(--vmart-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.045);
}

.vmart-dot-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: #fff;
}

.vmart-dot-colgroup-fav { width: 76px; }
.vmart-dot-colgroup-image { width: 70px; }
.vmart-dot-colgroup-name { width: auto; }
.vmart-dot-colgroup-price { width: 74px; }
.vmart-dot-colgroup-stock { width: 70px; }
.vmart-dot-colgroup-qty { width: 74px; }
.vmart-dot-colgroup-add { width: 64px; }

.vmart-dot-table th,
.vmart-dot-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--vmart-border);
  vertical-align: middle;
  text-align: left;
}

.vmart-dot-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--vmart-soft);
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.vmart-dot-table tbody tr:last-child td {
  border-bottom: 0;
}

.vmart-dot-table tbody tr {
  transition: background 0.12s ease;
}

.vmart-dot-table tbody tr:hover {
  background: #fbfcfd;
}

.vmart-dot-table tbody tr.is-favourite {
  background: rgba(15, 118, 110, 0.045);
}

.vmart-dot-table tbody tr.is-favourite:hover {
  background: rgba(15, 118, 110, 0.075);
}

.vmart-dot-table tbody tr.is-out-of-stock {
  opacity: 0.72;
}

.vmart-dot-col-fav,
.vmart-dot-fav-cell,
.vmart-dot-col-qty,
.vmart-dot-qty-cell,
.vmart-dot-col-add,
.vmart-dot-add-cell {
  text-align: center !important;
}

.vmart-dot-col-image,
.vmart-dot-image-cell {
  width: 70px;
}

.vmart-dot-image-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--vmart-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.vmart-dot-image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vmart-dot-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(217, 119, 6, 0.32) !important;
  border-radius: 999px;
  background: #fff !important;
  color: #c7cbd1 !important;
  font-size: 18px;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform 0.12s ease, color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.vmart-dot-fav-btn:hover,
.vmart-dot-fav-btn:focus {
  transform: scale(1.04);
  color: var(--vmart-fav) !important;
  border-color: rgba(217, 119, 6, 0.55) !important;
  background: var(--vmart-fav-soft) !important;
  outline: none;
}

.vmart-dot-fav-btn.is-active {
  color: var(--vmart-fav) !important;
  border-color: rgba(217, 119, 6, 0.68) !important;
  background: var(--vmart-fav-active) !important;
}

.vmart-dot-fav-btn.is-active:hover,
.vmart-dot-fav-btn.is-active:focus {
  background: #ffe99a !important;
}

.vmart-dot-name-cell {
  min-width: 0;
}

.vmart-dot-product-name {
  display: block;
  color: var(--vmart-text);
  font-weight: 800;
  text-decoration: none;
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vmart-dot-product-name:hover {
  color: var(--vmart-accent);
}

.vmart-dot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  color: var(--vmart-muted);
  font-size: 11px;
  line-height: 1.25;
}

.vmart-dot-price-cell {
  color: var(--vmart-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.vmart-dot-price-stack,
.vmart-dot-price-cell .amount,
.vmart-dot-price-cell del,
.vmart-dot-price-cell ins {
  display: block;
}

.vmart-dot-price-cell del {
  color: var(--vmart-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  text-decoration-thickness: 1px;
}

.vmart-dot-price-cell ins {
  margin-top: 2px;
  color: var(--vmart-error);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none;
}

.vmart-dot-price-cell del .amount,
.vmart-dot-price-cell ins .amount {
  display: inline;
}

.vmart-dot-price-cell .woocommerce-Price-currencySymbol {
  font-size: 0.9em;
}

.vmart-dot-stock-cell {
  color: var(--vmart-muted);
  font-size: 12px;
  white-space: nowrap;
}

.vmart-dot-qty {
  width: 62px;
  max-width: 100%;
  min-height: 36px;
  padding: 0 6px;
  text-align: center;
  font-weight: 800;
  appearance: textfield;
  -moz-appearance: textfield;
}

.vmart-dot-qty::-webkit-outer-spin-button,
.vmart-dot-qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.vmart-dot-add-btn,
.vmart-dot-options-btn {
  width: 100%;
  min-width: 0;
  padding-left: 6px !important;
  padding-right: 6px !important;
  white-space: nowrap;
}

.vmart-dot-options-btn {
  font-size: 12px !important;
}

.vmart-dot-muted {
  color: var(--vmart-muted);
}

.vmart-dot-empty,
.vmart-dot-no-results {
  padding: 20px;
  border: 1px dashed var(--vmart-border);
  border-radius: 14px;
  background: var(--vmart-soft);
  color: var(--vmart-muted);
  text-align: center;
  font-weight: 700;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .vmart-dot-toolbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .vmart-dot-toolbar-actions {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .vmart-dot .button,
  .vmart-dot button.button,
  .vmart-dot a.button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .vmart-dot {
    font-size: 13px;
  }

  .vmart-dot-table-wrap {
    border-radius: 12px;
    box-shadow: none;
  }

  .vmart-dot-table th,
  .vmart-dot-table td {
    padding: 9px 4px;
  }

  .vmart-dot-table th {
    font-size: 11px;
  }

  .vmart-dot-colgroup-fav { width: 56px; }
  .vmart-dot-colgroup-image { width: 0; }
  .vmart-dot-colgroup-price { width: 62px; }
  .vmart-dot-colgroup-stock { width: 0; }
  .vmart-dot-colgroup-qty { width: 66px; }
  .vmart-dot-colgroup-add { width: 54px; }

  .vmart-dot-col-fav,
  .vmart-dot-fav-cell {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .vmart-dot-col-fav {
    font-size: 0;
  }

  .vmart-dot-col-fav::after {
    content: '★';
    font-size: 12px;
  }

  .vmart-dot-fav-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .vmart-dot-product-name {
    font-size: 13px;
    line-height: 1.25;
  }

  .vmart-dot-meta {
    font-size: 10px;
    gap: 3px 6px;
  }

  .vmart-dot-price-cell {
    font-size: 11px;
  }

  .vmart-dot-price-cell del {
    font-size: 10px;
  }

  .vmart-dot-price-cell ins {
    font-size: 11px;
  }

  .vmart-dot-qty {
    width: 58px;
    max-width: 100%;
    min-height: 32px;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 13px;
  }

  .vmart-dot-add-btn,
  .vmart-dot-options-btn {
    min-height: 32px !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }

  .vmart-dot-options-btn {
    font-size: 0 !important;
  }

  .vmart-dot-options-btn::after {
    content: '規格';
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .vmart-dot-colgroup-fav { width: 50px; }
  .vmart-dot-colgroup-price { width: 58px; }
  .vmart-dot-colgroup-qty { width: 62px; }
  .vmart-dot-colgroup-add { width: 50px; }

  .vmart-dot-product-name {
    font-size: 12px;
  }

  .vmart-dot-meta {
    display: none;
  }
}
