/* Danh sách sản phẩm + modal mua nhanh, dùng chung mọi giao diện. Màu nhấn theo --bs-primary của từng theme. */
.pc, .pc-modal { --pc-accent: var(--bs-primary, #2563eb); --pc-accent-rgb: var(--bs-primary-rgb, 37, 99, 235); --pc-line: #e5e7eb; --pc-muted: #6b7280; --pc-ink: #111827; --pc-surface: #fff; --pc-price: #15803d; }
[data-bs-theme="dark"] .pc, [data-bs-theme="dark"] .pc-modal { --pc-line: #2d3748; --pc-muted: #9ca3af; --pc-ink: #f3f4f6; --pc-surface: #1f2937; --pc-price: #4ade80; }
.pc [hidden], .pc-modal [hidden] { display: none !important; }
.pc { margin-bottom: 1.5rem; color: var(--pc-ink); text-align: left; }
.pc *, .pc-modal * { box-sizing: border-box; }

.pc-main-head { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.pc-main-head img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.pc-main-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }

.pc-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.pc-title { display: inline; font-size: 1.15rem; font-weight: 700; margin: 0 8px 0 0; color: inherit; }
.pc-sub, .pc-count { color: var(--pc-muted); font-size: 13px; }
.pc-search { display: flex; align-items: center; gap: 8px; height: 40px; width: 280px; max-width: 100%; margin: 0; padding: 0 14px; border: 1px solid var(--pc-line); border-radius: 999px; background: var(--pc-surface); color: var(--pc-muted); }
.pc-search:focus-within { border-color: var(--pc-accent); box-shadow: 0 0 0 3px rgba(var(--pc-accent-rgb), .15); }
.pc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--pc-ink); font-size: 14px; }

.pc-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pc-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--pc-line); border-radius: 999px; background: var(--pc-surface); color: var(--pc-ink); font-size: 13.500px; font-weight: 600; text-decoration: none; transition: border-color .15s, background-color .15s; }
.pc-pill img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.pc-pill b { color: var(--pc-muted); font-weight: 600; }
.pc-pill:hover { border-color: var(--pc-accent); color: var(--pc-ink); }
.pc-pill.is-active { border-color: var(--pc-accent); background: var(--pc-accent); color: #fff; }
.pc-pill.is-active b { color: rgba(255, 255, 255, .85); }

.pc-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.pc-sorts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pc-sorts-label { color: var(--pc-muted); font-size: 13px; margin-right: 2px; }
.pc-sort { min-height: 36px; padding: 5px 12px; border: 1px solid var(--pc-line); border-radius: 10px; background: var(--pc-surface); color: var(--pc-muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; }
.pc-sort:hover { border-color: var(--pc-accent); color: var(--pc-ink); }
.pc-sort.is-active { border-color: var(--pc-accent); background: var(--pc-accent); color: #fff; }

.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pc-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 20px 18px 0; overflow: hidden; border: 1px solid var(--pc-line); border-radius: 18px; background: var(--pc-surface); box-shadow: 0 2px 10px rgba(17, 24, 39, .05); transition: box-shadow .15s, border-color .15s; }
.pc-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--pc-accent), rgba(var(--pc-accent-rgb), .45)); }
.pc-card:hover { border-color: rgba(var(--pc-accent-rgb), .45); box-shadow: 0 8px 22px rgba(17, 24, 39, .09); }
.pc-card.is-out { opacity: .65; }
.pc-auto { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(22, 163, 74, .12); color: #15803d; font-size: 11px; font-weight: 600; }
[data-bs-theme="dark"] .pc-auto { color: #4ade80; }
.pc-card-head { display: flex; gap: 10px; align-items: flex-start; width: 100%; margin-bottom: 12px; }
.pc-thumb { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f3f4f6; }
.pc-name { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--pc-ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pc-tag { padding: 2px 9px; border-radius: 999px; background: rgba(107, 114, 128, .12); color: var(--pc-muted); font-size: 11px; line-height: 1.5; }
.pc-price { color: var(--pc-price); font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.pc-stock { padding: 2px 9px; border-radius: 999px; background: rgba(107, 114, 128, .12); color: var(--pc-muted); font-size: 12px; white-space: nowrap; }
.pc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: calc(100% + 36px); margin: auto -18px 0; padding: 12px 18px; border-top: 1px solid var(--pc-line); }
.pc-card-sum { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-card .pc-price { color: var(--pc-ink); font-size: 15px; }
.pc-left { display: inline-flex; align-items: center; gap: 4px; color: #15803d; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pc-left::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.pc-left.is-zero { color: #dc2626; }
.pc-left.is-zero::before { background: #dc2626; }
[data-bs-theme="dark"] .pc-left { color: #4ade80; }
.pc-buy { display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 10px; background: var(--pc-accent); color: #fff !important; font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; transition: filter .15s; }
.pc-buy-card { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; width: auto; min-height: 38px; padding: 7px 14px; font-size: 13px; border-radius: 999px; background: linear-gradient(135deg, var(--pc-accent), rgba(var(--pc-accent-rgb), .78)); box-shadow: 0 4px 12px rgba(var(--pc-accent-rgb), .28); }
.pc-buy:hover:not(:disabled) { filter: brightness(.92); }
.pc-buy:disabled { background: #9ca3af; cursor: not-allowed; }
.pc-empty { grid-column: 1 / -1; padding: 32px 0; color: var(--pc-muted); text-align: center; }
.pc-more-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pc-more { min-height: 40px; padding: 8px 20px; border: 1px solid var(--pc-accent); border-radius: 10px; background: transparent; color: var(--pc-accent); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pc-more:hover { background: var(--pc-accent); color: #fff; }

.pc-modal .modal-content { position: relative; border: 0; border-radius: 16px; background: var(--pc-surface); color: var(--pc-ink); }
.pc-modal .modal-body { padding: 24px; }
.pc-modal .pc-m-close { position: absolute; top: 10px; right: 10px; z-index: 2; box-sizing: border-box; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(107, 114, 128, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5 5 19'/%3E%3C/svg%3E") center / 22px no-repeat; opacity: 1; }
.pc-modal .pc-m-close:hover { background-color: rgba(107, 114, 128, .24); }
[data-bs-theme="dark"] .pc-modal .pc-m-close { filter: invert(1); }
.pc-m-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; }
.pc-m-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding-right: 36px; }
.pc-m-title img { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.pc-m-title h4 { margin: 0; color: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.pc-m-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc-m-meta .pc-price { font-size: 1.35rem; }
.pc-m-note { margin-bottom: 10px; padding: 8px 12px; border-left: 3px solid #f59e0b; border-radius: 6px; background: rgba(245, 158, 11, .1); font-size: 13px; }
.pc-m-desc { max-height: 280px; overflow-y: auto; font-size: 13.500px; line-height: 1.55; overflow-wrap: anywhere; }
.pc-m-desc.is-loading { min-height: 64px; border-radius: 8px; background: linear-gradient(90deg, rgba(107, 114, 128, .08), rgba(107, 114, 128, .18), rgba(107, 114, 128, .08)); background-size: 200% 100%; animation: pc-shimmer 1.2s linear infinite; }
@keyframes pc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pc-m-desc.is-loading { animation: none; } .pc-card, .pc-pill, .pc-sort { transition: none; } }
.pc-m-buy { align-self: start; margin-top: 40px; padding: 16px; border: 1px solid var(--pc-line); border-radius: 14px; }
.pc-m-buy h5 { margin: 0 0 8px; color: inherit; font-size: 14px; font-weight: 700; }
.pc-m-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--pc-line); font-size: 14px; }
.pc-m-row label { margin: 0; }
.pc-m-total { margin-bottom: 12px; border-bottom: 0; }
.pc-m-total strong { color: var(--pc-price); font-size: 1.15rem; }
.pc-m-field { padding: 9px 0; font-size: 14px; }
.pc-m-field label { margin-bottom: 4px; }
.pc-qty { display: flex; align-items: center; gap: 4px; }
.pc-qty button { width: 34px; height: 34px; border: 1px solid var(--pc-line); border-radius: 8px; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.pc-qty input { width: 64px; height: 34px; border: 1px solid var(--pc-line); border-radius: 8px; background: transparent; color: inherit; font-size: 16px; font-weight: 600; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.pc-qty input::-webkit-inner-spin-button, .pc-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pc-m-low { margin: 0 0 10px; color: #dc2626; font-size: 13px; }

@media (max-width: 767.98px) {
    .pc-m-grid { grid-template-columns: 1fr; gap: 16px; }
    .pc-m-buy { margin-top: 0; }
    .pc-m-desc { max-height: 160px; }
    .pc-modal .modal-body { padding: 18px; }
    .pc-search { width: 100%; }
}
@media (max-width: 575.98px) {
    .pc-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .pc-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .pc-pill { flex: 0 0 auto; }
}
