/* =================================================================
   SD Desconto por Volume — Frontend (Cart / Checkout)
   Design: Mercado Livre / WoodMart style
   ================================================================= */

/* ── Banner Container ── */
.sdv-volume-banner {
    margin-bottom: 20px;
}

.sdv-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 8px;
    font-family: 'Proxima Nova', -apple-system, 'Inter', Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Incentive (no discount yet) ── */
.sdv-banner-incentive {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ── Active discount (has next tier) ── */
.sdv-banner-active {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* ── Max discount reached ── */
.sdv-banner-max {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 50%, #fef3c7 100%);
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Icon (SVG inline) ── */
.sdv-banner-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-top: 2px;
}

.sdv-banner-icon .sdv-icon {
    width: 32px;
    height: 32px;
    display: block;
}

/* ── Content ── */
.sdv-banner-content {
    flex: 1;
    min-width: 0;
}

.sdv-banner-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.sdv-banner-title strong {
    font-weight: 700;
    color: inherit;
}

.sdv-banner-incentive .sdv-banner-title strong {
    color: #3483fa;
}

.sdv-banner-active .sdv-banner-title strong {
    color: #16a34a;
}

.sdv-banner-max .sdv-banner-title strong {
    color: #d97706;
}

.sdv-banner-savings {
    margin: 8px 0 0 0;
    font-size: 13px;
    opacity: 0.85;
}

.sdv-banner-savings strong {
    font-weight: 700;
}

/* ── Progress Bar ── */
.sdv-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sdv-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.sdv-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Animated shimmer */
.sdv-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: sdv-shimmer 2s infinite;
}

@keyframes sdv-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sdv-banner-incentive .sdv-progress-fill {
    background: linear-gradient(90deg, #3b82f6, #3483fa);
}

.sdv-banner-active .sdv-progress-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.sdv-progress-label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.7;
}

/* ── Tiers Summary (collapsible) ── */
.sdv-tiers-details {
    margin-top: 12px;
}

.sdv-tiers-toggle {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #3483fa;
    padding: 6px 0;
    user-select: none;
    font-family: 'Proxima Nova', -apple-system, 'Inter', Roboto, Arial, sans-serif;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sdv-tiers-toggle::-webkit-details-marker {
    display: none;
}

.sdv-tiers-toggle::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 11px;
}

.sdv-tiers-details[open] .sdv-tiers-toggle::before {
    transform: rotate(90deg);
}

.sdv-tiers-toggle:hover {
    color: #1d4ed8;
}

.sdv-tiers-grid {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sdv-tier-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-family: 'Proxima Nova', -apple-system, 'Inter', Roboto, Arial, sans-serif;
    position: relative;
    transition: all 0.2s ease;
    min-width: 100px;
}

.sdv-tier-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sdv-tier-active {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #86efac;
}

.sdv-tier-qty {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.sdv-tier-active .sdv-tier-qty {
    color: #166534;
}

.sdv-tier-discount {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.sdv-tier-active .sdv-tier-discount {
    color: #16a34a;
}

.sdv-tier-check {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #16a34a;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sdv-banner-inner {
        padding: 14px 16px;
        gap: 10px;
    }

    .sdv-banner-icon,
    .sdv-banner-icon .sdv-icon {
        width: 26px;
        height: 26px;
    }

    .sdv-banner-title {
        font-size: 13px;
    }

    .sdv-tiers-grid {
        gap: 8px;
    }

    .sdv-tier-card {
        padding: 8px 12px;
        min-width: 80px;
    }

    .sdv-tier-discount {
        font-size: 14px;
    }

    .sdv-tier-qty {
        font-size: 11px;
    }
}

/* ── Disclaimer (certificados não participam) ── */
.sdv-disclaimer {
    margin: 8px 0 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #94a3b8;
    font-style: italic;
    font-family: 'Proxima Nova', -apple-system, 'Inter', Roboto, Arial, sans-serif;
}

/* ── Tiers footnote ── */
.sdv-tiers-footnote {
    margin: 8px 0 0 0;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    font-family: 'Proxima Nova', -apple-system, 'Inter', Roboto, Arial, sans-serif;
}
