/* Tour Itinerary Widget Styles */

.tour-itinerary-widget {
    background: #84cc16;
    min-height: auto; /* Changed from 100vh */
    overflow-x: hidden;
    position: relative;
    border: none;
    outline: none;
}

/* Header */
.tour-itinerary-header {
    text-align: center;
    padding: 3rem 1rem 5rem 1rem;
    color: white;
}

.tour-itinerary-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: inline-block;
    border-bottom: 4px solid white;
    padding-bottom: 0.25rem;
}

.tour-itinerary-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    padding-bottom: 35px;
}

/* Content Container */
.tour-itinerary-content {
    position: relative;
    padding-bottom: 5rem;
    border: none;
    outline: none;
    background: #ff7001;
}

/* Road/Timeline */
.tour-itinerary-road-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 13rem;
    bottom: 0;
    width: 70px;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.tour-itinerary-start,
.tour-itinerary-end {
    background: #6b7280;
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
    flex-shrink: 0;
}

.tour-itinerary-start {
    border-radius: 2rem 2rem 0 0;
    padding-top: 1rem;
}

.tour-itinerary-end {
    background: #4b5563;
    border-radius: 0 0 1.5rem 1.5rem;
}

.tour-itinerary-road {
    flex: 1;
    background: #6b7280;
    position: relative;
    border-radius: 0;
}

.tour-itinerary-road-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    border-left: 2px dashed white;
    transform: translateX(-50%);
}

/* Car Icon */
.tour-car-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    transition: top 0.3s ease-out;
    z-index: 50;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.25rem;
    width: 75px;
}

