/*
 * CSS của riêng trang sản phẩm (resources/views/products/show.blade.php). Chỉnh
 * lại theo cỡ màn hình thì viết ở product-responsive.css.
 *
 * File này nạp sau styles.css và shop.css: luật cùng độ ưu tiên ở đây đè luật ở
 * hai file đó.
 *
 * Giá, thẻ sản phẩm, cột bên, ô số lượng và nút mua là thứ nhiều giao diện cùng
 * dùng, nên kiểu dáng của chúng nằm ở shop.css.
 */

/* Dải đường dẫn phân cấp ở đầu trang. */
.shop-breadcrumb {
    padding: 14px 0;
    border-bottom: 1px solid var(--site-line);
    background: var(--site-soft);
}

.shop-breadcrumb .breadcrumb {
    --bs-breadcrumb-divider: '›';
    --bs-breadcrumb-item-active-color: var(--site-muted);
    margin: 0;
    font-size: 0.875rem;
}

.shop-breadcrumb .breadcrumb a:hover {
    text-decoration: underline;
}

/* ───────────────────────────── Bộ ảnh ───────────────────────────── */

/* Ảnh lớn: mọi ảnh cùng một khung vuông để chiều cao không nhảy khi chuyển ảnh. */
.product-gallery__stage {
    position: relative;
    border: 1px solid var(--site-line);
    border-radius: 4px;
    background: #fff;
}

.product-gallery__stage .carousel-item {
    aspect-ratio: 1;
}

.product-gallery__zoom {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.product-gallery__zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Sản phẩm chưa có ảnh nào. */
.product-gallery__stage .product-gallery__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--site-soft);
    color: var(--site-muted);
}

.product-gallery__badge {
    width: 56px;
    height: 56px;
    font-size: 1rem;
}

/* Hai nút chuyển ảnh nằm trong khung ảnh lớn, chỉ hiện khi rê chuột hoặc focus. */
.product-gallery .carousel-control-prev,
.product-gallery .carousel-control-next {
    width: 52px;
    color: var(--site-ink);
    opacity: 0;
    transition: opacity 0.2s;
}

.product-gallery:hover .carousel-control-prev,
.product-gallery:hover .carousel-control-next,
.product-gallery .carousel-control-prev:focus-visible,
.product-gallery .carousel-control-next:focus-visible {
    opacity: 1;
}

.product-gallery .carousel-control-prev .icon,
.product-gallery .carousel-control-next .icon {
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    box-sizing: content-box;
}

/* Hàng ảnh nhỏ: dấu chỉ của carousel, đặt lại thành một hàng ảnh nằm dưới ảnh lớn. */
.product-gallery__thumbs {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin: 10px 0 0;
}

.product-gallery__thumbs [data-bs-target] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 1px solid var(--site-line);
    border-radius: 4px;
    background: #fff;
    opacity: 0.6;
    overflow: hidden;
    text-indent: 0;
    aspect-ratio: 1;
    box-sizing: border-box;
    transition: opacity 0.2s, border-color 0.2s;
}

.product-gallery__thumbs [data-bs-target]:hover,
.product-gallery__thumbs .active {
    border-color: var(--site-primary);
    opacity: 1;
}

.product-gallery__thumbs img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hộp xem ảnh lớn. */
.product-lightbox .modal-content {
    border: 0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.product-lightbox img {
    display: block;
    width: 100%;
    max-height: 88vh;
    object-fit: contain;
}

.product-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 1.25rem;
    height: 1.25rem;
    padding: 10px;
    border-radius: 50%;
    background-color: #fff;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ─────────────────────── Thông tin và nút mua ─────────────────────── */

.product-summary__title {
    margin: 0 0 12px;
    font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
    font-weight: 800;
    line-height: 1.3;
}

.product-summary__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--site-line);
    font-size: 0.9375rem;
}

.product-summary__meta a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-stock {
    color: var(--shop-buy);
}

.product-stock--out {
    color: var(--site-primary);
}

/* Ghi chú VAT ngay dưới giá. */
.product-summary__vat {
    margin: 4px 0 0;
    color: var(--site-muted);
    font-size: 0.875rem;
}

.product-summary__lead {
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.65;
}

.product-buy {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

/*
 * Hàng nút chọn thuộc tính, ngay trên ô số lượng. Mỗi nút là nhãn của một ô radio
 * đã giấu đi, nên chọn được bằng bàn phím và chạy cả khi tắt JavaScript.
 */
.product-options {
    min-width: 0;
}

.product-options__label {
    float: none;
    width: auto;
    margin: 0 0 8px;
    color: var(--site-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.product-options__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-options__input {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.product-options__item {
    position: relative;
    min-width: 88px;
    padding: 8px 18px;
    border: 1px solid var(--site-line);
    border-radius: 2px;
    background: #fff;
    color: var(--site-ink);
    font-size: 0.9375rem;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.product-options__item:hover {
    border-color: var(--site-primary);
}

/* Thuộc tính đang chọn: viền màu thương hiệu, góc dưới bên phải có dấu tích. */
.product-options__input:checked + .product-options__item {
    border-color: var(--site-primary);
}

.product-options__input:checked + .product-options__item::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    background: var(--site-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='m8.4 12.2 1.8 1.8 3.9-4.3'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.product-options__input:focus-visible + .product-options__item {
    outline: 2px solid var(--site-primary);
    outline-offset: 2px;
}

.product-buy__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.product-buy__row .btn-buy {
    flex: 1 1 200px;
}

/* Sản phẩm chưa có giá, hoặc tạm hết hàng: lời nhắn đứng ở chỗ của nút mua. */
.product-notice {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-left: 4px solid var(--site-bar);
    background: var(--site-soft);
    color: var(--site-ink);
    font-weight: 600;
}

/* Các nút liên hệ dưới nút mua: mỗi kênh một màu, như cụm nút liên hệ nhanh của site. */
.product-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0 0;
}

/* Rê chuột thì nền trắng, viền và chữ mang màu của kênh. */
.product-contacts__item {
    --contact-color: var(--site-header);
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--contact-color);
    --bs-btn-border-color: var(--contact-color);
    --bs-btn-hover-color: var(--contact-color);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: var(--contact-color);
    --bs-btn-active-color: var(--contact-color);
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: var(--contact-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.product-contacts__item--call {
    --contact-color: #d11a59;
}

.product-contacts__item--zalo {
    --contact-color: #0068ff;
}

.product-contacts__item--messenger {
    --contact-color: #125c9e;
}

/* ─────────────────────── Mô tả và sản phẩm tương tự ─────────────────────── */

.product-description {
    margin-top: 48px;
}

/* Tiêu đề mang dáng một tab đang mở, nằm trên đường kẻ. */
.product-description__title {
    margin: 0 0 24px;
    border-bottom: 1px solid var(--site-line);
    font-size: 1rem;
    line-height: 1.3;
    text-transform: uppercase;
}

.product-description__title span {
    display: inline-block;
    margin-bottom: -1px;
    padding: 12px 20px;
    border: 1px solid var(--site-line);
    border-top: 3px solid var(--site-primary);
    border-bottom-color: #fff;
    background: #fff;
}

.related-products {
    margin-top: 48px;
}
