/* =================================================================== */
/* === DABILUX QUICK BUY - MAIN STYLESHEET (POPUP & BUTTON) === */
/* =================================================================== */

.mks-after-add-to-cart-wrapper {
    margin-top: 16px;
}

.mks-quick-buy-button {
    width: 100%;
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 2;
    text-align: center;
}

.mks-quick-buy-button:hover {
    background-color: #1d4ed8;
}

.mks-quick-buy-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

#mksPopupOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s;
    z-index: 99998;
    opacity: 1;
    pointer-events: auto;
}

#mksPopupOverlay.mks-hidden {
    opacity: 0;
    pointer-events: none;
}

#mksQuickBuyPopup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 99999;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    overflow-y: auto;
}

#mksQuickBuyPopup.mks-hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

#mksQuickBuyPopup .mks-popup-content {
    background-color: white;
    width: 100%;
    max-width: 1000px !important;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    display: flex;
    flex-direction: column;
    text-align: left;
}

#mksQuickBuyPopup .mks-popup-column {
    padding: 24px;
}

#mksQuickBuyPopup .mks-popup-column-left {
    width: 100%;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
}

#mksQuickBuyPopup .mks-popup-column-right {
    width: 100%;
    position: relative;
}

#mksQuickBuyPopup .mks-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 24px;
}

#mksQuickBuyPopup .mks-popup-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

#mksQuickBuyPopup .mks-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

#mksQuickBuyPopup .mks-product-summary {
    display: flex;
    gap: 16px;
}

#mksQuickBuyPopup .mks-product-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    flex-shrink: 0;
}

#mksQuickBuyPopup .mks-product-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#mksQuickBuyPopup .mks-product-name {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
    font-size: 16px;
}

#mksQuickBuyPopup .mks-product-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8px;
}

#mksQuickBuyPopup .mks-product-variation-name {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

#mksQuickBuyPopup .mks-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
}

#mksQuickBuyPopup .mks-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
    width: 100px;
    height: 35px;
    box-sizing: border-box;
}

#mksQuickBuyPopup .mks-quantity-btn {
    padding: 4px 8px;
    font-size: 16px;
    color: #4b5563;
    background: transparent;
    border: none;
    cursor: pointer;
}

#mksQuickBuyPopup .mks-quantity-btn:hover {
    background-color: #f3f4f6;
}

#mksQuickBuyPopup .mks-quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    background-color: white;
    padding: 4px;
    font-size: 14px;
    outline: none;
}

#mksQuickBuyPopup .mks-quantity-input:focus {
    outline: none;
    background-color: #f9fafb;
}

#mksQuickBuyPopup .mks-voucher-container {
    margin-top: 24px;
}





#mksQuickBuyPopup .mks-progress-bar-fg.mks-progress-animated {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #7c3aed, #3b82f6);
    background-size: 300% 100%;
    animation: mks-progress-shine 3s ease-in-out infinite;
}

#mksQuickBuyPopup .mks-progress-bar-fg.mks-progress-complete {
    background: linear-gradient(90deg, #059669, #10b981, #34d399);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

#mksQuickBuyPopup .mks-progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 32px;
    text-align: center;
}

/* Progress Remaining */
#mksQuickBuyPopup .mks-progress-remaining {
    text-align: center;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Freeship Message */
#mksQuickBuyPopup .mks-freeship-message {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    padding: 16px;
    border-radius: 10px;
    margin: 0;
}

#mksQuickBuyPopup .mks-freeship-message.mks-freeship-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border: 2px solid #10b981;
    font-weight: 700;
}

/* Free Shipping Option Highlight */
#mksQuickBuyPopup .mks-option input[value*="free_shipping"]+.mks-option-label {

    border-color: #0ea5e9;
    color: #0c4a6e;
    font-weight: 600;
}

#mksQuickBuyPopup .mks-option input[value*="free_shipping"]:checked+.mks-option-label {
    border-color: #10b981;
    color: #065f46;
    font-weight: 700;
}

