
/* ==========================================
   KINGITUSTE VALIMISE MODAALAKEN
   ========================================== */

/* Modaalakna paigutus */
.bonus-gift-dialog {
    max-width: 1040px;
    width: calc(100% - 24px);
    margin: 24px auto;
}

.bonus-gift-modal-content {
    border-radius: 14px;
    overflow: hidden;
}

/* Ostukorvi kokkuvõte */
.bonus-gift-summary {
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: #f3f7f5;
    font-weight: 600;
}

/* ==========================================
   KINGITUSTE TASEMED
   ========================================== */

.bonus-level-section {
    margin: 22px 0 30px;
}

.bonus-level-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e5e9e7;
}

.bonus-level-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.bonus-level-range {
    font-size: .95rem;
    color: #555;
}

.bonus-level-hint {
    color: #7a5833;
    font-weight: 600;
}

.bonus-level-hint.is-open {
    color: #28a745;
}

/* ==========================================
   KINGITUSTE RUUDUSTIK JA KAARDID
   ========================================== */

.bonus-gift-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.bonus-gift-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e0e5e2;
    border-radius: 12px;
    background: #fff;
}

.bonus-gift-card img {
    width: 100%;
    height: 120px;
    margin-bottom: 10px;
    object-fit: contain;
}

.bonus-gift-name {
    flex: 1;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Valitud kingituse kaart ilma paigutuse nihkumiseta */
.bonus-gift-card.is-selected {
    border-color: #28a745;
    box-shadow: inset 0 0 0 1px #28a745;
    background-color: #fff;
}

/* Mitteaktiivse kingituse kaart */
.bonus-gift-card.is-locked img {
    filter: grayscale(1);
    opacity: .42;
}

.bonus-gift-card.is-locked .bonus-gift-name {
    color: #a0a0a0;
}

/* ==========================================
   NUPUD JA KOGUSED
   ========================================== */

.bonus-gift-card .btn {
    width: 100%;
    border-radius: 22px;
}

.bonus-gift-controls {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 4px;
}

/* Kingituse kogus */
.bonus-gift-card .bonus-gift-qty {
    flex: 0 0 62px;
    width: 62px;
    min-width: 0;
    text-align: center;
    border-radius: 22px;
    background: #fff;
    color: #555;
    cursor: default;
}

/* Kingituse valimise nupp */
.bonus-gift-card .bonus-choose {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    padding-left: 8px;
    padding-right: 8px;
    white-space: normal;
}

/* Saadaval oleva kingituse nupp */
.bonus-gift-card .bonus-choose:not(:disabled) {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

/* Nupu värv hiirega peale liikudes ja fookuses */
.bonus-gift-card .bonus-choose:not(:disabled):hover,
.bonus-gift-card .bonus-choose:not(:disabled):focus {
    background-color: #218838;
    border-color: #218838;
    color: #fff;
}

/* Valitud kingituse nupp ilma läbipaistvuseta */
.bonus-gift-card.is-selected .bonus-choose,
.bonus-gift-card.is-selected .bonus-choose:disabled {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
    opacity: 1 !important;
    font-weight: 700;
    cursor: default;
}

/* Linnuke valitud kingituse nupul */
.bonus-gift-card.is-selected .bonus-choose::before {
    content: "✓";
    display: inline-block;
    margin-right: 7px;
    font-weight: 700;
}

/* Valitud aktiivse nupu hõljumise ja fookuse olek */
.bonus-gift-card.is-selected .bonus-choose:not(:disabled):hover,
.bonus-gift-card.is-selected .bonus-choose:not(:disabled):focus {
    background-color: #218838 !important;
    border-color: #218838 !important;
}

/* Mitteaktiivne kingituse nupp */
.bonus-gift-card.is-locked:not(.is-selected) .bonus-choose:disabled {
    background-color: #e6e6e6;
    border-color: #e6e6e6;
    color: #858585;
    opacity: 1;
}

/* Mitteaktiivse kingituse kogus */
.bonus-gift-card.is-locked .bonus-gift-qty {
    border-color: #e5e5e5;
    color: #999;
}

/* Ümmargune kingituste avamise nupp */
.bonus-open {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 17px;
}

.bonus-open:hover,
.bonus-open:focus {
    background-color: #218838;
    border-color: #218838;
    color: #fff;
}

/* Modaalakna nuppude piirjoone ja varju eemaldamine */
#bonusGiftModal .btn:hover,
#bonusGiftModal .btn:focus,
#bonusGiftModal .btn:active,
#bonusGiftModal .btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================
   LAADIMISE KUVAMINE
   ========================================== */

.bonus-gift-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 210px;
    padding: 45px 18px;
    text-align: center;
    color: #49534d;
    font-weight: 600;
}

.bonus-gift-spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0ece5;
    border-top-color: #28a745;
    border-radius: 50%;
    animation: bonus-gift-spin .8s linear infinite;
}

@keyframes bonus-gift-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   TEAVITUSED
   ========================================== */

.bonus-gift-notice {
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 10px;
    font-weight: 600;
}

.bonus-gift-notice.is-success {
    background: #d4edda;
    color: #155724;
}

.bonus-gift-notice.is-error {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================
   KOHANDUV KUJUNDUS
   ========================================== */

@media (max-width: 767px) {
    .bonus-gift-dialog {
        margin: 12px auto;
    }

    .bonus-gift-grid {
        grid-template-columns: 1fr;
    }

    .bonus-gift-card img {
        height: 145px;
    }
}

/* Vähendatud animatsiooni eelistuse arvestamine */
@media (prefers-reduced-motion: reduce) {
    .bonus-gift-spinner {
        animation-duration: 2s;
    }
}
