/* Thêm nhanh vào giỏ hàng trên thẻ sản phẩm, kiểu Coolmate (inc/gemmi-quick-add.php). */
.gm-qa {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: none;
}
.gm-qa > * {
    pointer-events: auto;
}

/* Nút túi ở góc ảnh: chỉ trên màn hình cảm ứng */
.gm-qa__bag {
    position: absolute;
    right: 7px;
    bottom: 7px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #222;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: transform .15s, background .15s;
}
@media (max-width: 549px) {
    /* Icon to, viền (phần nền quanh icon) mỏng */
    .gm-qa__bag {
        right: 6px;
        bottom: 6px;
        width: 28px;
        height: 28px;
    }
    .gm-qa .gm-qa__bag svg {
        width: 21px;
        height: 21px;
        stroke-width: 1.4;
    }
}
.gm-qa__bag:active {
    transform: scale(.92);
    background: #fff;
}
.gm-qa__bag svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.5;
}
/* Màn hình cảm ứng hoặc khung hẹp kiểu điện thoại: nút túi + khung trượt */
@media (hover: none), (pointer: coarse), (max-width: 549px) {
    .gm-qa__bag {
        display: flex;
    }
    .gm-qa__panel {
        display: none;
    }
}

/* Khung kính mờ hiện khi rê chuột vào thẻ (máy tính) */
.gm-qa__panel {
    margin: 0 6px 6px;
    padding: 6px 6px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.product-small.col:hover .gm-qa__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.gm-qa__title {
    margin-bottom: 5px;
    color: #111;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}
.gm-qa__title span {
    margin-left: 2px;
    font-size: 14px;
    font-weight: 400;
}
.gm-qa__label {
    margin: 12px 0 8px;
    color: #555;
    font-size: 13px;
}
.gm-qa__label b {
    color: #111;
}

.gm-qa__sizes,
.gm-qa__colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.gm-qa__colors {
    margin-bottom: 5px;
}
.gm-qa__panel .gm-qa__sizes,
.gm-qa__panel .gm-qa__colors {
    gap: 5px;
}
.gm-qa .gm-qa__size,
.gm-qa-sheet .gm-qa__size {
    position: relative;
    min-width: 32px;
    height: 28px;
    min-height: 0;
    margin: 0;
    padding: 0 6px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: 0;
    text-transform: none;
    transition: background .15s, color .15s;
}
.gm-qa .gm-qa__size:hover,
.gm-qa-sheet .gm-qa__size:hover,
.gm-qa__size.is-loading {
    background: #111;
    color: #fff;
}
/* Size hết hàng: chữ mờ + gạch chéo */
.gm-qa .gm-qa__size.is-off,
.gm-qa-sheet .gm-qa__size.is-off {
    background: rgba(255, 255, 255, .5) linear-gradient(to top right, transparent calc(50% - .5px), #c8c8c8 50%, transparent calc(50% + .5px));
    color: #c2c2c2;
    cursor: not-allowed;
}
.gm-qa__color {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 1px #ddd;
}
.gm-qa__color.is-on {
    box-shadow: 0 0 0 2px #111;
}
.gm-qa__color span {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    /* Màu trắng có --swatch-color rỗng: vẫn hiện nền trắng */
    background-color: #fff;
    background-image: linear-gradient(var(--swatch-color), var(--swatch-color));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.gm-qa .gm-qa__add,
.gm-qa-sheet .gm-qa__add {
    width: 100%;
    height: 30px;
    min-height: 0;
    margin: 0;
    border-radius: 15px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: 0;
    text-transform: none;
}
.gm-qa__size.is-loading,
.gm-qa__add.is-loading {
    pointer-events: none;
    opacity: .6;
}

/* Khung trượt từ dưới lên (điện thoại) */
.gm-qa-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    transition: visibility .25s;
}
.gm-qa-sheet.is-open {
    visibility: visible;
}
.gm-qa-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .25s;
}
.gm-qa-sheet.is-open .gm-qa-sheet__backdrop {
    opacity: 1;
}
.gm-qa-sheet__box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    background: #fff;
    transform: translateY(100%);
    transition: transform .25s ease-out;
}
.gm-qa-sheet.is-open .gm-qa-sheet__box {
    transform: none;
}
.gm-qa-sheet__close {
    position: absolute;
    top: -52px;
    right: 12px;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 26px;
    line-height: 40px;
}
.gm-qa-sheet__head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eee;
}
.gm-qa-sheet__head img {
    width: 56px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
}
.gm-qa-sheet__name {
    color: #111;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}
.gm-qa-sheet__price {
    margin-top: 4px;
    color: #a50e43;
    font-weight: 700;
}
.gm-qa-sheet .gm-qa__title {
    text-align: left;
    font-size: 16px;
}
.gm-qa-sheet .gm-qa__sizes,
.gm-qa-sheet .gm-qa__colors {
    justify-content: flex-start;
    gap: 8px;
}
.gm-qa-sheet .gm-qa__size {
    min-width: 52px;
    height: 44px;
    line-height: 44px;
    border-radius: 8px;
    background: #f1f1f1;
    font-size: 15px;
}
.gm-qa-sheet .gm-qa__size.is-off {
    background: #f7f7f7 linear-gradient(to top right, transparent calc(50% - .5px), #d6d6d6 50%, transparent calc(50% + .5px));
}
.gm-qa-sheet .gm-qa__color {
    width: 34px;
    height: 34px;
}
.gm-qa-sheet .gm-qa__color span {
    width: 28px;
    height: 28px;
}
.gm-qa-sheet .gm-qa__add {
    height: 48px;
    margin-top: 8px;
    border-radius: 24px;
    font-size: 15px;
    line-height: 48px;
}
html.gm-qa-lock,
html.gm-qa-lock body {
    overflow: hidden;
}

/* Bảng "Thêm vào giỏ hàng thành công" (kiểu Coolmate): trượt xuống từ trên, tự ẩn sau 5 giây */
.gm-added {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 100002;
    max-width: 400px;
    margin: 0 auto;
    padding: 16px 16px 14px;
    border-radius: 16px;
    background: #fff;
    color: #111;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -24px, 0);
    transition: transform .35s cubic-bezier(.22, .9, .24, 1), opacity .25s ease, visibility 0s linear .35s;
    will-change: transform, opacity;
}
.gm-added.is-show {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: transform .35s cubic-bezier(.22, .9, .24, 1), opacity .25s ease, visibility 0s;
}
@media (min-width: 850px) {
    .gm-added {
        top: 110px;
        left: auto;
        right: 24px;
        width: 380px;
    }
}
.gm-added__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 700;
}
.gm-added__ok {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2e9e5b;
    color: #fff;
    font-size: 13px;
}
.gm-added .gm-added__close {
    width: 30px;
    height: 30px;
    min-height: 0;
    margin: 0 -6px 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 24px;
    line-height: 30px;
}
/* Thanh nhận quà: tiến tới Miễn phí vận chuyển */
.gm-added__gift {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fbeef3;
    color: #5a1530;
    font-size: 13px;
    line-height: 1.4;
}
.gm-added__gift-text {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gm-added__gift-text svg {
    flex: none;
    width: 20px;
    height: 20px;
    color: #a50e43;
}
.gm-added__gift b {
    color: #a50e43;
}
.gm-added__bar {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(165, 14, 67, .15);
}
.gm-added__bar i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #d4245f, #a50e43);
    transition: width .6s ease .2s;
}
.gm-added__gift.is-done {
    background: #eaf7ef;
    color: #1d5c37;
}
.gm-added__gift.is-done b,
.gm-added__gift.is-done svg {
    color: #2e9e5b;
}
.gm-added__gift.is-done .gm-added__bar {
    background: rgba(46, 158, 91, .15);
}
.gm-added__gift.is-done .gm-added__bar i {
    background: #2e9e5b;
}
.gm-added__item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.gm-added__item img {
    flex: none;
    width: 64px;
    height: 85px;
    border-radius: 8px;
    object-fit: cover;
}
.gm-added__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}
.gm-added__opts {
    margin-top: 3px;
    color: #777;
    font-size: 13px;
}
.gm-added__price {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
}
.gm-added__price .amount {
    color: #111;
}
.gm-added__view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    margin-top: 14px;
    border: 1.5px solid #111;
    border-radius: 22px;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.gm-added__view:hover {
    background: #111;
    color: #fff;
}

