/*
 * Chỉnh bố cục cho bản PHP (nạp sau Site.css và Reponsive.css của bản gốc).
 * Mục tiêu: markup mới không lệch so với thiết kế gốc, và responsive trên mọi màn hình.
 */

/* ---------- Header: cờ ngôn ngữ nằm sát mép trên, không đè lên giỏ hàng ---------- */
.lang {
    top: 4px !important;
    right: 8px !important;
}
.lang img {
    height: 14px;
    width: auto;
    display: block;
}

/* ---------- Banner sản phẩm: lưới cố định (không phụ thuộc số banner) ---------- */
#wrapBannerProduct {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin: 0 -10px;
    padding: 10px 0;
}
#wrapBannerProduct a.banner-product {
    display: flex !important;
    flex-direction: column;
}
#wrapBannerProduct a.banner-product img {
    flex: 1 1 auto;
    min-height: 0;
    object-fit: cover;
}
#wrapBannerProduct .banner-product,
#wrapBannerProduct .banner-product-2,
#wrapBannerProduct .banner-product-3,
#wrapBannerProduct .banner-product-4,
#wrapBannerProduct .banner-product-5 {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: block;
    box-sizing: border-box;
    width: 25% !important;
    padding: 10px;
}
#wrapBannerProduct .banner-product-1 {
    width: 50% !important;
}
.banner-product img {
    width: 100%;
    height: auto;
    display: block;
}
@media screen and (max-width: 680px) {
    #wrapBannerProduct .banner-product,
    #wrapBannerProduct .banner-product-2,
    #wrapBannerProduct .banner-product-3,
    #wrapBannerProduct .banner-product-4,
    #wrapBannerProduct .banner-product-5 { width: 50% !important; padding: 5px; }
    #wrapBannerProduct .banner-product-1 { width: 100% !important; }
}

