/* =================================================================== */
/* === MATKHAU.VN - HEADER BUTTONS (CART & ACCOUNT)                === */
/* === Thiết kế nút đôi Xanh Dương & Đỏ chuẩn Brand Identity       === */
/* =================================================================== */

/* Container chứa cả 2 nút */
.mks-header-actions-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    vertical-align: middle !important;
}

/* Base style cho cả 2 nút */
.mks-header-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    height: 38px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    position: relative !important;
    border: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Icon chung */
.mks-header-btn__icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.mks-header-btn__icon svg {
    width: 17px !important;
    height: 17px !important;
    stroke: currentColor !important;
    transition: transform 0.22s ease !important;
}

.mks-header-btn:hover .mks-header-btn__icon svg {
    transform: scale(1.12) !important;
}

/* 1. NÚT TÀI KHOẢN (MÀU XANH DƯƠNG MATKHAU.VN) */
.mks-header-btn--account {
    background-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px -1px rgba(37, 99, 235, 0.35), 0 1px 3px rgba(37, 99, 235, 0.2) !important;
}

.mks-header-btn--account:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 5px 14px -2px rgba(37, 99, 235, 0.45) !important;
}

.mks-header-btn--account:active {
    transform: translateY(0) !important;
}

/* 2. NÚT GIỎ HÀNG (MÀU ĐỎ HỒNG THƯƠNG HIỆU MATKHAU.VN) */
.mks-header-btn--cart {
    background-color: #fb3c59 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px -1px rgba(251, 60, 89, 0.35), 0 1px 3px rgba(251, 60, 89, 0.2) !important;
}

.mks-header-btn--cart:hover {
    background-color: #e02844 !important;
    color: #ffffff !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 5px 14px -2px rgba(251, 60, 89, 0.45) !important;
}

.mks-header-btn--cart:active {
    transform: translateY(0) !important;
}

/* Huy hiệu (Badge) đếm số lượng giỏ hàng */
.mks-header-btn__badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border-radius: 9999px !important;
    background-color: #ffffff !important;
    color: #fb3c59 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    margin-left: 2px !important;
    transition: transform 0.2s ease, background 0.2s ease !important;
}

.mks-header-btn--cart:hover .mks-header-btn__badge {
    transform: scale(1.08) !important;
}

/* =================================================================== */
/* === TỰ ĐỘNG NÂNG CẤP VÀ ĐỒNG BỘ NÚT BRICKS & SHORTCODE CŨ TRÊN WEB === */
/* =================================================================== */

/* Nâng cấp nút mini-cart gốc của Bricks */
.brxe-woocommerce-mini-cart .bricks-woo-toggle {
    background-color: #fb3c59 !important;
    color: #ffffff !important;
    height: 38px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    box-shadow: 0 2px 6px -1px rgba(251, 60, 89, 0.35), 0 1px 3px rgba(251, 60, 89, 0.2) !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    line-height: 1 !important;
    border: none !important;
}

.brxe-woocommerce-mini-cart .bricks-woo-toggle:hover {
    background-color: #e02844 !important;
    color: #ffffff !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 5px 14px -2px rgba(251, 60, 89, 0.45) !important;
}

.brxe-woocommerce-mini-cart .bricks-woo-toggle:active {
    transform: translateY(0) !important;
}

/* Ẩn icon ti-shopping-cart đơn điệu cũ của Bricks */
.brxe-woocommerce-mini-cart .bricks-woo-toggle i.ti-shopping-cart {
    display: none !important;
}

.brxe-woocommerce-mini-cart .bricks-woo-toggle .cart-icon {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}

/* Chèn icon giỏ hàng SVG hiện đại mới */
.brxe-woocommerce-mini-cart .bricks-woo-toggle .cart-icon::before {
    content: '' !important;
    display: inline-block !important;
    width: 17px !important;
    height: 17px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    transition: transform 0.22s ease !important;
}

.brxe-woocommerce-mini-cart .bricks-woo-toggle:hover .cart-icon::before {
    transform: scale(1.12) !important;
}

/* Chèn nhãn "Giỏ hàng" rõ ràng */
.brxe-woocommerce-mini-cart .bricks-woo-toggle .cart-icon::after {
    content: 'Giỏ hàng' !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

/* Badge số lượng của Bricks */
.brxe-woocommerce-mini-cart .bricks-woo-toggle .cart-count {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border-radius: 9999px !important;
    background-color: #ffffff !important;
    color: #fb3c59 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    margin-left: 2px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
}

/* Nâng cấp nút tài khoản cũ của Bricks / mks_auth_button */
.mks-header-auth-item.mks-style-header {
    background-color: #2563eb !important;
    color: #ffffff !important;
    height: 38px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    box-shadow: 0 2px 6px -1px rgba(37, 99, 235, 0.35), 0 1px 3px rgba(37, 99, 235, 0.2) !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1 !important;
}

.mks-header-auth-item.mks-style-header:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 5px 14px -2px rgba(37, 99, 235, 0.45) !important;
}

