/**
 * Sarisara Itinerary Booking Form Styles
 *
 * Styles for the itinerary cost line item displayed in the
 * Traveler theme booking form summary section.
 *
 * @package Sarisara_Child
 * @since 3.1.0
 */

/* ==========================================================================
   Itinerary Line Item Container
   ========================================================================== */

.sarisara-itinerary-line-item {
    margin: 12px 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f5ff 0%, #fff 100%);
    border: 1px solid #e9e0f8;
    border-left: 4px solid #7c3aed;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sarisara-itinerary-line-item:hover {
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}

/* ==========================================================================
   Line Item Header
   ========================================================================== */

.sarisara-itinerary-line-item .itinerary-line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.sarisara-itinerary-line-item .itinerary-line-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #4a3a6b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sarisara-itinerary-line-item .itinerary-line-header .label i,
.sarisara-itinerary-line-item .itinerary-line-header .label .fa {
    color: #7c3aed;
    font-size: 14px;
}

.sarisara-itinerary-line-item .itinerary-cost-value {
    font-size: 16px;
    font-weight: 700;
    color: #7c3aed;
}

/* ==========================================================================
   Breakdown Section
   ========================================================================== */

.sarisara-itinerary-line-item .itinerary-line-breakdown {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0d4f5;
}

.sarisara-itinerary-line-item .breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.sarisara-itinerary-line-item .breakdown-item .label {
    color: #6b7280;
    font-weight: 400;
}

.sarisara-itinerary-line-item .breakdown-item .value {
    color: #4b5563;
    font-weight: 500;
}

.sarisara-itinerary-line-item .breakdown-item .count {
    font-weight: 600;
}

/* ==========================================================================
   Toggle Link
   ========================================================================== */

.sarisara-itinerary-line-item .itinerary-toggle-breakdown {
    margin-top: 8px;
    text-align: center;
}

.sarisara-itinerary-line-item .toggle-breakdown-link {
    font-size: 11px;
    color: #7c3aed;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.sarisara-itinerary-line-item .toggle-breakdown-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================================================
   Integration with Traveler Theme Booking Form
   ========================================================================== */

/* Sidebar booking form */
#st_tour_booking_sidebar .sarisara-itinerary-line-item {
    margin: 15px 0;
}

/* In-page booking form */
.form-booking-inpage .sarisara-itinerary-line-item {
    margin: 10px 0;
}

/* Price table integration */
.st-price-table .sarisara-itinerary-line-item,
.table-price-info .sarisara-itinerary-line-item {
    margin: 0;
    border-radius: 0;
    border-left-width: 3px;
}

/* Position after guide price row */
.guide-price-row + .sarisara-itinerary-line-item {
    margin-top: 0;
    border-top: none;
}

/* Position before total row */
.sarisara-itinerary-line-item + .st-tour-total,
.sarisara-itinerary-line-item + .total-price {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
}

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

@media (max-width: 768px) {
    .sarisara-itinerary-line-item {
        padding: 10px 12px;
    }

    .sarisara-itinerary-line-item .itinerary-line-header .label {
        font-size: 13px;
    }

    .sarisara-itinerary-line-item .itinerary-cost-value {
        font-size: 15px;
    }

    .sarisara-itinerary-line-item .breakdown-item {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .sarisara-itinerary-line-item .itinerary-line-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sarisara-itinerary-line-item .itinerary-cost-value {
        margin-top: 4px;
    }
}

/* ==========================================================================
   Cart Display Styles
   ========================================================================== */

.sarisara-cart-itinerary-info {
    margin: 10px 0;
    padding: 10px;
    background: #f9f5ff;
    border-radius: 4px;
}

.sarisara-cart-itinerary-info .cart-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.sarisara-cart-itinerary-info .cart-item-row.itinerary-total {
    font-weight: 600;
    color: #7c3aed;
}

.sarisara-cart-itinerary-info .itinerary-breakdown {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #e0d4f5;
}

.sarisara-cart-itinerary-info .breakdown-item {
    font-size: 12px;
    color: #6b7280;
}

/* ==========================================================================
   Admin Order View Styles
   ========================================================================== */

.sarisara-order-itinerary-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #7c3aed;
}

.sarisara-order-itinerary-section h4 {
    margin-top: 0;
    color: #7c3aed;
}

.sarisara-order-itinerary-section table {
    margin-top: 10px;
}

.sarisara-order-itinerary-section table tfoot tr {
    font-weight: bold;
    background: #eee;
}

/* ==========================================================================
   Animation States
   ========================================================================== */

.sarisara-itinerary-line-item.updating {
    opacity: 0.7;
}