/* Dòng nhắc trong giỏ hàng: "Yên tâm đổi hàng tại nhà - Freeship đơn từ 2 sản phẩm" */
.gm-cart-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 10px 10px 12px;
    border-radius: 10px;
    background: #fbeef3;
    color: #a50e43;
    font-size: 15px;
    container-type: inline-size;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}
html.gm-cart-note-off .gm-cart-note {
    display: none;
}
.gm-cart-note__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #a50e43;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.gm-cart-note__text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    /* Đúng 1 dòng, chữ tự to vừa khít bề ngang khung (tối đa 17px) */
    font-size: min(17px, calc((100cqw - 30px) / 26.2));
    letter-spacing: -.1px;
    font-weight: 600;
    white-space: nowrap;
}
.gm-cart-note .gm-cart-note__close {
    flex: none;
    width: 24px;
    height: 24px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a50e43;
    font-size: 22px;
    line-height: 24px;
}

/* Trong giỏ trượt (khung hẹp): dòng nhắc tràn hết bề ngang để chữ to nhất có thể */
.off-canvas-cart .gm-cart-note {
    margin: 0 -24px 14px;
    border-radius: 0;
}
@media (max-width: 549px) {
    .off-canvas-cart .cart-popup-inner {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .off-canvas-cart .gm-cart-note {
        margin: 0 -10px 14px;
        border-radius: 8px;
    }
}

/* Thông báo lỗi (hết hàng, mất mạng...) */
.gm-qa-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -12px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.gm-qa-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.gm-qa-toast__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d63638;
    font-size: 13px;
    font-weight: 700;
}
@media (max-width: 549px) {
    .gm-qa-toast {
        top: auto;
        bottom: 80px;
        font-size: 13px;
        transform: translate(-50%, 12px);
    }
}
