/*
 * Giftbox frontend styles
 * Recreates the look from screenshots: white card, radio list, red corner ribbon,
 * "Ưu đãi thêm" list with green checkmarks.
 * Scoped under .gbw-box. Works out-of-the-box with Flatsome.
 */

.gbw-box {
    position: relative;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    padding: 16px 20px 14px;
    margin: 18px 0;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

/* Red corner ribbon "QUÀ TẶNG" */
.gbw-ribbon {
    position: absolute;
    top: 14px;
    right: -38px;
    transform: rotate(45deg);
    background: #e32224;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 44px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}

.gbw-ribbon::before,
.gbw-ribbon::after {
    content: "";
    position: absolute;
    bottom: -6px;
    border-top: 6px solid #9e1618;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}
.gbw-ribbon::before { left: 0; }
.gbw-ribbon::after  { right: 0; }

.gbw-min-notice {
    font-size: 13px;
    color: #e32224;
    font-weight: 600;
    margin-bottom: 6px;
}

.gbw-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px;
    padding-right: 90px; /* leave room for ribbon */
    line-height: 1.3;
}

.gbw-options {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 10px !important;
}

.gbw-option {
    margin: 0 !important;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.gbw-option:last-child {
    border-bottom: none;
}

.gbw-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

/* Hide native radio/checkbox visually; use our custom circle */
.gbw-option input[type="radio"],
.gbw-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gbw-check {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 18px;
    position: relative;
    transition: all 0.15s ease;
    background: #fff;
}

.gbw-option input[type="checkbox"] + .gbw-check {
    border-radius: 3px;
}

.gbw-option input:checked + .gbw-check {
    border-color: #e32224;
    background: #e32224;
}

.gbw-option input:checked + .gbw-check::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.gbw-option input[type="checkbox"]:checked + .gbw-check::after {
    border-radius: 0;
    width: 10px;
    height: 6px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    background: transparent;
    transform: translate(-50%, -70%) rotate(-45deg);
}

.gbw-option-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gbw-option-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gbw-option-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    line-height: 1.4;
    color: #333;
    font-size: 14px;
}

.gbw-option-title {
    font-weight: 500;
}

.gbw-price {
    color: #e32224;
    font-weight: 700;
}

.gbw-option-note {
    flex: 0 0 100%;
    font-size: 12px;
    color: #888;
}

/* Discount option specific */
.gbw-option--discount .gbw-option-title strong.gbw-price {
    font-size: 15px;
    margin-left: 4px;
}

/* Extra offers list */
.gbw-extras {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 10px;
}
.gbw-extras-title {
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
    padding: 4px 10px;
    background: #f5f5f5;
    display: inline-block;
    border-radius: 3px;
}
.gbw-extras-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.gbw-extras-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    color: #444;
    margin: 0 !important;
}

.gbw-check-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: #1fa950;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* Cart labels */
.gbw-gift-badge {
    display: inline-block;
    background: #e32224;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}
.gbw-free {
    color: #1fa950;
    font-weight: 700;
}
.gbw-gift-qty {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .gbw-title {
        font-size: 14px;
        padding-right: 80px;
    }
    .gbw-option-thumb {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }
    .gbw-option-body {
        font-size: 13px;
    }
}
