/**
 * HMO Cart Confirmation Drawer Styling
 * Displays breakdown when product is split across multiple suppliers
 */

.hmo-cart-confirmation-drawer {
    --footer-spacing: 1rem;
}

.hmo-cart-confirmation-drawer::part(panel) {
    height: unset !important;
}

/* Desktop styling - centered with max width and rounded top corners */
@media (min-width: 768px) {
    .hmo-cart-confirmation-drawer::part(panel) {
        max-width: 600px;
        margin-left: auto !important;
        margin-right: auto !important;
        left: 50% !important;
        transform: translateX(-50%);
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }
}

.cart-confirmation-content {
    padding: 1.5rem 1rem;
}

/* Header Section */
.confirmation-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.confirmation-header h5 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.confirmation-header .text-muted {
    font-size: 0.95rem;
}

/* Breakdown Info Section */
.breakdown-info {
    margin-bottom: 1.5rem;
}

.info-text {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1rem;
    text-align: center;
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #D3D3D3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Direct leverbaar items (internal + direct_delivery) */
.breakdown-item.internal,
.breakdown-item.direct_delivery {
    border-left: 4px solid #82C91E;
}

.breakdown-item.internal .tier-icon,
.breakdown-item.direct_delivery .tier-icon {
    color: #82C91E;
}

/* Langere levertijd items (single_cheapest_supplier + external_average) */
.breakdown-item.single_cheapest_supplier,
.breakdown-item.external_average {
    border-left: 4px solid #FC8320;
}

.breakdown-item.single_cheapest_supplier .tier-icon,
.breakdown-item.external_average .tier-icon {
    color: #FC8320;
}

.breakdown-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.tier-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.tier-info {
    flex: 1;
}

.tier-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tier-title strong {
    font-size: 1rem;
    color: #212529;
}

.tier-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.tier-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.price-per-unit {
    font-weight: 500;
    color: #495057;
}

.delivery-time {
    color: #6c757d;
}

.breakdown-subtotal {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    flex-shrink: 0;
}

.badge-sm {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

.badge-direct-delivery {
    background-color: #82C91E;
    color: #FFFFFF;
    font-weight: 600;
}

.badge-longer-delivery {
    background-color: #FC8320;
    color: #FFFFFF;
    font-weight: 600;
}

/* Total Section */
.breakdown-total {
    background: #fff;
    border-top: 2px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.total-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #138612;
}

/* Footer Actions */
.drawer-footer-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #D3D3D3;
}

.drawer-footer-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.drawer-footer-actions .btn-secondary {
    background: #FFFFFF;
    border: 2px solid #1F3B1B;
    color: #1F3B1B;
}

.drawer-footer-actions .btn-secondary:hover {
    background: #1F3B1B;
    color: #FFFFFF;
}

.drawer-footer-actions .btn-secondary:focus,
.drawer-footer-actions .btn-secondary:active {
    background: #FFFFFF !important;
    border-color: #1F3B1B !important;
    color: #1F3B1B !important;
    box-shadow: none !important;
    outline: none !important;
}

.drawer-footer-actions .btn-primary {
    background: #82C91E;
    border: none;
    color: #FFFFFF;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
}

.drawer-footer-actions .btn-primary:hover {
    background: #6ead14;
    text-decoration: none !important;
}

.drawer-footer-actions .btn-primary:focus,
.drawer-footer-actions .btn-primary:active {
    background: #82C91E !important;
    border-color: #82C91E !important;
    box-shadow: none !important;
    outline: none !important;
}

.drawer-footer-actions .btn-primary:visited {
    background: #82C91E !important;
    color: #FFFFFF !important;
}

.drawer-footer-actions .btn-primary i {
    margin-right: 0.5rem;
}

/* Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Responsive */
@media (max-width: 576px) {
    .cart-confirmation-content {
        padding: 1rem 0.75rem;
    }

    .breakdown-item {
        padding: 0.75rem;
    }

    .breakdown-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .breakdown-subtotal {
        align-self: flex-end;
    }

    .drawer-footer-actions {
        flex-direction: column;
    }

    .drawer-footer-actions .btn {
        width: 100%;
    }
}
