/**
 * Price Breakdown Panel CSS - Enhanced Typography & Visual Hierarchy
 * Mobile-first responsive design with improved readability
 */

/* ===========================
   Price Breakdown Panel - Block
   =========================== */

.price-breakdown-panel {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Mobile / Tablet: In-flow natural placement */
@media (max-width: 1023px) {
    .price-breakdown-panel {
        position: relative;
        margin-top: 24px;
        margin-bottom: 24px;
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
    }
}

/* Desktop: Sticky sidebar with solid styling */
@media (min-width: 1024px) {
    .price-breakdown-panel {
        position: sticky;
        top: 100px;
        background: #FFFFFF;
        border: 1px solid #cbd5e1;
        box-shadow: none;
    }
    
    .price-breakdown-panel__header {
        background: #FFFFFF;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .price-breakdown-panel__totals {
        background: #f8fafc;
        border-top: 2px solid #e2e8f0;
    }
}

/* ===========================
   Header Section
   =========================== */

.price-breakdown-panel__header {
    padding: 18px 20px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.price-breakdown-panel__title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
}

.price-breakdown-panel__toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.price-breakdown-panel__toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.price-breakdown-panel__toggle:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.price-breakdown-panel__toggle-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.price-breakdown-panel--collapsed .price-breakdown-panel__toggle-icon {
    transform: rotate(180deg);
}

/* Mobile only toggle visibility */
@media (min-width: 1024px) {
    .price-breakdown-panel__toggle {
        display: none;
    }

    .price-breakdown-panel__header {
        cursor: default;
    }
}

/* ===========================
   Content Panel
   =========================== */

.price-breakdown-panel__content {
    max-height: 1000px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.price-breakdown-panel--collapsed .price-breakdown-panel__content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Desktop: Always expanded */
@media (min-width: 1024px) {
    .price-breakdown-panel--collapsed .price-breakdown-panel__content {
        max-height: 1000px;
        opacity: 1;
        overflow-y: auto;
    }
}

.price-breakdown-panel__items {
    padding: 24px 20px;
}

/* ===========================
   Price Item Rows - Enhanced Typography
   =========================== */

.price-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 20px;
}

.price-item:first-child {
    padding-top: 0;
}

.price-item:last-child {
    border-bottom: none;
}

.price-item__description {
    flex: 1;
    line-height: 1.6;
}

.price-item__description .fw-semibold,
.price-item__description > span {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    display: block;
    line-height: 1.5;
}

.price-item__description .text-muted,
.price-item__description div[style*="font-size"] {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.5;
    margin-top: 4px;
    font-style: italic;
}

.price-item__amount {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    min-width: fit-content;
}

/* Empty state */
#price-empty-state {
    padding: 40px 20px;
    text-align: center;
}

#price-empty-state i {
    font-size: 48px;
    opacity: 0.25;
    margin-bottom: 16px;
    display: block;
}

#price-empty-state {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

/* ===========================
   Totals Section - Enhanced
   =========================== */

.price-breakdown-panel__totals {
    padding: 24px 20px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
}

.price-breakdown-panel__totals .d-flex {
    padding: 0;
    margin: 0;
}