/* Disabled Shipping Options */
#mksQuickBuyPopup .mks-option.mks-disabled {
    opacity: 0.6;
    pointer-events: none;
}

#mksQuickBuyPopup .mks-option.mks-disabled .mks-option-label {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

#mksQuickBuyPopup .mks-option.mks-disabled input[type="radio"] {
    cursor: not-allowed;
}

/* Active Free Shipping State */
#mksQuickBuyPopup .mks-option input[value*="free_shipping"]:checked+.mks-option-label {

    color: #065f46;
    font-weight: 700;

    position: relative;
}



#mksQuickBuyPopup .mks-option input[value*="free_shipping"]:checked+.mks-option-label::before {
    content: '🎉';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 16px;
    animation: mks-bounce 1s ease-in-out infinite;
}

@keyframes mks-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }

    60% {
        transform: translateY(-2px);
    }
}

@keyframes mks-progress-shine {
    0% {
        background-position: 300% 0;
    }

    100% {
        background-position: -300% 0;
    }
}

#mksQuickBuyPopup .mks-totals-summary {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #374151;
}

#mksQuickBuyPopup .mks-totals-row {
    display: flex;
    justify-content: space-between;
}

#mksQuickBuyPopup .mks-totals-value {
    font-weight: 500;
}

#mksQuickBuyPopup .mks-totals-row-final {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

#mksQuickBuyPopup .mks-totals-value-final {
    color: #2563eb;
}

#mksQuickBuyPopup .mks-text-green {
    color: #16a34a;
}

#mksQuickBuyPopup .mks-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#mksQuickBuyPopup .mks-close-button {
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

#mksQuickBuyPopup .mks-close-button:hover {
    color: #4b5563;
}

#mksQuickBuyPopup .mks-close-button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#mksQuickBuyPopup .mks-form-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#mksQuickBuyPopup .mks-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.mks-floating-label-group {
    position: relative;
}

.mks-floating-label {
    border-radius: 5px;
    border: 1px solid #00000023;
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff !important;
    padding: 0 4px;
    z-index: 2;
}

/* Form inputs - Nền trắng từ đầu, override tất cả CSS khác */
#mksQuickBuyPopup .mks-form-input,
#mksQuickBuyPopup textarea.mks-form-input,
#mksQuickBuyPopup select.mks-form-input,
#mksQuickBuyPopup input[type="text"],
#mksQuickBuyPopup input[type="email"],
#mksQuickBuyPopup input[type="tel"],
#mksQuickBuyPopup input[type="number"],
#mksQuickBuyPopup input[type="password"],
#mksQuickBuyPopup input[type="search"],
#mksQuickBuyPopup input[type="url"] {
    width: 100% !important;
    padding: 14px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
    transition: border-color 0.2s !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: unset !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Textarea specific */
#mksQuickBuyPopup textarea.mks-form-input {
    min-height: 110px !important;
    resize: vertical !important;
}

/* Select specific */
#mksQuickBuyPopup select.mks-form-input {
    padding-top: 20px !important;
    padding-bottom: 8px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 8px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* Focus states - Vẫn giữ nền trắng */
.mks-form-input:focus~.mks-floating-label,
.mks-form-input:not(:placeholder-shown)~.mks-floating-label,
.mks-form-input:valid~.mks-floating-label {
    top: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 12px !important;
    color: #4b5563 !important;
    background-color: #ffffff !important;
    padding: 0 4px !important;
}

#mksQuickBuyPopup .mks-form-input:focus,
#mksQuickBuyPopup input[type="text"]:focus,
#mksQuickBuyPopup input[type="email"]:focus,
#mksQuickBuyPopup input[type="tel"]:focus,
#mksQuickBuyPopup input[type="number"]:focus,
#mksQuickBuyPopup input[type="password"]:focus,
#mksQuickBuyPopup input[type="search"]:focus,
#mksQuickBuyPopup input[type="url"]:focus,
#mksQuickBuyPopup select:focus,
#mksQuickBuyPopup textarea:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

