/**
 * Tour Manager Elementor Widget Styles
 *
 * @package Tour_Manager
 */

/* ========================================
   Widget Wrapper
   ======================================== */
.tour-widget-wrapper {
    width: 100%;
    position: relative;
    --tour-card-gap: 24px;
    --tour-card-radius: 16px;
    --tour-primary-color: #C114A2;
    --tour-text-color: #1a1a1a;
    --tour-meta-color: #666;
}

/* ========================================
   Grid Layout
   ======================================== */
.tour-grid-wrapper {
    display: grid;
    gap: var(--tour-card-gap);
    width: 100%;
}

.tour-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--tour-card-gap);
    width: 100%;
}

.tour-grid-item,
.tour-list-item {
    min-width: 0;
}

/* ========================================
   Tour Card Base
   ======================================== */
.tour-card {
    background: #ffffff;
    border-radius: var(--tour-card-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Softer, premium shadow */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.tour-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* ========================================
   Card Image
   ======================================== */
.tour-card-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 66.66%;
    /* 3:2 Aspect Ratio */
    height: 0 !important;
    /* Override inline heights */
    flex-shrink: 0;
    background: #f5f5f5;
    z-index: 1;
}

.tour-card-image a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: absolute;
    /* Fix for absolute positioning inside padding-hack container */
}

/* Image Overlay */
.tour-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4) 100%);
    /* Subtle gradient */
}

/* Hover Effects */
.tour-hover-zoom .tour-card-image:hover img {
    transform: scale(1.08);
}

.tour-hover-zoom-out .tour-card-image:hover img {
    transform: scale(0.95);
}

/* ========================================
   Price Badge
   ======================================== */
.tour-price-badge {
    position: absolute;
    z-index: 3;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    line-height: 1;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.badge-top-left {
    top: 15px;
    left: 15px;
}

.badge-top-right {
    top: 15px;
    right: 15px;
}

.badge-bottom-left {
    bottom: 15px;
    left: 15px;
}

.badge-bottom-right {
    bottom: 15px;
    right: 15px;
}

/* ========================================
   Card Content
   ======================================== */
.tour-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

.tour-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--tour-text-color);
    transition: color 0.2s ease;
}

.tour-card-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tour-card-title a:hover {
    color: var(--tour-primary-color);
}

/* ========================================
   Meta Information
   ======================================== */
.tour-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--tour-meta-color);
}

.tour-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #f7f7f7;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.tour-meta-item .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: var(--tour-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Price & Actions
   ======================================== */
.tour-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--tour-primary-color);
    margin-top: auto;
    padding-top: 10px;
    letter-spacing: -0.5px;
}

.tour-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--tour-primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    width: 100%;
}

.tour-card-button:hover {
    background: #a00f85;
    /* Darker shade */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(193, 20, 162, 0.3);
    color: #ffffff;
}

/* ========================================
   List Layout
   ======================================== */
.tour-card-list {
    flex-direction: row;
    align-items: stretch;
}

.tour-card-list .tour-card-image {
    width: 35%;
    padding-top: 0;
    /* Clear aspect ratio hack */
    height: auto !important;
    min-height: 220px;
}

.tour-card-list .tour-card-content {
    width: 65%;
    padding: 25px 30px;
    justify-content: center;
}

/* ========================================
   Slider Specifics
   ======================================== */
.tour-layout-slider {
    padding: 0 40px;
    position: relative;
}

.tour-layout-slider .swiper-wrapper {
    align-items: stretch;
}

.tour-layout-slider .swiper-slide {
    height: auto;
    display: flex;
}

.tour-layout-slider .swiper-slide .tour-card {
    width: 100%;
}

.tour-card-title a:focus-visible,
.tour-card-button:focus-visible {
    outline: 2px solid var(--tour-primary-color);
    outline-offset: 3px;
}

/* Navigation */
.tour-layout-slider .swiper-button-prev,
.tour-layout-slider .swiper-button-next {
    width: 40px;
    height: 40px;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--tour-primary-color);
    z-index: 10;
}

.tour-layout-slider .swiper-button-prev:focus-visible,
.tour-layout-slider .swiper-button-next:focus-visible {
    outline: 2px solid var(--tour-primary-color);
    outline-offset: 3px;
}

.tour-layout-slider .swiper-button-prev:after,
.tour-layout-slider .swiper-button-next:after {
    font-size: 16px;
    font-weight: 700;
}

.tour-layout-slider .swiper-button-prev:hover,
.tour-layout-slider .swiper-button-next:hover {
    background: var(--tour-primary-color);
    color: #ffffff;
}

/* Pagination */
.tour-layout-slider .swiper-pagination {
    position: relative;
    margin-top: 30px;
    bottom: 0;
}

.tour-layout-slider .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #e0e0e0;
    opacity: 1;
    transition: all 0.3s ease;
}

.tour-layout-slider .swiper-pagination-bullet-active {
    background: var(--tour-primary-color);
    width: 20px;
    border-radius: 4px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1023px) {
    .tour-layout-slider {
        padding: 0;
        /* Remove padding for mobile carousel look */
    }

    .tour-card-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .tour-card {
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        /* Lighter shadow on mobile */
    }

    .tour-card-image {
        padding-top: 60%;
        /* Slightly smaller height on mobile */
    }

    .tour-card-content {
        padding: 16px;
        gap: 10px;
    }

    .tour-card-title {
        font-size: 1.05rem;
    }

    .tour-card-price {
        font-size: 1.15rem;
    }

    /* Optional mobile carousel for grid layout */
    .tour-mobile-carousel-enabled .tour-grid-wrapper {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
        margin-bottom: -10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tour-mobile-carousel-enabled .tour-grid-wrapper::-webkit-scrollbar {
        display: none;
    }

    .tour-mobile-carousel-enabled .tour-grid-item {
        flex: 0 0 min(84%, 320px);
        scroll-snap-align: start;
    }

    /* List Layout Mobile */
    .tour-card-list {
        flex-direction: column;
    }

    .tour-card-list .tour-card-image {
        width: 100%;
        height: 200px !important;
    }

    .tour-card-list .tour-card-content {
        width: 100%;
        padding: 20px;
    }

    /* Hide nav arrows on mobile */
    .tour-layout-slider .swiper-button-prev,
    .tour-layout-slider .swiper-button-next {
        display: none;
    }
}

/* RTL Support */
[dir="rtl"] .tour-card-meta {
    direction: rtl;
}

[dir="rtl"] .tour-meta-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .tour-card-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .tour-layout-slider .swiper-button-prev {
    right: auto;
    left: 0;
}

[dir="rtl"] .tour-layout-slider .swiper-button-next {
    left: auto;
    right: 0;
}

[dir="rtl"] .tour-mobile-carousel-enabled .tour-grid-wrapper {
    direction: rtl;
}

[dir="rtl"] .tour-mobile-carousel-enabled .tour-grid-item {
    scroll-snap-align: start;
}
