/* Tái mua đơn gifts in the cart: panel under the cart items + picker modal */
:root {
    --gift-accent: #ff6116;
    --gift-accent-soft: #fff3ec;
    --gift-green: #63c300;
    --gift-border: #f2d9cb;
    --gift-text: #404f5e;
    --gift-muted: #7a8794;
}

/* ---------- panel ---------- */
.gift-panel {
    margin-top: 12px;
    border: 1px solid var(--gift-border);
    border-radius: 10px;
    background: linear-gradient(180deg, var(--gift-accent-soft) 0%, #fff 64px);
    padding: 12px;
    color: var(--gift-text);
}

.gift-panel__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gift-panel__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gift-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.gift-panel__title {
    flex: 1 1 auto;
    min-width: 0;
}

.gift-panel__title b {
    display: block;
    font-size: 15px;
    line-height: 1.3;
}

.gift-panel__title small {
    color: var(--gift-muted);
    line-height: 1.3;
}

.gift-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    border: 1px solid var(--gift-accent);
    background: #fff;
    color: var(--gift-accent);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.gift-btn:hover,
.gift-btn:focus-visible {
    background: var(--gift-accent);
    color: #fff;
}

.gift-btn--solid {
    background: var(--gift-accent);
    color: #fff;
}

.gift-btn--solid:hover,
.gift-btn--solid:focus-visible {
    background: #e8540e;
    border-color: #e8540e;
}

.gift-btn[disabled] {
    opacity: .45;
    pointer-events: none;
}

/* allowance meter */
.gift-meter {
    margin-top: 12px;
}

.gift-meter__bar {
    height: 8px;
    border-radius: 4px;
    background: #f0e3db;
    overflow: hidden;
}

.gift-meter__fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gift-accent);
    transition: width .2s ease;
}

.gift-meter__labels {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--gift-muted);
}

.gift-meter__labels b {
    color: var(--gift-text);
}

/* selected gifts */
.gift-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.gift-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px dashed var(--gift-border);
}

.gift-row__img {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    overflow: hidden;
}

.gift-row__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gift-tag {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1px 5px;
    border-radius: 0 0 6px 0;
    background: var(--gift-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.gift-row__info {
    flex: 1 1 auto;
    min-width: 0;
}

.gift-row__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gift-row__meta {
    font-size: 12.5px;
    color: var(--gift-muted);
}

.gift-row__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gift-remove {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #c0392b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gift-remove:hover {
    background: #fdecea;
}

/* quantity stepper (panel + modal) */
.gift-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dcdcdc;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}

.gift-stepper button {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--gift-text);
    font-size: 13px;
}

.gift-stepper button:hover {
    background: #f4f4f4;
}

.gift-stepper button[disabled] {
    color: #c8c8c8;
    background: transparent;
    cursor: not-allowed;
}

.gift-stepper__qty {
    min-width: 26px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.gift-empty {
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed var(--gift-border);
    border-radius: 8px;
    text-align: center;
    font-size: 13.5px;
    color: var(--gift-muted);
}

/* phones: stack the action row under the gift info */
@media (max-width: 420px) {
    .gift-row {
        flex-wrap: wrap;
    }

    .gift-row__info {
        flex-basis: calc(100% - 66px);
    }

    .gift-row__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .gift-panel__head .gift-btn span {
        display: none;
    }

    .gift-panel__head .gift-btn {
        width: 40px;
        padding: 0;
    }
}

/* ---------- picker modal ---------- */
.gift-modal .modal-header {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.gift-modal .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gift-text);
}

.gift-modal .modal-body {
    padding: 12px 16px 16px;
    background: #fafafa;
}

.gift-search {
    position: relative;
    margin-top: 10px;
}

.gift-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gift-muted);
}

.gift-search input {
    height: 40px;
    padding-left: 36px;
    border-radius: 20px;
}

.gift-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.gift-card.is-selected {
    border-color: var(--gift-accent);
    box-shadow: 0 0 0 1px var(--gift-accent);
}

.gift-card.is-unavailable .gift-card__img,
.gift-card.is-unavailable .gift-card__name {
    opacity: .5;
}

.gift-card__img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.gift-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.gift-card__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gift-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.gift-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 10px;
}

.gift-card__name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gift-text);
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gift-card__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--gift-accent);
}

.gift-card__note {
    font-size: 11.5px;
    color: var(--gift-muted);
    min-height: 1.3em;
}

.gift-card__action {
    margin-top: auto;
    padding-top: 4px;
}

.gift-card__action .gift-btn {
    width: 100%;
    min-height: 36px;
}

.gift-card__action .gift-stepper {
    width: 100%;
    justify-content: space-between;
}

.gift-modal .modal-footer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #eee;
}

.gift-modal__total {
    min-width: 0;
    font-size: 13px;
    color: var(--gift-muted);
    line-height: 1.3;
}

.gift-modal__total b {
    display: block;
    font-size: 16px;
    color: var(--gift-text);
}

.gift-modal__total.is-over b {
    color: #c0392b;
}

.gift-modal__buttons {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.gift-modal__no-result {
    padding: 32px 0;
    text-align: center;
    color: var(--gift-muted);
}

/* ---------- read-only summary on /dat-hang ---------- */
.gift-summary {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid var(--gift-border);
    border-radius: 8px;
    background: var(--gift-accent-soft);
    color: var(--gift-text);
}

.gift-summary__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.gift-summary__head a {
    color: var(--gift-accent);
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
}

.gift-summary .gift-row:first-of-type {
    border-top: 0;
}