#mksQuickBuyPopup .mks-form-input:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="text"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="email"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="tel"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="number"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="password"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="search"]:focus~.mks-floating-label,
#mksQuickBuyPopup input[type="url"]:focus~.mks-floating-label,
#mksQuickBuyPopup select:focus~.mks-floating-label,
#mksQuickBuyPopup textarea:focus~.mks-floating-label {
    color: #2563eb !important;
    background-color: #ffffff !important;
}

/* Error states - Vẫn giữ nền trắng */
#mksQuickBuyPopup .mks-form-input.mks-input-error,
#mksQuickBuyPopup input[type="text"].mks-input-error,
#mksQuickBuyPopup input[type="email"].mks-input-error,
#mksQuickBuyPopup input[type="tel"].mks-input-error,
#mksQuickBuyPopup input[type="number"].mks-input-error,
#mksQuickBuyPopup input[type="password"].mks-input-error,
#mksQuickBuyPopup input[type="search"].mks-input-error,
#mksQuickBuyPopup input[type="url"].mks-input-error,
#mksQuickBuyPopup select.mks-input-error,
#mksQuickBuyPopup textarea.mks-input-error {
    border-color: #ef4444 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

#mksQuickBuyPopup .mks-form-input.mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="text"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="email"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="tel"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="number"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="password"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="search"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup input[type="url"].mks-input-error~.mks-floating-label,
#mksQuickBuyPopup select.mks-input-error~.mks-floating-label,
#mksQuickBuyPopup textarea.mks-input-error~.mks-floating-label {
    color: #ef4444 !important;
    background-color: #ffffff !important;
}

/* Hover states - Vẫn giữ nền trắng */
#mksQuickBuyPopup .mks-form-input:hover,
#mksQuickBuyPopup input[type="text"]:hover,
#mksQuickBuyPopup input[type="email"]:hover,
#mksQuickBuyPopup input[type="tel"]:hover,
#mksQuickBuyPopup input[type="number"]:hover,
#mksQuickBuyPopup input[type="password"]:hover,
#mksQuickBuyPopup input[type="search"]:hover,
#mksQuickBuyPopup input[type="url"]:hover,
#mksQuickBuyPopup select:hover,
#mksQuickBuyPopup textarea:hover {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-color: #9ca3af !important;
}

/* Disabled states - Vẫn giữ nền trắng */
#mksQuickBuyPopup .mks-form-input:disabled,
#mksQuickBuyPopup input[type="text"]:disabled,
#mksQuickBuyPopup input[type="email"]:disabled,
#mksQuickBuyPopup input[type="tel"]:disabled,
#mksQuickBuyPopup input[type="number"]:disabled,
#mksQuickBuyPopup input[type="password"]:disabled,
#mksQuickBuyPopup input[type="search"]:disabled,
#mksQuickBuyPopup input[type="url"]:disabled,
#mksQuickBuyPopup select:disabled,
#mksQuickBuyPopup textarea:disabled {
    background-color: #f9fafb !important;
    background: #f9fafb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

#mksQuickBuyPopup .mks-methods-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

/* Khi shipping container bị ẩn, payment container chiếm full width */
#mksQuickBuyPopup .mks-shipping-container {
    display: none;
}

#mksQuickBuyPopup .mks-payment-container {
    grid-column: 1 / -1;
    /* Chiếm toàn bộ grid */
}

#mksQuickBuyPopup .mks-options-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

#mksQuickBuyPopup .mks-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    transition: border-color 0.2s, background-color 0.2s;
    flex: 1 1 calc(33.333% - 6px);
    /* Desktop: tối đa 3 items/dòng */
    min-width: 150px;
    /* Đảm bảo kích thước tối thiểu */
}

#mksQuickBuyPopup .mks-option.mks-selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

#mksQuickBuyPopup .mks-option-label {
    margin-left: 12px;
    flex-grow: 1;
    color: #1f2937;
}

