/* CSS riêng của module products, nạp bằng add_style($this->asset('products.css')). Dùng biến màu của site.css. */

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    background: var(--bg);
}
.product-card:hover { border-color: var(--primary); }
.product-thumb { position: relative; display: block; aspect-ratio: 1; background: var(--surface); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb-empty { display: grid; place-items: center; height: 100%; font-size: 40px; font-weight: 700; color: var(--muted); }
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.product-info { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.product-info small { color: var(--muted); }
.product-info strong { font-weight: 600; line-height: 1.35; }

.price ins { text-decoration: none; font-weight: 700; color: var(--primary); }
.price del { margin-left: 6px; color: var(--muted); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips a { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; }
.chips a small { color: var(--muted); }
.chips a.active { border-color: var(--primary); color: var(--primary); }

.breadcrumb { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 32px; align-items: start; }
.product-detail .product-thumb { border-radius: 12px; overflow: hidden; }
.product-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 10px; }
.product-gallery button { padding: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: var(--surface); cursor: pointer; }
.product-gallery button.is-active { border-color: var(--primary); }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); }
.product-price { font-size: 22px; margin: 12px 0; }
.in-stock { color: #16a34a; }
.out-stock { color: #dc2626; }
.product-desc { margin-top: 16px; }

@media (max-width: 720px) {
    .product-detail { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}


/* Chọn phiên bản (views/_variants.php) */
.variant-picker { margin: 14px 0; display: grid; gap: 12px; }
.variant-axis-name { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.variant-axis-name strong { color: var(--text); }
.variant-values { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-value { min-width: 44px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.variant-value:hover { border-color: var(--primary); }
.variant-value.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); font-weight: 600; }
.variant-value.is-soldout { color: var(--muted); text-decoration: line-through; }
.variant-value { display: inline-flex; align-items: center; gap: 6px; }
.variant-icon { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.variant-hint { margin: 0; font-size: 14px; color: var(--muted); }