.sarisara-itinerary-line-item.updating .itinerary-cost-value {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Cost highlight on update */
.sarisara-itinerary-line-item .itinerary-cost-value.highlight {
    animation: highlight 0.8s ease;
}

@keyframes highlight {
    0% {
        background-color: transparent;
    }
    30% {
        background-color: rgba(124, 58, 237, 0.2);
        border-radius: 4px;
    }
    100% {
        background-color: transparent;
    }
}

/* ==========================================================================
   Booking Form Simple Price Summary
   Updated: 2025-01 - Simplified 3-line display
   ========================================================================== */

.sarisara-booking-price-summary {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Price Lines */
.sarisara-booking-price-summary .price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #e9ecef;
}

.sarisara-booking-price-summary .price-line:last-child {
    border-bottom: none;
}

.sarisara-booking-price-summary .price-line .value {
    font-weight: 500;
    color: #374151;
}

/* Itinerary Charges Line */
.price-line.itinerary-charges span:first-child {
    font-size: 16px;
    color: #000 !important;
    font-weight: 600;
}

.sarisara-booking-price-summary .price-line.itinerary-charges .value {
    font-size: 16px;
    color: #686868 !important;
    font-weight: 500;
}

/* Tour Guide Charges Line */
.price-line.guide-charges span:first-child {
    font-size: 16px;
    color: #000 !important;
    font-weight: 600;
}

.sarisara-booking-price-summary .price-line.guide-charges .value {
    font-size: 16px;
    color: #686868 !important;
    font-weight: 500;
}

/* Service Charge Line — the platform's cut, charged on the whole trip. */
.price-line.service-charge span:first-child {
    font-size: 16px;
    color: #000 !important;
    font-weight: 600;
}

.price-line.service-charge .service-charge-rate {
    font-size: 13px;
    color: #686868;
    font-weight: 500;
}

.sarisara-booking-price-summary .price-line.service-charge .value {
    font-size: 16px;
    color: #686868 !important;
    font-weight: 500;
}

/* Total Line — the summed final price (Itinerary + Tour Guide + Service Charge). */
.sarisara-booking-price-summary .price-line.total-charges {
    border-top: 2px solid #090920;
    border-bottom: none;
    margin-top: 4px;
    padding-top: 12px;
}
.price-line.total-charges span:first-child {
    font-size: 18px;
    color: #090920 !important;
    font-weight: 700;
}
.sarisara-booking-price-summary .price-line.total-charges .value {
    font-size: 18px;
    color: #7700FF !important;
    font-weight: 700;
}

/* ==========================================================================
   Total Charge in .total-price-book (Traveler theme element)
   ========================================================================== */

/* Enhanced Total Charge styling */
.total-price-book.sarisara-total-charge {
    margin-top: 10px !important;
    padding-top: 15px;
    border-top: 1.5px solid #c2c2c2;
    padding-bottom: 10px;
}

.total-price-book.sarisara-total-charge #total-text h5 {
    color: #1f2937;
    font-weight: 700;
    font-size: 20px;
    margin-left: 15px;
}

.total-price-book.sarisara-total-charge .st-price-origin .price .value,
.total-price-book.sarisara-total-charge .text-lg {
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    margin-right: 15px !important;
}

/* ==========================================================================
   Booking Form Price Summary - Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .sarisara-booking-price-summary {
        margin: 12px 0;
        padding: 12px;
    }

    .sarisara-booking-price-summary .price-line {
        font-size: 14px;
        padding: 8px 0;
    }

    .price-line.itinerary-charges span:first-child,
    .price-line.guide-charges span:first-child,
    .price-line.service-charge span:first-child {
        font-size: 14px;
    }

    .sarisara-booking-price-summary .price-line.itinerary-charges .value,
    .sarisara-booking-price-summary .price-line.guide-charges .value,
    .sarisara-booking-price-summary .price-line.service-charge .value {
        font-size: 14px;
    }

    .total-price-book.sarisara-total-charge #total-text h5 {
        font-size: 18px;
        margin-left: 10px;
    }

    .total-price-book.sarisara-total-charge .st-price-origin .price .value,
    .total-price-book.sarisara-total-charge .text-lg {
        font-size: 18px !important;
        margin-right: 10px !important;
    }
}

@media (max-width: 480px) {
    .price-line.itinerary-charges span:first-child,
    .price-line.guide-charges span:first-child,
    .price-line.service-charge span:first-child {
        font-size: 13px;
    }

    .sarisara-booking-price-summary .price-line.itinerary-charges .value,
    .sarisara-booking-price-summary .price-line.guide-charges .value,
    .sarisara-booking-price-summary .price-line.service-charge .value {
        font-size: 13px;
    }

    .total-price-book.sarisara-total-charge #total-text h5 {
        font-size: 16px;
        margin-left: 8px;
    }

    .total-price-book.sarisara-total-charge .st-price-origin .price .value,
    .total-price-book.sarisara-total-charge .text-lg {
        font-size: 16px !important;
        margin-right: 8px !important;
    }
}

/* ==========================================================================
   Traveler Theme Integration - Booking Sidebar
   ========================================================================== */

/* Position in booking form sidebar */
#st_tour_booking_sidebar .sarisara-booking-price-summary {
    margin: 15px 0 20px;
}

/* Before Book Now button */
.form-booking-instant .sarisara-booking-price-summary,
.form-booking-contact .sarisara-booking-price-summary {
    margin-bottom: 15px;
}

/* Compact mode for smaller sidebars */
.sidebar-tour-detail .sarisara-booking-price-summary {
    margin: 10px 0;
    padding: 12px;
}

.sidebar-tour-detail .sarisara-booking-price-summary .price-line {
    font-size: 13px;
}

/* ==========================================================================
   Print Styles for Price Summary
   ========================================================================== */

@media print {
    .sarisara-booking-price-summary {
        border: 1px solid #000;
        page-break-inside: avoid;
        background: #fff !important;
    }

    .sarisara-booking-price-summary .price-line.total-charges {
        border-top: 2px solid #000;
    }

    .sarisara-booking-price-summary .price-line .value {
        color: #000 !important;
    }
}
