/* Giỏ hàng kiểu Coolmate (inc/gemmi-cart.php): ô chọn Màu / Size + nút − số lượng + trong giỏ. */
html body .gm-ci {
    margin-top: 8px;
    font-size: 13px;
}
html body .gm-ci__vars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
html body .gm-ci__sel {
    margin: 0;
    font-weight: 400;
}
html body .gm-ci__sel select {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    min-width: 76px;
    max-width: 150px;
    height: 32px;
    margin: 0;
    padding: 0 28px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center / 10px 7px;
    box-shadow: none;
    color: #111;
    font-size: 13px;
    line-height: 30px;
    cursor: pointer;
}
html body .gm-ci__sel select:focus {
    border-color: #111;
}
html body .gm-ci__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
html body .gm-ci__qty {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    background: #fff;
}
html body .gm-ci__step {
    width: 32px;
    min-width: 0;
    height: 30px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #111;
    font-size: 17px;
    font-weight: 400;
    line-height: 30px;
    box-shadow: none;
}
html body .gm-ci__step:disabled {
    opacity: .3;
    cursor: default;
}
html body .gm-ci__num {
    -moz-appearance: textfield;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
html body .gm-ci__num::-webkit-inner-spin-button,
html body .gm-ci__num::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
html body .gm-ci__total {
    color: #111;
    font-size: 14px;
    font-weight: 700;
}
html body .gm-ci__err {
    margin: 6px 0 0;
    color: #c4161c;
    font-size: 12px;
}
html body .gm-ci-busy {
    opacity: .5;
    pointer-events: none;
    transition: opacity .15s;
}
/* Trang giỏ hàng: ô chọn ngay dưới tên. */
html body .gm-ci--page {
    margin-top: 6px;
}
html body .gm-ci--page .gm-ci__vars {
    margin-bottom: 0;
}
/* Trang giỏ hàng: số lượng tự cập nhật nên ẩn nút "Cập nhật giỏ hàng"; ô số lượng cùng kiểu bo tròn. */
html body .woocommerce-cart-form button[name="update_cart"] {
    display: none !important;
}
html body .woocommerce-cart-form .ux-quantity {
    display: inline-flex;
    align-items: center;
    height: 32px;
    overflow: hidden;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    background: #fff;
}
html body .woocommerce-cart-form .ux-quantity .button {
    width: 30px;
    height: 30px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #111;
    font-size: 16px;
    line-height: 30px;
}
html body .woocommerce-cart-form .ux-quantity input.qty {
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #111;
    font-weight: 600;
}
html body .gm-ci--page .gm-ci__vars {
    gap: 4px;
}
html body .gm-ci--page .gm-ci__sel select {
    min-width: 62px;
    padding-right: 24px;
    background-position: right 9px center;
}
/* ---------- Dòng dưới: số lượng thu gọn (trái) · giá + "Tiết kiệm xxxK" chữ nhỏ (phải) ---------- */
html body .gm-ci__qty {
    height: 30px;
    border-radius: 15px;
}
html body .gm-ci__step {
    width: 26px;
    height: 28px;
    font-size: 16px;
    line-height: 28px;
}
html body .gm-ci__num {
    width: 24px;
    height: 28px;
    font-size: 13px;
}
html body .gm-ci__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0 6px;
    min-width: 0;
    text-align: right;
}
html body .gm-ci__save {
    color: #a50e43;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
/* Trang giỏ hàng (điện thoại và PC dùng chung): ẩn cột Giá / Số lượng / Tạm tính của bảng; mỗi món có dòng
 * số lượng · giá + "Tiết kiệm" ngay dưới ô Màu / Size, giống giỏ trượt. */
html body .woocommerce-cart-form .product-price,
html body .woocommerce-cart-form .product-quantity,
html body .woocommerce-cart-form .product-subtotal,
html body .woocommerce-cart-form .mobile-product-price {
    display: none !important;
}
html body .gm-ci--page .gm-ci__row {
    margin-top: 8px;
}
@media (min-width: 850px) {
    /* PC: khối chọn + số lượng · giá gọn trong 420px, không kéo dài hết bề ngang bảng. */
    html body .gm-ci--page {
        max-width: 420px;
    }
    html body .gm-ci--page .gm-ci__vars {
        max-width: 320px;
    }
    html body .gm-ci--page .gm-ci__total {
        font-size: 16px;
    }
}
/* ---------- Màu + Size luôn 1 dòng: 2 ô bằng nhau, cách nhau 10px; tên dài thì "…" ---------- */
html body .gm-ci__vars,
html body .gm-ci--page .gm-ci__vars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    max-width: 260px;
}
html body .gm-ci__sel,
html body .gm-ci__sel select,
html body .gm-ci--page .gm-ci__sel select {
    width: 100%;
    min-width: 0;
    max-width: none;
}
html body .gm-ci__sel select,
html body .gm-ci--page .gm-ci__sel select {
    height: 34px;
    padding: 0 28px 0 12px;
    border-radius: 17px;
    background-position: right 11px center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* Ô màu (tên dài hơn, vd "Hồng Phấn") rộng hơn ô size. */
html body .gm-ci__vars,
html body .gm-ci--page .gm-ci__vars {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    max-width: 280px;
}
html body .gm-ci__vars > .gm-ci__sel:only-child {
    grid-column: 1 / -1;
}

/* ---------- Điện thoại: chuyển sang trang giỏ hàng riêng có hiệu ứng (js/gemmi-cart.js) ---------- */
html.gm-go-cart #main {
    opacity: 0;
    transform: translateX(-28px);
    transition: opacity .18s ease-in, transform .18s ease-in;
}
html.gm-cart-in #main {
    animation: gm-cart-in .38s cubic-bezier(.22, .9, .24, 1) both;
}
@keyframes gm-cart-in {
    from {
        opacity: 0;
        transform: translateX(48px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    html.gm-go-cart #main,
    html.gm-cart-in #main {
        animation: none;
        transition: none;
        transform: none;
    }
}

/* ---------- Trang giỏ hàng (điện thoại): thanh "Tổng cộng + THANH TOÁN" cố định ở đáy ---------- */
html body .gm-cart-bar {
    display: none;
}
@media (max-width: 849px) {
    html body .gm-cart-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
    }
    html body .gm-cart-bar__sum {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.3;
    }
    html body .gm-cart-bar__sum span {
        color: #666;
        font-size: 13px;
    }
    html body .gm-cart-bar__sum b,
    html body .gm-cart-bar__sum b .amount {
        color: #111;
        font-size: 18px;
        font-weight: 700;
    }
    html body .gm-cart-bar__btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 50px;
        border-radius: 25px;
        background: #111;
        color: #fff !important;
        font-size: 17px;
        font-weight: 700;
        text-transform: uppercase;
    }
    /* Chừa chỗ cho thanh ở đáy trang; nút chat / lên đầu trang nâng lên trên thanh. */
    html body.woocommerce-cart .footer-wrapper {
        padding-bottom: 76px;
    }
    html body.woocommerce-cart .addThis_contact__icons,
    html body.woocommerce-cart .gm-totop {
        bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }
}