/* ---------- Giỏ hàng: cột thẳng hàng với tiêu đề ---------- */
.cart-header,
.item-cart {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.cart-header > div,
.item-cart > div {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 35px;
    float: none;
    white-space: normal;
    overflow: visible;
}
.cart-header .title-cart {
    flex: 0 0 39%;
    justify-content: flex-start;
    min-height: 35px;
    padding-left: 12px;
}
.item-cart .title-cart {
    flex: 0 0 39%;
    justify-content: flex-start;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    min-height: 100px;
    padding-left: 12px;
}
.cart-header .quantity-cart,
.item-cart .quantity-cart { flex: 0 0 15%; }
.cart-header .price-cart,
.item-cart .price-cart,
.cart-header .total-price-cart,
.item-cart .total-price-cart { flex: 0 0 18%; }
.cart-header .delete-cart,
.item-cart .delete-cart { flex: 0 0 10%; }
.item-cart .title-cart img {
    width: 80px;
    height: 80px;
    margin-right: 12px;
    flex: 0 0 80px;
    object-fit: cover;
}
.item-cart {
    border-top: 0;
}
.item-cart > div {
    border: 1px solid #cacaca;
    border-top: 0;
    padding: 10px;
}
.item-cart > div:first-child { border-left: 1px solid #cacaca; }
.cart-header { border-bottom: 0; }
.item-cart .quantity {
    width: 64px;
    box-sizing: border-box;
    text-align: center;
}
.btn-delete {
    background: #fff;
    border: 1px solid #c0392b;
    color: #c0392b;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.btn-delete:hover { background: #c0392b; color: #fff; }
.cart-total {
    box-sizing: border-box;
    width: 100%;
}
.cart-total span { margin-left: 6px; }

/* ---------- Nút chung ---------- */
button, .Button {
    font-family: inherit;
}
.Button {
    display: inline-block;
    box-sizing: border-box;
    height: auto;
    line-height: 20px;
    color: #fff !important;
    border: 0;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none !important;
    text-align: center;
    vertical-align: middle;
    margin: 4px;
}
.Button1 { background: #fd7b3f; }
.Button3 { background: #6f6f6f; }
.Button:hover { opacity: .9; }

/* ---------- Form ---------- */
.form input[type=text], .form input[type=email], .form input[type=tel],
.form input:not([type]), .form select, .form textarea,
.form-cart input, .form-cart select, .form-cart textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
}
.form-cart th, .form-cart td,
.form th, .form td { vertical-align: top; }
.form th { padding-top: 8px; }
.form td textarea { min-height: 90px; }
.form td input[type=radio] { width: auto; margin-right: 6px; }
.form-newsletter input {
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    max-width: 220px;
    width: 100%;
}
.form-newsletter button {
    background: #fd7b3f;
    color: #fff;
    border: 0;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.form-newsletter .title { margin-right: 10px; }

/* ---------- Thông báo lỗi / thành công ---------- */
.flash {
    background: #eef7ee;
    border: 1px solid #bfe0bf;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 0 0 14px;
}
.error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #8a1f14;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 0 0 14px;
}

/* ---------- Chi tiết sản phẩm: gallery ---------- */
#slideImage {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    height: 70px;
}
#slideImage a {
    display: inline-block;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid #ddd;
    margin-right: 6px;
    vertical-align: top;
    background: #fff;
}
#slideImage a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    margin: 0;
    display: block;
}
#mainImageDetail a { display: block; }
#mainImageDetail img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.row-size { margin: 8px 0; }
.row-size select, .row-size input {
    padding: 6px 8px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    font-size: 15px;
    vertical-align: middle;
}
.row-size .n, .product-price .n { font-weight: bold; margin-right: 6px; }
.product-price .v { color: #fd7b3f; font-weight: bold; font-size: 20px; }
.row-item-book { margin: 12px 0; }
.row-item-book button {
    background: #fd7b3f;
    color: #fff;
    border: 0;
    padding: 12px 26px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}
.row-item-book button::before { margin-right: 8px; }
.row-item-book button::before { margin-right: 8px; }
.clearP img { max-width: 100%; height: auto; }
.clearP table { max-width: 100%; }

/* ---------- Danh mục / phân trang ---------- */
.pager .Button { min-width: 40px; padding: 8px 12px; }

/* ---------- Trang thường (chính sách, giới thiệu, hỗ trợ, trang tĩnh) ---------- */
.clearP { line-height: 1.6; font-size: 15px; }
.clearP h3 { margin-top: 18px; }

/* ---------- Chân trang ---------- */
#footPage .item-4 { box-sizing: border-box; padding-right: 12px; }
#footPage ul { padding-left: 0; list-style: none; margin: 0; }
#footPage li { margin: 4px 0; font-size: 15px; }
.copy-right { box-sizing: border-box; }
.back-to-top { text-decoration: none; left: auto !important; right: 10px; bottom: 100px; max-width: 40px; }

/* ---------- Mobile (≤680px) ---------- */
@media screen and (max-width: 680px) {
    /* Giỏ hàng: ẩn tiêu đề cột, mỗi sản phẩm là một khối */
    .cart-header { display: none; }
    .item-cart {
        flex-wrap: wrap;
        border: 1px solid #cacaca;
        margin-bottom: 10px;
        background: #fff;
    }
    .item-cart > div {
        border: 0;
        padding: 8px;
        min-height: 0;
    }
    .item-cart .title-cart {
        flex: 0 0 100%;
        justify-content: flex-start;
        min-height: 0;
        border-bottom: 1px solid #eee;
    }
    .item-cart .quantity-cart,
    .item-cart .price-cart,
    .item-cart .total-price-cart,
    .item-cart .delete-cart {
        flex: 0 0 25%;
        font-size: 13px;
    }
    .item-cart .title-cart img { width: 60px; height: 60px; flex-basis: 60px; }
    .cart-total { text-align: left; }

    /* Chi tiết sản phẩm: ảnh và thông tin xếp dọc */
    .detail-left, .detail-right { width: 100% !important; }
    .detail-right { margin-top: 16px; }
    #slideImage a { width: 56px; height: 56px; }

    /* Form thanh toán: nhãn và ô nhập xếp dọc */
    .form-cart, .form { display: block; }
    .form-cart tr, .form tr { display: block; margin-bottom: 8px; }
    .form-cart th, .form th { display: block; width: auto; padding-bottom: 4px; }
    .form-cart td, .form td { display: block; width: 100%; padding: 0 0 6px; box-sizing: border-box; }
    .form-cart, .form { width: 100%; }
    .form td input, .form td select, .form td textarea,
    .form-cart td input, .form-cart td select, .form-cart td textarea { width: 100% !important; }

    /* Footer: 1 cột */
    #footPage .list-item .item-4 { width: 100% !important; }
    .copy-right .form-newsletter { display: block; width: 100%; }
    .form-newsletter input { max-width: 100%; margin-bottom: 6px; }

    /* Breadcrumb và tiêu đề gọn hơn */
    .title-large { font-size: 18px; }
    .breadcrumb > li { font-size: 13px; }
}

/* ---------- Tablet (681–1024px) ---------- */
@media screen and (min-width: 681px) and (max-width: 1024px) {
    .item-cart .title-cart img { width: 60px; height: 60px; flex-basis: 60px; }
    .item-cart > div { font-size: 14px; }
}

/* ======================================================================
 * Phong cách 2026: thẻ sản phẩm bo góc, bóng nhẹ, hiệu ứng hover mượt
 * ====================================================================== */
:root {
    --fc-accent: #fd7b3f;
    --fc-accent-dark: #e4602a;
    --fc-ink: #1d1f24;
    --fc-muted: #6b7280;
    --fc-radius: 16px;
    --fc-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
    --fc-shadow-hover: 0 14px 30px rgba(16, 24, 40, .14);
}
body { color: var(--fc-ink); }

/* Thẻ sản phẩm */
.product-item {
    background: #fff;
    border: 0 !important;
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 6px 14px;
    transition: transform .25s ease, box-shadow .25s ease;
}
.product-item:hover { transform: translateY(-4px); box-shadow: var(--fc-shadow-hover); }
.product-item .wrap-img { position: relative; background: #f4f5f7; overflow: hidden; }
.product-item .wrap-img img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: contain; /* hiện trọn ảnh sản phẩm trong thẻ, không cắt logo/chi tiết */
    padding: 6px;
    box-sizing: border-box;
    transition: transform .5s ease;
}
.product-item:hover .wrap-img img { transform: scale(1.05); }
.product-item .name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    line-height: 1.3;
    padding: 10px 12px 0;
    color: var(--fc-ink);
    font-weight: 700;
    text-transform: none;
    text-decoration: none;
}
.product-item .price {
    padding: 6px 12px 14px;
    margin-top: auto;
    color: var(--fc-accent-dark);
    font-weight: 800;
    font-size: 17px;
}
.product-item .add-cart {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 9px 0;
    text-align: center;
    background: var(--fc-ink);
    color: #fff;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}
.product-item:hover .add-cart { opacity: 1; transform: none; }
@media (hover: none) { .product-item .add-cart { opacity: 1; transform: none; } }

/* Nhãn Hot / Sale */
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
}
.badge-sale { background: #e11d48; }
.badge-hot { background: var(--fc-ink); }

/* Tiêu đề khối danh mục: link con dạng pill */
.title-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.title-box > a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #f3c4ad;
    border-radius: 999px;
    color: var(--fc-accent-dark);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.title-box > a:hover { background: var(--fc-accent); color: #fff; border-color: var(--fc-accent); }
.title-box > a.more { margin-left: auto; background: var(--fc-accent); color: #fff; border-color: var(--fc-accent); }
.title-box > a.more:hover { background: var(--fc-accent-dark); }

/* Nút và liên kết */
.Button { border-radius: 999px; padding: 11px 24px; }
.Button1 { background: var(--fc-accent); }
.Button1:hover { background: var(--fc-accent-dark); }
.row-item-book button { border-radius: 999px; padding: 13px 30px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(253, 123, 63, .45);
    outline-offset: 2px;
}

/* Banner sản phẩm và chính sách: bo góc */
#wrapBannerProduct a.banner-product img,
.box-banner img, .banner-item img { border-radius: var(--fc-radius); }
#slider2_container { border-radius: 0 0 var(--fc-radius) var(--fc-radius); }

/* Khối danh mục trên trang chủ: khoảng cách rõ ràng */
.box-cate { margin-bottom: 28px; }
.box-cate .list-item-2 { margin-top: 6px; }

/* Ô tìm kiếm header bo tròn */
#formSearch input, #formSearch2 input { border-radius: 999px; }
#formSearch button, #formSearch2 button { border-radius: 0 999px 999px 0; }

/* Banner sản phẩm: giữ nguyên toàn bộ ảnh (không cắt tên sản phẩm trong ảnh) */
#wrapBannerProduct a.banner-product img {
    object-fit: contain;
    background: #f2f2f2;
    border-radius: var(--fc-radius);
}

/* ---------- Chống tràn ngang do nội dung dài (đường dẫn ảnh, chuỗi không có khoảng trắng) ---------- */
.clearP, .detail-left, .detail-right, .inner-item, .list-item, .page-width, .title-foot,
.box-cate, .item-6, .item-4, .product-item .name, .cart-header, .item-cart { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.clearP img, .detail-left img, .page-width img { max-width: 100%; height: auto; }

/* ---------- Tiêu đề mục trang chủ: link "Xem thêm" nằm cùng hàng, bên phải ---------- */
.box-cate .title-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 58px; }
.box-cate .title-box > span { line-height: 57px; }
.box-cate .title-box > a:not(.more) { font-size: 14px; color: #e76534; text-decoration: none; }
.box-cate .title-box .more { margin-left: auto; align-self: center; padding: 5px 16px; border: 1px solid #e76534; border-radius: 20px; background: #fff !important;
    color: #e76534; font-size: 14px; line-height: 1.4; text-decoration: none; white-space: nowrap; }
.box-cate .title-box .more:hover { background: #e76534 !important; color: #fff !important; }

/* Trang chi tiết sản phẩm: bỏ khối "Sản phẩm liên quan" nên nội dung chiếm toàn bộ chiều ngang */
.detail-left { width: 100%; }

/* Footer: icon thanh toán và mạng xã hội */
.payment-icons, .social-icons { margin: 10px 0 0; }
.payment-icons i { font-size: 34px; color: #555; margin: 0 10px 6px 0; }
.social-icons a { display: inline-block; margin: 0 8px 6px 0; color: #555; font-size: 26px; text-decoration: none; }
.social-icons a:hover, .payment-icons i:hover { color: #e76534; }