.tour-car-icon svg {
    width: 45px;
    height: 70px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.tour-car-icon img {
    width: 150px;
    height: 150px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* Items Container */
.tour-items-container {
    position: relative;
    z-index: 30;
}

/* Tour Item */
.tour-item {
    display: flex;
    align-items: stretch;
    min-height: 450px;
    position: relative;
    margin: 0;
    padding: 0;
}

.tour-item-right .tour-item-image {
    width: 50%;
    padding-right: calc(var(--road-width, 70px) / 2);
    line-height: 0;
    position: relative;
}

.tour-item-right .tour-item-content {
    width: 50%;
    padding-left: calc(var(--road-width, 70px) / 2);
}

.tour-item-left .tour-item-content {
    width: 50%;
    padding-right: calc(var(--road-width, 70px) / 2);
}

.tour-item-left .tour-item-image {
    width: 50%;
    padding-left: calc(var(--road-width, 70px) / 2);
    line-height: 0;
    position: relative;
}

.tour-item-image {
    line-height: 0;
    position: relative;
}

.tour-item-image > img {
    position: relative;
    display: block;
    width: 100%;
    height: 450px;
    object-fit: cover;
}

/* Image Overlay Functionality */
.tour-item-image.has-overlay {
    position: relative;
}

.tour-item-image.has-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color, #00800061);
    opacity: var(--overlay-opacity, 0.38);
    mix-blend-mode: var(--overlay-blend-mode, normal);
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s ease;
}

.tour-item-image.has-overlay img {
    position: relative;
    z-index: 1;
}

/* Day Badge */
.tour-day-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    background: #6b7280;
    border: 8px solid white;
    border-radius: 50%;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.125rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tour-day-badge:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Content Card */
.tour-content-card {
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.tour-card-inner {
    padding: 0rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 50px;
}

.tour-destination-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 3.2;
}

.tour-location {
    font-size: 1.125rem;
    color: #718096;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.tour-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Info Grid */
.tour-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.tour-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.tour-info-icon {
    width: 24px;
    height: 24px;
    color: #84cc16;
    flex-shrink: 0;
    margin-top: 0.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tour-info-icon i,
.tour-info-icon svg {
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.tour-info-item strong {
    font-size: 1rem;
    color: #2d3748;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.tour-info-item p {
    font-size: 1rem;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

/* Tour Delight */
.tour-delight {
    background: #2d3748;
    color: white;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    margin: 0;
}

.tour-delight-icon {
    width: 24px;
    height: 24px;
    color: #ffd700;
    flex-shrink: 0;
}

.tour-delight strong {
    font-weight: 700;
    font-size: 1.125rem;
}

.tour-delight span {
    font-weight: 500;
}

/* Elementor specific override */
.elementor-7 .elementor-element.elementor-element-0bd06f2 .tour-delight {
    background: #2d3748;
    color: #ffffff;
    padding: 1.5rem 1rem;
}

/* Responsive - Mobile Layout */
@media (max-width: 768px) {
    .tour-itinerary-widget {
        min-height: auto;
        padding-bottom: 0;
    }

    .tour-itinerary-header {
        margin-bottom: 0; /* Remove any bottom margin */
    }

    .tour-itinerary-title {
        font-size: 2rem;
    }

    .tour-itinerary-header {
        padding: 2rem 1rem 1rem 1rem;
        position: relative;
        z-index: 100;
    }

    .tour-itinerary-content {
        display: flex;
        flex-direction: row;
        padding-bottom: 0; /* Removed padding */
        position: relative;
        min-height: auto;
        align-items: flex-start; /* Align to top */
    }

    /* Road on left - Narrow sidebar */
    .tour-itinerary-road-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        transform: none;
        width: 50px;
        min-width: 50px;
        margin: 0;
        height: 100%; /* Will be adjusted by JavaScript on mobile */
        flex-shrink: 0;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }

    .tour-itinerary-start {
        order: 1; /* First */
        border-radius: 0 0 0.75rem 0.75rem;
        padding-top: 0.8rem;
    }

    .tour-itinerary-road {
        order: 2; /* Middle */
        flex: 1;
        height: auto;
        min-height: 200px;
    }

    .tour-itinerary-end {
        order: 3; /* Last */
        border-radius: 0.75rem 0.75rem 0 0;
        margin-top: 0; /* No extra margin */
    }

    .tour-itinerary-start,
    .tour-itinerary-end {
        font-size: 0.6rem;
        padding: 0.4rem 0.2rem;
        letter-spacing: 0.5px;
        flex-shrink: 0;
    }

    .tour-car-icon {
        display: block;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
    }

    .tour-car-icon svg {
        width: 28px;
        height: 48px;
    }

    .tour-car-icon img {
        width: 100px;
        height: 100px;
        object-fit: contain;
    }

    /* Content on right */
    .tour-items-container {
        width: 100%;
        flex: 1;
        padding-left: 60px;
        padding-bottom: 0; /* Removed all padding */
        position: relative;
        z-index: 5;
    }

    /* Tour Item - Mobile Layout: Image -> Day Badge -> Content */
    .tour-item {
        flex-direction: column !important;
        min-height: auto;
        margin-bottom: 0.25rem; /* Minimal spacing between items */
        width: 100%;
        display: flex;
    }

    /* Remove margin from last item */
    .tour-item:last-child {
        margin-bottom: 0;
    }

    .tour-item-right .tour-item-image,
    .tour-item-right .tour-item-content,
    .tour-item-left .tour-item-content,
    .tour-item-left .tour-item-image {
        width: 100%;
        padding: 0;
    }

    /* Image - First element */
    .tour-item-image {
        order: 1;
        width: 100%;
        margin-bottom: 0;
    }

    .tour-item-image img {
        height: 200px;
        object-fit: cover;
        width: 100%;
        border-radius: 0;
        display: block;
    }

    /* Override Elementor specific styles */
    .elementor-7 .elementor-element.elementor-element-0bd06f2 .tour-item-image img,
    [class*="elementor"] .tour-item-image img {
        height: 200px !important;
    }

    /* Day Badge - Second element, overlapping */
    .tour-day-badge {
        order: 2;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: -35px auto 0 auto; /* Negative margin to overlap image */
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
        border-width: 5px;
        z-index: 60;
        flex-shrink: 0;
    }

    /* Content - Third element */
    .tour-item-content {
        order: 3;
        width: 100%;
    }

    .tour-content-card {
        border-radius: 0;
        margin-bottom: 0;
    }

    .tour-card-inner {
        padding: 1.5rem 1.25rem;
    }

    .tour-destination-name {
        font-size: 1.5rem;
        text-align: left;
        margin-top: 0;
        margin-bottom: 0.25rem;
    }

    .tour-location {
        font-size: 0.9rem;
        text-align: left;
        margin-bottom: 1rem;
    }

    .tour-description {
        font-size: 0.85rem;
        text-align: left;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .tour-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tour-info-item {
        text-align: left;
        flex-direction: row;
        gap: 0.65rem;
    }

    .tour-info-icon {
        margin: 0;
        width: 20px;
        height: 20px;
    }

    .tour-info-item strong {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }

    .tour-info-item p {
        font-size: 0.85rem;
    }

    .tour-delight {
        padding: 1rem 1.25rem;
        font-size: 0.85rem;
        text-align: left;
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .tour-delight-icon {
        width: 18px;
        height: 18px;
    }

    .tour-delight strong {
        font-size: 0.85rem;
    }
}

/* Additional responsive for very small screens */
@media (max-width: 480px) {
    .tour-itinerary-road-wrapper {
        width: 45px;
        min-width: 45px;
    }

    .tour-items-container {
        padding-left: 55px;
        padding-bottom: 40px;
    }

    .tour-itinerary-start,
    .tour-itinerary-end {
        font-size: 0.55rem;
        padding: 0.3rem 0.15rem;
    }

    .tour-car-icon svg {
        width: 24px;
        height: 42px;
    }

    .tour-car-icon img {
        width: 80px;
        height: 80px;
        object-fit: contain;
    }

    .tour-day-badge {
        width: 65px;
        height: 65px;
        font-size: 0.75rem;
        border-width: 4px;
        margin: -30px auto 0 auto;
    }

    .tour-card-inner {
        padding: 1.25rem 1rem;
    }

    .tour-destination-name {
        font-size: 1.35rem;
    }

    .tour-location {
        font-size: 0.85rem;
    }

    .tour-description {
        font-size: 0.8rem;
    }

    .tour-item-image img {
        height: 200px;
    }

    /* Override Elementor specific styles */
    .elementor-7 .elementor-element.elementor-element-0bd06f2 .tour-item-image img,
    [class*="elementor"] .tour-item-image img {
        height: 200px !important;
    }

    .tour-delight {
        padding: 0.85rem 1rem;
        font-size: 0.8rem;
    }

    .tour-info-item strong,
    .tour-info-item p {
        font-size: 0.8rem;
    }
}

/* Additional very small screens (< 360px) */
@media (max-width: 360px) {
    .tour-itinerary-road-wrapper {
        width: 40px;
        min-width: 40px;
    }

    .tour-items-container {
        padding-left: 50px;
    }

    .tour-car-icon svg {
        width: 20px;
        height: 38px;
    }

    .tour-car-icon img {
        width: 70px;
        height: 70px;
        object-fit: contain;
    }

    .tour-destination-name {
        font-size: 1.2rem;
    }

    .tour-day-badge {
        width: 60px;
        height: 60px;
        margin: -28px auto 0 auto;
    }
}
