/* HMO Price Drawer Styles */

.hmo-price-drawer {
    --size: 50vh;
    font-family: inherit;
}

/* Ensure drawer is hidden by default */
.hmo-price-drawer:not([open]) {
    display: none;
}

/* Center drawer on desktop and limit width */
.hmo-price-drawer::part(panel) {
    max-width: 900px;
    margin: 0 auto;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

/* On desktop, center the drawer horizontally */
@media (min-width: 769px) {
    .hmo-price-drawer::part(panel) {
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 900px;
    }
}

.hmo-price-drawer::part(body) {
    padding: 0;
}

.price-breakdown-content {
    padding: 1.5rem;
}

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

.breakdown-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

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

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.breakdown-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #6c757d;
    transition: all 0.2s ease;
}

.breakdown-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.breakdown-item.internal {
    border-left-color: #28a745;
    background: #f1f9f3;
}

.breakdown-item.direct_delivery {
    border-left-color: #007bff;
}

.breakdown-item.single_cheapest_supplier {
    border-left-color: #17a2b8;
}

.breakdown-item.external_average {
    border-left-color: #6c757d;
    background: #f8f9fa;
}

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

.breakdown-item-header strong {
    font-size: 1rem;
    color: #333;
}

.tier-icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.breakdown-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.detail-label {
    color: #6c757d;
}

.detail-value {
    font-weight: 500;
    color: #333;
}

.breakdown-footer {
    background: #fff;
    border-top: 2px solid #e9ecef;
    padding-top: 1.5rem;
    position: sticky;
    bottom: 0;
}

.breakdown-total {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.total-line,
.average-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.total-line {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}

.total-value {
    color: #28a745;
    font-size: 1.3rem;
}

.average-line {
    font-size: 0.95rem;
    color: #6c757d;
}

.average-value {
    font-weight: 500;
}

.price-info-trigger {
    cursor: pointer;
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.price-info-trigger:hover {
    color: #0056b3;
    text-decoration: underline;
}

.price-info-trigger i {
    font-size: 0.85rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .hmo-price-drawer {
        --size: 50vh;
    }

    .price-breakdown-content {
        padding: 1rem;
    }

    .breakdown-header h5 {
        font-size: 1.1rem;
    }

    .breakdown-item {
        padding: 0.75rem;
    }

    .breakdown-item-header strong {
        font-size: 0.9rem;
    }

    .breakdown-detail {
        font-size: 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .total-line {
        font-size: 1.1rem;
    }

    .total-value {
        font-size: 1.2rem;
    }
}

/* Badge styling for direct delivery */
.badge-success {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
