/* ── WC Smart Promotions — Progress Bar & Pickers ───────────────────────── */

/* ── Gift badge in cart ──────────────────────────────────────────────────── */
.wcsp-gift-badge {
    display: inline-block;
    background: #edfaee;
    border: 1px solid #3CA545;
    color: #27602b;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}
.wcsp-gift-qty { font-weight: 600; color: #555; }

/* ── Xoo Side Cart — progress bar ───────────────────────────────────────── */
.wcsp-xoo-bar {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f0e8dc;
    background: #faf6f0;
}
.wcsp-xoo-msg {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.4;
}
.wcsp-xoo-msg strong { color: #846249; }
.wcsp-xoo-track {
    position: relative;
    height: 5px;
    background: #e8d8c0;
    border-radius: 99px;
    margin-bottom: 18px;
    overflow: visible;
}
.wcsp-xoo-fill {
    height: 100%;
    background: #3CA545;
    border-radius: 99px;
    transition: width .5s ease;
    min-width: 2px;
}
.wcsp-xoo-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 12px;
    line-height: 1;
}
.wcsp-xoo-marker img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8d8c0;
    background: #fff;
    display: block;
    margin-top: -10px;
    transition: border-color .2s, box-shadow .2s;
}
.wcsp-xoo-marker--active img {
    border-color: #3CA545;
    box-shadow: 0 0 0 3px rgba(60,165,69,.2);
}
.wcsp-xoo-marker--passed img { border-color: #ddd; opacity: .45; }

/* ── Xoo Side Cart — gift product picker ────────────────────────────────── */
.wcsp-xoo-picker {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e8d8c0;
    transition: opacity .2s;
}
.wcsp-xoo-picker--loading { opacity: .5; pointer-events: none; }

.wcsp-xoo-picker-label {
    font-size: 11px;
    font-weight: 700;
    color: #846249;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wcsp-xoo-picker-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.wcsp-xoo-picker-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e8d8c0;
    background: #faf6f0;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    flex-shrink: 0;
}
.wcsp-xoo-picker-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.wcsp-xoo-picker-btn span {
    font-size: 9px;
    color: #555;
    line-height: 1.2;
    padding: 2px;
    display: block;
}
.wcsp-xoo-picker-btn:hover { border-color: #D9B483; }
.wcsp-xoo-picker-btn--selected {
    border-color: #3CA545;
    box-shadow: 0 0 0 3px rgba(60,165,69,.2);
}
.wcsp-xoo-picker-check {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 16px;
    height: 16px;
    background: #3CA545;
    border-radius: 50%;
    font-size: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}
.wcsp-xoo-picker-name {
    font-size: 11px;
    color: #846249;
    font-weight: 500;
    min-height: 16px;
}

/* ── Cart page progress bar ──────────────────────────────────────────────── */
.wcsp-progress-wrap {
    background: #fff;
    border: 1px solid #e8d8c0;
    border-radius: 10px;
    padding: 18px 22px 16px;
    margin: 0 0 22px;
}
.wcsp-bar-message {
    font-size: 14px;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}
.wcsp-bar-message strong { color: #846249; }
.wcsp-bar-message--done strong { color: #3CA545; }

.wcsp-tier-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-bottom: 14px;
}
.wcsp-tier-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.wcsp-connector {
    position: absolute;
    top: 27px; right: 50%; left: -50%;
    height: 5px;
    background: #e8d8c0;
    z-index: 0;
    transition: background .35s;
}
.wcsp-connector--passed { background: #3CA545; }
.wcsp-tier-circle {
    position: relative; z-index: 1;
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 2px solid #e8d8c0;
    background: #faf6f0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: border-color .25s, opacity .25s, box-shadow .25s;
}
.wcsp-tier-circle--active { border-color: #3CA545; background: #edfaee; box-shadow: 0 0 0 4px rgba(60,165,69,.18); }
.wcsp-tier-circle--passed { opacity: .45; }
.wcsp-tier-circle--upcoming { border-color: #D9B483; }
.wcsp-tier-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.wcsp-tier-fallback-icon { font-size: 22px; }
.wcsp-tier-badge {
    position: absolute; top: -2px; right: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.wcsp-tier-badge--active { background: #3CA545; }
.wcsp-tier-badge--passed { background: #bbb; }
.wcsp-tier-info { display: flex; flex-direction: column; align-items: center; margin-top: 8px; gap: 2px; }
.wcsp-tier-name { font-size: 12px; font-weight: 600; color: #333; text-align: center; }
.wcsp-tier-status { font-size: 11px; text-align: center; }
.wcsp-tier-status--active  { color: #3CA545; font-weight: 600; }
.wcsp-tier-status--passed  { color: #aaa; }
.wcsp-tier-status--upcoming{ color: #846249; }
.wcsp-track-wrap { padding: 0 27px; }
.wcsp-track { height: 7px; background: #e8d8c0; border-radius: 99px; overflow: hidden; }
.wcsp-fill { height: 100%; background: #3CA545; border-radius: 99px; transition: width .55s ease; min-width: 3px; }

.wcsp-mode-compact { padding: 14px 16px; margin: 16px 0; }
.wcsp-mode-compact .wcsp-tier-circle { width: 42px; height: 42px; }
.wcsp-mode-compact .wcsp-connector { top: 21px; }
.wcsp-mode-compact .wcsp-track-wrap { padding: 0 21px; }

@media (max-width: 480px) {
    .wcsp-tier-circle { width: 44px; height: 44px; }
    .wcsp-tier-name { font-size: 10px; }
    .wcsp-tier-status { font-size: 10px; }
    .wcsp-connector { top: 22px; }
    .wcsp-track-wrap { padding: 0 22px; }
}

/* ── Trigger button ───────────────────────────────────────────────────── */
.wcsp-xoo-picker-trigger-wrap {
    margin-top: 10px;
    text-align: center;
}
.wcsp-xoo-current-gift {
    font-size: 12px;
    color: #3CA545;
    font-weight: 600;
    margin-bottom: 6px;
}
.wcsp-xoo-picker-trigger {
    display: inline-block;
    background: #846249;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    width: 100%;
}
.wcsp-xoo-picker-trigger:hover { background: #6e5140; }

/* ── Popup overlay ────────────────────────────────────────────────────── */
.wcsp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
body.wcsp-popup-open { overflow: hidden; }
.wcsp-popup--loading { opacity: .7; pointer-events: none; }

/* ── Popup box ────────────────────────────────────────────────────────── */
.wcsp-popup {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
}
.wcsp-popup-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    font-size: 20px; color: #aaa;
    cursor: pointer; line-height: 1;
    padding: 4px 8px; border-radius: 4px;
    transition: background .15s, color .15s;
}
.wcsp-popup-close:hover { background: #f5f0ea; color: #555; }

.wcsp-popup-header { text-align: center; margin-bottom: 20px; }
.wcsp-popup-header h3 {
    font-size: 18px; font-weight: 700;
    color: #333; margin: 0 0 6px;
}
.wcsp-popup-header p { font-size: 13px; color: #888; margin: 0; }

/* ── Product grid ─────────────────────────────────────────────────────── */
.wcsp-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.wcsp-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border: 2px solid #e8d8c0;
    border-radius: 10px;
    background: #faf6f0;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    position: relative;
}
.wcsp-popup-item:hover {
    border-color: #D9B483;
    background: #fff;
}
.wcsp-popup-item--selected {
    border-color: #3CA545;
    background: #edfaee;
    box-shadow: 0 0 0 3px rgba(60,165,69,.15);
}
.wcsp-popup-item img {
    width: 72px; height: 72px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.wcsp-popup-item-placeholder {
    width: 72px; height: 72px;
    display: flex; align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #f0e8dc;
    border-radius: 8px;
}
.wcsp-popup-item-name {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-align: center;
    line-height: 1.3;
}
.wcsp-popup-item-check {
    font-size: 10px;
    font-weight: 700;
    color: #3CA545;
    background: #edfaee;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid #3CA545;
}

@media (max-width: 400px) {
    .wcsp-popup-grid { grid-template-columns: repeat(3, 1fr); }
    .wcsp-popup-item img { width: 56px; height: 56px; }
}