#mksQuickBuyPopup .mks-option-cost {
    margin-left: auto;
    padding-left: 16px;
    font-weight: 600;
    color: #1f2937;
}

#mksQuickBuyPopup .mks-form-radio {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    flex-shrink: 0;
}

#mksQuickBuyPopup .mks-voucher-message {
    font-size: 14px;
    margin-bottom: 12px;
    min-height: 1.2em;
}

#mksQuickBuyPopup .mks-submit-button {
    width: 100%;
    margin-top: 32px;
    background-color: #2563eb;
    color: white;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    text-align: center;
    line-height: 2;
}

#mksQuickBuyPopup .mks-submit-button:hover {
    background-color: #1d4ed8;
}

#mksQuickBuyPopup .mks-submit-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

#mksQuickBuyPopup .mks-form-input.mks-input-error {
    border-color: #ef4444;
    background-color: #ffffff !important;
}

#mksQuickBuyPopup .mks-form-input.mks-input-error~.mks-floating-label {
    color: #ef4444;
    background-color: #ffffff;
}

#mksQuickBuyPopup .mks-error-message {
    font-size: 13px;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.mks-hidden {
    display: none !important;
}

.mks-processing-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 16px 16px 0;
}

.mks-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: mks-spin 1s linear infinite;
}

@keyframes mks-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



/* === CSS CHO VOUCHER (NHỎ GỌN, SCROLL, VÉ XỊN) === */
#mksQuickBuyPopup .mks-voucher-container {
    margin-top: 24px;
}

#mksQuickBuyPopup .mks-voucher-list {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

#mksQuickBuyPopup .mks-voucher-list::-webkit-scrollbar {
    height: 6px;
}

#mksQuickBuyPopup .mks-voucher-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

#mksQuickBuyPopup .mks-voucher-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#mksQuickBuyPopup .mks-voucher-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

#mksQuickBuyPopup .mks-no-vouchers {
    color: #6b7280;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    width: 100%;
}

#mksQuickBuyPopup .mks-voucher-ticket {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    width: 260px;
    min-height: 80px;
}

/* === THAY ĐỔI: BỎ SHADOW KHI ACTIVE, CHỈ DÙNG VIỀN === */
#mksQuickBuyPopup .mks-voucher-ticket.active {
    border-color: #ef4444;
    border-width: 1.5px;
    box-shadow: none;
    /* Bỏ shadow khi được chọn */
}

#mksQuickBuyPopup .mks-voucher-ticket::before,
#mksQuickBuyPopup .mks-voucher-ticket::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 8px;
    background-color: #f9fafb;
    left: 70px;
    transform: translateX(-50%);
}

#mksQuickBuyPopup .mks-voucher-ticket::before {
    z-index: 9;
    top: -2px;
    border-radius: 0 0 8px 8px;
    border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    transition: border-color 0.2s;
}

#mksQuickBuyPopup .mks-voucher-ticket.active::before {
    border-color: #ef4444;
}

#mksQuickBuyPopup .mks-voucher-ticket::after {
    bottom: -1.5px;
    border-radius: 8px 8px 0 0;
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    transition: border-color 0.2s;
}

#mksQuickBuyPopup .mks-voucher-ticket.active::after {
    border-color: #ef4444;
}

#mksQuickBuyPopup .mks-voucher-brand {
    width: 70px;
    background-color: #ef4444;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px 0 0 6px;
    position: relative;
    text-align: center;
    flex-shrink: 0;
}

#mksQuickBuyPopup .mks-brand-icon svg,
#mksQuickBuyPopup .mks-brand-icon img {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    opacity: 0.8;
}

#mksQuickBuyPopup .mks-brand-icon img {
    object-fit: cover;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}

#mksQuickBuyPopup .mks-brand-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    margin-top: 4px;
}

#mksQuickBuyPopup .mks-brand-text {
    font-size: 10px;
    opacity: 0.8;
}

#mksQuickBuyPopup .mks-voucher-brand::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10px;
    bottom: 10px;
    border-left: 2px dashed rgba(255, 255, 255, 0.4);
}

