/* Edit cart modal (ແກ້ໄຂ) — #md-viewCart / #body-viewCart */
#md-viewCart .modal-body {
    padding: 0.85rem 1rem 1rem;
}

#body-viewCart .discount-selector-container .discount-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

#body-viewCart .discount-selector-container .discount-head-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
}

#body-viewCart .discount-selector-container .discount-head-hint {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

#body-viewCart .discount-selector-container .discount-head-ion {
    font-size: 1rem;
    color: #64748b;
    flex-shrink: 0;
}

#body-viewCart .discount-selector-container .discount-chip-icon {
    line-height: 0;
    margin-bottom: 0.15rem;
}

#body-viewCart .discount-selector-container .discount-chip-icon ion-icon {
    font-size: 1.2rem;
    color: #94a3b8;
}

#body-viewCart .discount-selector-container .discount-chip--on .discount-chip-icon ion-icon {
    color: #2563eb;
}

#body-viewCart .discount-selector-container {
    width: 100%;
    max-width: 100%;
}

#body-viewCart .discount-selector-container .discount-segment {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}

#body-viewCart .discount-selector-container .discount-chip {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 0.15rem;
    min-height: 3.35rem;
    padding: 0.65rem 0.85rem;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    cursor: pointer;
    box-shadow: none;
    font: inherit;
    line-height: 1.25;
    white-space: normal;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#body-viewCart .discount-selector-container .discount-chip:hover:not(.discount-chip--on) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

#body-viewCart .discount-selector-container .btn-discount:focus {
    outline: none;
    box-shadow: none;
}

#body-viewCart .discount-selector-container .btn-discount:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
}

#body-viewCart .discount-selector-container .discount-chip-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

#body-viewCart .discount-selector-container .discount-chip-meta,
#body-viewCart .discount-selector-container .discount-chip-amount {
    font-size: 0.9rem;
    font-weight: 700;
}

#body-viewCart .discount-selector-container .discount-chip--on {
    background: #eff6ff;
    border-color: #3b82f6;
}

#body-viewCart .discount-selector-container .discount-chip--on .discount-chip-label {
    color: #1e3a8a;
    font-weight: 700;
}

#body-viewCart .discount-selector-container .discount-chip--on .discount-chip-meta {
    color: #2563eb;
    font-weight: 600;
    font-size: 0.8rem;
}

#body-viewCart .discount-selector-container .discount-chip--on .discount-chip-amount {
    color: #1d4ed8;
    font-weight: 800;
    font-size: 0.95rem;
}

#body-viewCart .discount-selector-container .discount-chip:not(.discount-chip--on) .discount-chip-label {
    color: #64748b;
}

#body-viewCart .discount-selector-container .discount-chip:not(.discount-chip--on) .discount-chip-meta,
#body-viewCart .discount-selector-container .discount-chip:not(.discount-chip--on) .discount-chip-amount {
    color: #94a3b8;
    font-weight: 600;
}

#body-viewCart .unit-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.65rem;
}

#body-viewCart .unit-picker-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.02em;
}

#body-viewCart .unit-mode-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

#body-viewCart .unit-mode-btn {
    border: 0;
    background: transparent;
    min-height: 2.25rem;
    min-width: 2.75rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    line-height: 1.25;
    transition: background 0.15s ease, color 0.15s ease;
}

#body-viewCart .unit-mode-btn.active {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 0 0 1px #e5e7eb;
}

#body-viewCart .unit-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

#body-viewCart .unit-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: 4.5rem;
    padding: 0.72rem 0.85rem 0.65rem;
    margin: 0;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    text-align: left;
    box-shadow: none;
}

#body-viewCart .unit-chip:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

#body-viewCart .unit-chip:active {
    transform: scale(0.98);
}

#body-viewCart .unit-chip.active,
#body-viewCart .unit-chip.checked {
    border-color: #2563eb;
    background: #eff6ff;
}

#body-viewCart .unit-chip .arr_unit {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

#body-viewCart .unit-chip-check {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    background: #fff;
}

#body-viewCart .unit-chip-check ion-icon {
    font-size: 0.72rem;
}

#body-viewCart .unit-chip.active .unit-chip-check,
#body-viewCart .unit-chip.checked .unit-chip-check {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
}

#body-viewCart .unit-chip-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    padding-right: 1.6rem;
    word-break: break-word;
}

#body-viewCart .unit-chip.active .unit-chip-name,
#body-viewCart .unit-chip.checked .unit-chip-name {
    color: #1e40af;
}

#body-viewCart .unit-chip-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #b91c1c;
    margin-top: 0.28rem;
    letter-spacing: 0.01em;
}
