/* --- Premium Packages Styles --- */

:root {
    --pkg-accent: #7d5fff;
    --pkg-card-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
}

/* Hero Section Enhancement */
.filter-sidebar {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--gray-150);
    position: sticky !important;
    top: 100px !important;
    z-index: 100;
}

.packages-hero {
    height: 60vh;
    /* Re-increased for better distribution */
    min-height: 480px;
    background-image: url('https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center 30%;
    border-radius: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    padding-top: 140px;
    /* Increased padding to move badge further from nav */
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .packages-hero {
        height: auto;
        min-height: 420px;
        padding-top: 130px;
        padding-bottom: 20px;
    }

    main.section-container {
        padding-top: 1.5rem !important;
    }
}

.packages-hero h1 {
    font-size: clamp(2.2rem, 7vw, 3.8rem) !important;
    line-height: 1.1;
    margin-bottom: 25px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.packages-hero .lead {
    font-size: 1.25rem !important;
    max-width: 800px;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
}

.packages-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.75) 0%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.85) 100%);
    z-index: -1;
}

/* Category Quick Slider */
.cat-quick-slider {
    margin-top: auto;
    padding-bottom: 25px;
    width: 100%;
}

.cat-quick-item {
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}


.cat-quick-item:hover,
.cat-quick-item.active {
    background: white;
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Advanced Filter Sidebar */
.filter-sidebar {
    background: white;
    border: 1px solid var(--gray-150);
    border-radius: 30px;
    overflow: hidden;
}

.filter-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-150);
}

.styled-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.styled-checkbox:hover {
    background: var(--gray-100);
}

.styled-checkbox input {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--gray-200);
    cursor: pointer;
}

.duration-select-custom {
    font-size: 0.95rem !important;
    border: 1px solid var(--gray-200) !important;
    padding: 12px 15px !important;
    font-weight: 700 !important;
    color: var(--secondary) !important;
    background-color: white !important;
    transition: all 0.3s ease;
}

.duration-select-custom:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(76, 51, 152, 0.1) !important;
}

/* Premium Package Card */
.pkg-content-v2 {
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    min-height: 130px; /* Ensure consistent height for text area */
}

.pkg-title-v2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Allow 2 lines for titles */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.pkg-rating-v2 {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1a1a1a;
    flex-shrink: 0;
}

.pkg-rating-v2 i {
    font-size: 0.7rem;
    color: #ff9f43;
}

.pkg-stats-v2 {
    display: flex;
    gap: 12px;
    margin: 12px 0 15px;
}

.stat-item-v2 {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #555;
    font-weight: 600;
}

.stat-item-v2 i {
    font-size: 0.8rem;
}

.pkg-footer-v2 {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.pkg-price-col {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #999;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.price-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4834d4;
    line-height: 1;
}

.price-val-old {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ef4444 !important;
    text-decoration: line-through;
    opacity: 1;
}

.pkg-details-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4834d4;
    text-decoration: underline;
}

.pkg-badge-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: #5d4037;
    color: white;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Base Card Fixes */
.premium-pkg-card {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.premium-pkg-card:hover {
    transform: translateY(-5px);
}

.pkg-img-container {
    height: 270px; /* Increased as per request for all screens */
    position: relative !important;
    overflow: hidden;
    border-radius: 0 !important; /* No radius as per latest request */
    margin-bottom: 0;
}

.pkg-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
}

.pkg-wishlist {
    position: absolute;
    top: 10px !important;
    right: 10px !important;
    background: white;
    width: 28px !important;
    height: 28px !important;
    border-radius: 4px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4757;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 4 Column Grid Layout helper */
@media (min-width: 768px) and (max-width: 991px) {
    .pkg-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .pkg-grid-layout > .col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .pkg-grid-layout > .no-match-found {
        grid-column: 1 / -1;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .pkg-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0px !important;
    }
    .pkg-grid-layout > .col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .pkg-grid-layout > .no-match-found {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1200px) {
    .pkg-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0px !important;
    }
    .pkg-grid-layout > .col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .pkg-grid-layout > .no-match-found {
        grid-column: 1 / -1;
    }
}

#mobileFilters.offcanvas {
    height: 100% !important;
    max-height: 100vh !important;
}

#mobileFilters .offcanvas-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px !important;
}

#mobileFilters .offcanvas-body {
    overflow-y: auto !important;
    padding-top: 25px !important; /* Gap after header */
    padding-bottom: 120px !important;
    -webkit-overflow-scrolling: touch;
}