.mks-header-auth-item.mks-style-header:active {
    transform: translateY(0) !important;
}

.mks-header-auth-item.mks-style-header .mks-header-auth-icon {
    stroke: #ffffff !important;
}

/* Căn chỉnh khoảng cách trong header */
.woo-header-one__items,
#brxe-zrrfwp {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* =================================================================== */
/* === RESPONSIVE CHO MÀN HÌNH DI ĐỘNG (< 768px)                  === */
/* =================================================================== */
@media (max-width: 640px) {
    .mks-header-btn,
    .brxe-woocommerce-mini-cart .bricks-woo-toggle,
    .mks-header-auth-item.mks-style-header {
        height: 34px !important;
        padding: 0 10px !important;
        font-size: 12.5px !important;
        gap: 5px !important;
    }

    .mks-header-btn__icon svg,
    .brxe-woocommerce-mini-cart .bricks-woo-toggle .cart-icon::before {
        width: 15px !important;
        height: 15px !important;
    }

    .mks-header-actions-group,
    .woo-header-one__items,
    #brxe-zrrfwp {
        gap: 6px !important;
    }
}

/* =================================================================== */
/* === MATKHAU.VN - SLIDEOUT MINI CART POPUP (OFF-CANVAS)           === */
/* =================================================================== */

.mks-sidecart-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.48) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    z-index: 999998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.28s ease, visibility 0.28s ease !important;
    pointer-events: none !important;
}

.mks-sidecart-backdrop.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body.mks-sidecart-open {
    overflow: hidden !important;
}

.mks-sidecart-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 400px !important;
    max-width: 90vw !important;
    background: #ffffff !important;
    z-index: 999999 !important;
    box-shadow: -4px 0 30px rgba(15, 23, 42, 0.16) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    box-sizing: border-box !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.mks-sidecart-drawer.is-open {
    transform: translateX(0) !important;
}

/* Header giỏ hàng */
.mks-sidecart-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
}

.mks-sidecart-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.mks-sidecart-title svg {
    stroke: #fb3c59 !important;
}

.mks-sidecart-close {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.mks-sidecart-close:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    transform: rotate(90deg) !important;
}

/* Body giỏ hàng */
.mks-sidecart-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 18px 20px !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-direction: column !important;
}

.mks-sidecart-body .widget_shopping_cart_content {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Danh sách sản phẩm trong giỏ */
.mks-sidecart-body ul.woocommerce-mini-cart {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item {
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item a:not(.remove) {
    color: #0f172a !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    display: block !important;
    padding-right: 24px !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item a:not(.remove):hover {
    color: #fb3c59 !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    flex-shrink: 0 !important;
    float: none !important;
    margin: 0 !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item .quantity {
    display: block !important;
    margin-top: 4px !important;
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 500 !important;
}

.mks-sidecart-body li.woocommerce-mini-cart-item .quantity .amount {
    font-weight: 700 !important;
    color: #fb3c59 !important;
    margin-left: 2px !important;
}

/* Nút xóa sản phẩm (x) */
.mks-sidecart-body a.remove {
    position: absolute !important;
    top: 14px !important;
    right: 0 !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #fee2e2 !important;
    color: #ef4444 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.mks-sidecart-body a.remove:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

/* Tổng số phụ */
.mks-sidecart-body .woocommerce-mini-cart__total {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 0 14px !important;
    border-top: 1.5px solid #e2e8f0 !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
}

.mks-sidecart-body .woocommerce-mini-cart__total .amount {
    font-size: 17.5px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

/* 2 Nút Xem giỏ hàng & Thanh toán */
.mks-sidecart-body .woocommerce-mini-cart__buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 0 10px 0 !important;
}

.mks-sidecart-body .woocommerce-mini-cart__buttons a.button {
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* Nút Xem giỏ hàng */
.mks-sidecart-body .woocommerce-mini-cart__buttons a.button:not(.checkout) {
    background: #fb3c59 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(251, 60, 89, 0.25) !important;
}

.mks-sidecart-body .woocommerce-mini-cart__buttons a.button:not(.checkout):hover {
    background: #e02844 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(251, 60, 89, 0.35) !important;
}

/* Nút Thanh toán */
.mks-sidecart-body .woocommerce-mini-cart__buttons a.button.checkout {
    background: #e11d48 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25) !important;
}

.mks-sidecart-body .woocommerce-mini-cart__buttons a.button.checkout:hover {
    background: #be123c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.35) !important;
}

/* Trạng thái giỏ hàng trống */
.mks-sidecart-body .woocommerce-mini-cart__empty-message {
    text-align: center !important;
    padding: 40px 10px !important;
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