.price-breakdown-panel__subtotal {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.price-breakdown-panel__subtotal .fw-bold,
.price-breakdown-panel__subtotal > span:first-child {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

.price-breakdown-panel__subtotal [data-subtotal],
.price-breakdown-panel__subtotal .fs-5 {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #2563eb !important;
    letter-spacing: -0.03em !important;
    font-variant-numeric: tabular-nums;
}

/* Trust features section */
.price-breakdown-panel__trust {
    padding-top: 20px !important;
    margin-top: 20px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.price-breakdown-panel__trust ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.price-breakdown-panel__trust li {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    padding: 6px 0;
}

.price-breakdown-panel__trust li i {
    font-size: 14px;
    margin-right: 8px;
    color: #059669;
}

/* ===========================
   Summary Quick View (Mobile Collapsed)
   =========================== */

.price-breakdown-panel__summary {
    display: none;
    padding: 14px 20px;
    background: #FFFFFF;
    border-top: 1px solid #e2e8f0;
}

.price-breakdown-panel--collapsed .price-breakdown-panel__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 1024px) {
    .price-breakdown-panel__summary {
        display: none !important;
    }
}

.price-breakdown-panel__summary-label {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
}

.price-breakdown-panel__summary-amount {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb;
    font-variant-numeric: tabular-nums;
}

/* ===========================
   Loading State
   =========================== */

.price-breakdown-panel--loading {
    opacity: 0.6;
    pointer-events: none;
}

.price-breakdown-panel__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===========================
   Empty State
   =========================== */

.price-breakdown-panel__empty {
    padding: 48px 20px;
    text-align: center;
    color: #94a3b8;
}

.price-breakdown-panel__empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.price-breakdown-panel__empty-text {
    font-size: 14px;
    line-height: 1.6;
}

/* ===========================
   Tablet Layout (768px+)
   =========================== */

@media (min-width: 768px) {
    .price-breakdown-panel__header {
        padding: 20px 24px;
    }

    .price-breakdown-panel__title {
        font-size: 19px;
    }

    .price-breakdown-panel__items {
        padding: 28px 24px;
    }
    
    .price-breakdown-panel__totals {
        padding: 28px 24px;
    }

    .price-item {
        padding: 18px 0;
    }

    .price-item__description .fw-semibold,
    .price-item__description > span {
        font-size: 16px;
    }

    .price-item__amount {
        font-size: 18px;
    }
    
    .price-breakdown-panel__subtotal .fw-bold,
    .price-breakdown-panel__subtotal > span:first-child {
        font-size: 18px !important;
    }
    
    .price-breakdown-panel__subtotal [data-subtotal],
    .price-breakdown-panel__subtotal .fs-5 {
        font-size: 32px !important;
        color: #2563eb !important;
    }
}

/* ===========================
   Desktop Layout (1024px+)
   =========================== */

@media (min-width: 1024px) {
    .price-breakdown-panel__header {
        padding: 24px 28px;
    }

    .price-breakdown-panel__title {
        font-size: 20px;
    }
    
    .price-breakdown-panel__items {
        padding: 32px 28px;
    }
    
    .price-breakdown-panel__totals {
        padding: 32px 28px;
    }
    
    .price-item__description .fw-semibold,
    .price-item__description > span {
        font-size: 16px;
    }

    .price-item__amount {
        font-size: 19px;
    }
    
    .price-breakdown-panel__subtotal .fw-bold,
    .price-breakdown-panel__subtotal > span:first-child {
        font-size: 19px !important;
    }
    
    .price-breakdown-panel__subtotal [data-subtotal],
    .price-breakdown-panel__subtotal .fs-5 {
        font-size: 34px !important;
        color: #2563eb !important;
    }
}

/* ===========================
   High Contrast Mode
   =========================== */

@media (prefers-contrast: high) {
    .price-breakdown-panel {
        border: 2px solid #000000;
    }

    .price-item {
        border-bottom-width: 2px;
    }
}

/* ===========================
   Reduced Motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
    .price-breakdown-panel,
    .price-breakdown-panel__content,
    .price-breakdown-panel__toggle-icon,
    .price-breakdown-panel__toggle {
        transition: none;
    }

    .price-breakdown-panel__loading {
        animation: none;
        border: 3px solid #2563eb;
    }
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    .price-breakdown-panel {
        position: static;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }

    .price-breakdown-panel__toggle {
        display: none;
    }

    .price-breakdown-panel--collapsed .price-breakdown-panel__content {
        max-height: none;
        opacity: 1;
    }

    .price-breakdown-panel__summary {
        display: none !important;
    }
}
