/* ============================================================
   CartUnlockLevels Plugin – Styles
   ============================================================ */

/* ── Widget container ── */
.cul-offcanvas-widget,
.cul-cart-widget {
    display: none;
    position: relative;
    padding: 0.5rem 0.25rem 0.4rem;
    margin-bottom: 1rem;
}

/* ── Inner widget layout ── */
.cul-widget {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}

/* ── Progress section ── */
.cul-progress {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* ── Top labels: level names above the bar ── */
.cul-names-row {
    position: relative;
    height: 1.2rem;
    margin-bottom: 0.15rem;
}

.cul-name-label {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Track — slim bar ── */
.cul-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 100px;
    overflow: visible;
}

.cul-cart-widget .cul-track {
    height: 10px;
}

.cul-cart-widget .cul-names-row {
    height: 1.4rem;
    margin-bottom: 0.2rem;
}

.cul-cart-widget .cul-values-row {
    height: 1.4rem;
    margin-top: 0.3rem;
}

.cul-cart-widget .cul-name-label {
    font-size: 0.7rem;
}

.cul-cart-widget .cul-value-label {
    font-size: 0.65rem;
}

.cul-cart-widget .cul-value-label--offset {
    top: 0;
}

/* ── Fill ── */
.cul-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #dc2626 0%, #f87171 100%);
    border-radius: 100px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.cul-widget-el--free .cul-fill {
    background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

.cul-widget-el--free .cul-track {
    background: #e5e7eb;
}

/* ── Dividers on the bar ── */
.cul-divider {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 1.5px;
    background: rgba(185,28,28,0.45);
    transform: translateX(-50%);
    z-index: 2;
    border-radius: 2px;
}

/* Dashed style for levels not yet reached */
.cul-divider--upcoming {
    background: repeating-linear-gradient(
        to bottom,
        rgba(100,116,139,0.5) 0px,
        rgba(100,116,139,0.5) 3px,
        transparent 3px,
        transparent 6px
    );
    width: 1.5px;
}

.cul-widget-el--free .cul-divider {
    background: rgba(21,128,61,0.5);
}

/* ── Free-zone band: shaded region between offset and threshold ── */
.cul-free-zone-band {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(21,128,61,0.12);
    border-left: 1.5px solid rgba(21,128,61,0.35);
    border-right: 1.5px solid rgba(21,128,61,0.35);
    z-index: 1;
    pointer-events: none;
}

.cul-free-zone-band--active {
    background: rgba(21,128,61,0.18);
    border-left-color: rgba(21,128,61,0.55);
    border-right-color: rgba(21,128,61,0.55);
}

/* ── Offset start dot on the bar ── */
.cul-offset-tick {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 4px;
    background: rgba(21,128,61,0.9);
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}

.cul-offset-tick--upcoming {
    background: rgba(100,116,139,0.45);
}

/* ── Bottom value labels ── */
.cul-values-row {
    position: relative;
    height: 2.2rem;
    margin-top: 0.2rem;
}

.cul-value-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
    max-width: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Offset labels drop to a second line to avoid colliding with the threshold label */
.cul-value-label--offset {
    top: 1.1rem;
    color: #6b7280;
    font-style: italic;
}

/* ── Counter badge ── */
.cul-counter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.cul-counter--blocked {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.35);
    box-shadow: none;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.25rem 0.45rem;
    text-align: center;
    line-height: 1.2;
}

.cul-counter--free {
    background: transparent;
    color: #16a34a;
    border: 1px solid rgba(22,163,74,0.35);
    box-shadow: none;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    justify-content: center;
}

.cul-counter-lock,
.cul-counter-check {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.cul-counter-amount {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.cul-counter-label {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1;
}

/* ── Checkout blocked button ── */
.cul-blocked {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none !important;
}

.cul-blocked:hover {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    transform: none !important;
}

/* ── Cart item points display ── */
.cart-item-label-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-cul-display {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
}

.cart-item-cul-icon {
    font-size: 0.375rem;
    color: #10b981;
    margin-right: 0.15rem;
}

.cart-item-cul-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #059669;
}

.cart-item-cul-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
}

.cart-item-cul-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.4rem;
    padding: 0.15rem 0.35rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 400;
    color: #c2410c;
}

/* ── Product listing points display ── */
.product-listing-cul-display {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.45rem;
    margin: 0.35rem 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.product-listing-cul-display:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.product-listing-cul-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #059669;
}

.product-listing-cul-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
}

.product-listing-cul-level-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0.3rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9a3412;
    line-height: 1.2;
}

/* ── Product detail points display ── */
.cul-product-detail-points {
    display: inline-block;
    padding: 0.6rem 1rem;
    margin: 0.75rem 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cul-product-detail-points:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.cul-product-detail-points-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #059669;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.cul-product-detail-points-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.2;
}

.cul-product-detail-level-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin: 0.75rem 0 0.5rem 0;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-left: 4px solid #fb923c;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9a3412;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .cul-offcanvas-widget,
    .cul-cart-widget {
        padding: 0.4rem 0.25rem 0.3rem;
        margin-bottom: 0.75rem;
    }

    .cul-track {
        height: 6px;
    }

    .cul-cart-widget .cul-track {
        height: 8px;
    }

    .cul-name-label {
        font-size: 0.58rem;
    }

    .cul-value-label {
        font-size: 0.54rem;
    }

    .cul-counter {
        font-size: 0.72rem;
        padding: 0.4rem 0.75rem;
    }

    .cul-names-row {
        height: 1.2rem;
    }

    .cul-values-row {
        height: 2rem;
    }
}