#mksQuickBuyPopup .mks-voucher-details {
    flex-grow: 1;
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#mksQuickBuyPopup .mks-voucher-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
}

#mksQuickBuyPopup .mks-voucher-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 2px;
}

#mksQuickBuyPopup .mks-voucher-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#mksQuickBuyPopup .mks-voucher-code-badge {
    background-color: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

#mksQuickBuyPopup .mks-voucher-description {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 4px 0;
    line-height: 1.2;
    display: flex;
}

#mksQuickBuyPopup .mks-voucher-conditions {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.4;
}

#mksQuickBuyPopup .mks-voucher-conditions li {
    margin: 0;
}

#mksQuickBuyPopup input[type="radio"][name="mksVoucherRadio"] {
    display: none;
}

#mksQuickBuyPopup .mks-radio-label {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

#mksQuickBuyPopup .mks-voucher-ticket.active .mks-radio-label,
#mksQuickBuyPopup input[type="radio"][name="mksVoucherRadio"]:checked+.mks-radio-label {
    border-color: #ef4444;
}

#mksQuickBuyPopup .mks-radio-label .mks-radio-button {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

#mksQuickBuyPopup .mks-radio-label .mks-radio-button::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.2s;
}

#mksQuickBuyPopup .mks-voucher-ticket.active .mks-radio-label .mks-radio-button::after,
#mksQuickBuyPopup input[type="radio"][name="mksVoucherRadio"]:checked+.mks-radio-label .mks-radio-button::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}





@media (min-width: 768px) {
    #mksQuickBuyPopup {
        align-items: center;
        overflow-y: hidden;
    }

    #mksQuickBuyPopup .mks-popup-content {
        flex-direction: row;
    }

    #mksQuickBuyPopup .mks-popup-column-left {
        width: 41.666667%;
        border-radius: 16px 0 0 16px;
    }

    #mksQuickBuyPopup .mks-popup-column-right {
        width: 58.333333%;
        overflow-y: auto;
        max-height: 90vh;
    }

    #mksQuickBuyPopup .mks-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #mksQuickBuyPopup .mks-form-group.mks-col-100 {
        grid-column: span 2 / span 2;
    }

    #mksQuickBuyPopup .mks-form-group.mks-col-50 {
        grid-column: span 1 / span 1;
    }

    /* Desktop: Nếu có shipping methods thì hiển thị 2 cột */
    #mksQuickBuyPopup .mks-methods-grid.has-shipping {
        grid-template-columns: 1fr 1fr;
    }

    /* Desktop: Nếu không có shipping methods, payment chiếm full */
    #mksQuickBuyPopup .mks-methods-grid:not(.has-shipping) {
        grid-template-columns: 1fr;
    }

    #mksQuickBuyPopup .mks-methods-grid.has-shipping .mks-shipping-container {
        display: block;
    }
}

@media (max-width: 767px) {

    /* Payment methods và shipping methods responsive trên mobile */
    #mksQuickBuyPopup .mks-option {
        flex: 1 1 calc(50% - 4px);
        /* Mỗi dòng hiển thị 2 options */
        min-width: calc(50% - 4px);
    }

    /* Nếu chỉ có 1 payment method, hiển thị full width */
    #mksQuickBuyPopup .mks-options-list .mks-option:only-child {
        flex: 1 1 100%;
        min-width: 100%;
    }

    /* Nếu có nhiều hơn 3 payment methods, cho phép xuống dòng */
    #mksQuickBuyPopup .mks-options-list .mks-option:nth-child(n+4) {
        flex: 1 1 calc(50% - 4px);
    }
}

/* Mobile: Fix cứng nút X bên phải phía trên */
@media (max-width: 767px) {
    #mksQuickBuyPopup .mks-close-button {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        z-index: 9999 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    #mksQuickBuyPopup .mks-close-button svg {
        width: 20px !important;
        height: 20px !important;
    }
}