/* ==========================================================================
   Osattvik Cart Pricing Breakdown
   Premium responsive styling for tiffin meal pricing visibility
   ========================================================================== */

/* --- Wrapper --- */
.osattvik-pricing-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* --- Card Container --- */
.osattvik-pricing-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(40, 167, 69, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.osattvik-pricing-card:hover {
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.12);
}

/* --- Header --- */
.osattvik-pricing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid rgba(40, 167, 69, 0.1);
}

.osattvik-pricing-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.osattvik-toggle-details {
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.osattvik-toggle-details.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.osattvik-toggle-details.active .fa {
    transform: rotate(180deg);
}

.osattvik-toggle-details .fa {
    transition: transform 0.3s ease;
}

/* --- Pricing Lines Container --- */
.osattvik-pricing-lines {
    padding: 0;
}

/* --- Individual Line Card --- */
.osattvik-line-card {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.osattvik-line-card:last-child {
    border-bottom: none;
}

.osattvik-line-card:hover {
    background: #fafffe;
}

/* Line Header */
.osattvik-line-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.osattvik-line-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a2e;
    line-height: 1.3;
}

.osattvik-line-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.osattvik-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.osattvik-badge-slot {
    background: #e8f5e9;
    color: #2e7d32;
}

.osattvik-badge-date {
    background: #fff3e0;
    color: #e65100;
}

.osattvik-line-subtotal {
    font-size: 1.1rem;
    font-weight: 800;
    color: #28a745;
    white-space: nowrap;
}

/* --- Price Breakdown Grid --- */
.osattvik-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.osattvik-price-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafb;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
}

.osattvik-price-cell .cell-label {
    color: #64748b;
    font-weight: 500;
}

.osattvik-price-cell .cell-value {
    font-weight: 700;
    color: #1e293b;
}

.osattvik-price-cell.highlight {
    background: #ecfdf5;
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.osattvik-price-cell.highlight .cell-value {
    color: #28a745;
}

/* --- Items Detail List --- */
.osattvik-items-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 14px;
}

.osattvik-items-detail.show {
    max-height: 600px;
    padding: 10px 14px;
}

.osattvik-detail-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #28a745;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    border: none;
    background: none;
    transition: opacity 0.2s;
}

.osattvik-detail-toggle:hover {
    opacity: 0.8;
}

.osattvik-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.82rem;
}

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

.osattvik-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-weight: 500;
}

.osattvik-item-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.osattvik-item-type-dot.included {
    background: #28a745;
}

.osattvik-item-type-dot.addon {
    background: #ffc107;
}

.osattvik-item-type-dot.extra {
    background: #17a2b8;
}

.osattvik-item-price {
    font-weight: 700;
    color: #1e293b;
}

.osattvik-item-price.free {
    color: #28a745;
    font-weight: 600;
}

/* --- Type Legend --- */
.osattvik-type-legend {
    display: flex;
    gap: 16px;
    padding: 8px 14px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.osattvik-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

/* --- Summary Section --- */
.osattvik-pricing-summary {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    border-top: 2px solid rgba(40, 167, 69, 0.1);
}

.osattvik-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9rem;
}

.osattvik-grand-total {
    padding: 10px 0 4px;
}

.osattvik-discount-row span:last-child::before {
    content: '−';
    margin-right: 2px;
}

/* --- Empty State --- */
.osattvik-empty-state {
    text-align: center;
    padding: 32px 24px;
    color: #94a3b8;
}

.osattvik-empty-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .osattvik-pricing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }

    .osattvik-toggle-details {
        align-self: flex-end;
    }

    .osattvik-price-grid {
        grid-template-columns: 1fr;
    }

    .osattvik-line-card {
        padding: 14px 18px;
    }

    .osattvik-line-header {
        flex-direction: column;
    }

    .osattvik-line-subtotal {
        font-size: 1rem;
    }

    .osattvik-pricing-summary {
        padding: 16px 18px;
    }

    .osattvik-summary-row {
        font-size: 0.85rem;
    }

    .osattvik-type-legend {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .osattvik-pricing-card {
        border-radius: 12px;
    }

    .osattvik-pricing-icon {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .osattvik-line-title {
        font-size: 0.88rem;
    }

    .osattvik-price-cell {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* --- Animation --- */
@keyframes osattvikFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.osattvik-pricing-wrapper {
    animation: osattvikFadeIn 0.5s ease forwards;
}

.osattvik-line-card {
    animation: osattvikFadeIn 0.4s ease forwards;
}

.osattvik-line-card:nth-child(2) { animation-delay: 0.1s; }
.osattvik-line-card:nth-child(3) { animation-delay: 0.2s; }
.osattvik-line-card:nth-child(4) { animation-delay: 0.3s; }