/* Sorting Bar */
.sorting-bar {
    background: white;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--gray-150);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.filter-btn-modern {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #1a1a1a;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.filter-btn-modern:hover {
    background: #4834d4;
    color: white;
    border-color: #4834d4;
    transform: translateY(-2px);
}

.results-count {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    font-size: 0.95rem; /* Increased */
    font-weight: 700;
    outline: none;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    border-color: #4834d4;
    background-color: white;
}

@media (max-width: 991px) {
    .packages-hero {
        height: auto;
        padding: 100px 0 40px;
        border-radius: 0;
    }

    .cat-quick-slider {
        margin-top: 30px;
    }

    main.section-container {
        margin-top: 0.5rem !important;
        margin-bottom: 2rem !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }

    .sorting-bar {
        margin-bottom: 15px !important;
        padding: 10px !important;
        flex-direction: column;
        align-items: stretch !important;
    }

    .sorting-bar .d-flex {
        width: 100%;
        justify-content: center;
    }

    .sort-select {
        width: 100% !important;
        text-align: center;
    }

    /* Move contact widget up on packages page to avoid overlap with mobile filter CTA */
    .contact-widget-container {
        bottom: 110px !important;
    }

    .btn-glass-cta {
        background: rgba(125, 95, 255, 0.85) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: white !important;
        box-shadow: 0 10px 30px rgba(125, 95, 255, 0.4) !important;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        font-size: 0.85rem;
    }

    .btn-glass-cta:active {
        transform: scale(0.98);
        background: rgba(125, 95, 255, 0.95) !important;
    }

    .premium-pkg-card .pkg-content {
        padding: 15px !important;
    }

    .premium-pkg-card .pkg-title {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.4em;
    }

    .premium-pkg-card .pkg-img-container {
        height: 270px !important;
    }

    .premium-pkg-card .pkg-stats {
        gap: 10px !important;
        margin-bottom: 0 !important;
    }

    .premium-pkg-card .stat-item {
        font-size: 0.65rem !important;
    }

    .pkg-top-meta {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
    }

    .price-badge {
        padding: 0 10px !important;
        font-size: 0.7rem !important;
        height: 32px !important;
    }

    .pkg-wishlist {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
}

/* Extra space before footer on large screens */
@media (min-width: 992px) {
    main.section-container {
        margin-bottom: 8rem !important;
    }
}

/* Mobile Responsive 2-Column Grid Alignment */
@media (max-width: 767px) {
    .pkg-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .pkg-grid-layout > .col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .premium-pkg-card {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        border-radius: 0px !important;
        overflow: hidden !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02) !important;
        transition: transform 0.3s ease !important;
    }
    
    .premium-pkg-card .pkg-img-container {
        height: 130px !important; /* Balanced proportion for mobile cards */
        border-radius: 0px !important;
    }
    
    .pkg-content-v2 {
        padding: 10px !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
    }
    
    .pkg-title-v2 {
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
        height: 2.6em !important; /* Force to exactly 2 lines height */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        margin-bottom: 6px !important;
    }
    
    .pkg-stats-v2 {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 4px !important;
        margin: 6px 0 !important;
        padding-bottom: 6px !important;
    }
    
    .stat-item-v2 {
        font-size: 0.58rem !important;
        color: #718096 !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }
    
    .stat-item-v2 i {
        font-size: 0.72rem !important;
        width: 12px;
        text-align: center;
    }
    
    .pkg-footer-v2 {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        margin-top: auto !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(76, 51, 152, 0.06) !important;
    }
    
    .pkg-price-col {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .price-label {
        font-size: 0.55rem !important;
        font-weight: 700 !important;
        color: #a0aec0 !important;
        letter-spacing: 0.3px !important;
        margin-bottom: 1px !important;
    }
    
    .price-val {
        font-size: 0.9rem !important;
        font-weight: 800 !important;
        color: #4c3398 !important;
    }
    
    .price-val-old {
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        color: #e53e3e !important;
    }
    
    .pkg-details-link {
        display: none !important; /* Hide details link since entire card is clickable */
    }
}

/* Narrow Mobile Sizing (Galaxy Z Fold 5 / iPhone SE) */
@media (max-width: 379.98px) {
    .pkg-grid-layout {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .premium-pkg-card .pkg-img-container {
        height: 200px !important;
    }
    
    .pkg-footer-v2 {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}