/**
 * Popular Packages Grid Widget Styles
 * Optimized for Performance & Browser Caching
 */

/* Main Grid Container */
.luxetravel-popular-packages {
    width: 100%;
    padding: 20px 0;
}

.luxetravel-packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

/* Package Card */
.package-card {
    background-color: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Hover Effects - Controlled by data attributes */
[data-lift="yes"] .package-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* Package Image - Fixed Height and Aspect Ratio */
.package-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.package-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

/* Image Zoom - Controlled by data attribute */
[data-zoom="yes"] .package-card:hover .package-image img {
    transform: scale(1.05);
}

/* Package Badge - Base Styles */
.package-badge {
    position: absolute;
    background: linear-gradient(135deg, #972424 0%, #2596be 100%);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(63, 63, 63, 0.3);
}

/* Badge Position Variants */
[data-badge-position="top-right"] .package-badge.badge-top-right,
.package-badge {
    top: 15px;
    right: 15px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-badge-position="top-left"] .package-badge.badge-top-left {
    top: 15px;
    left: 15px;
    right: auto;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-badge-position="bottom-right"] .package-badge.badge-bottom-right {
    bottom: 15px;
    top: auto;
    right: 15px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-badge-position="bottom-left"] .package-badge.badge-bottom-left {
    bottom: 15px;
    top: auto;
    left: 15px;
    right: auto;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Package Overlay */
.package-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.package-card:hover .package-overlay {
    opacity: 1;
}

.package-quick-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.package-quick-info span {
    color: #ffffff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.package-quick-info i {
    font-size: 14px;
}

/* Package Content */
.package-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Package Header */
.package-header {
    margin-bottom: 15px;
}

.package-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.package-location {
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.package-location i {
    color: #972424;
}

/* Package Rating */
.package-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars i {
    color: #ffc107;
    font-size: 14px;
}

.rating-text {
    font-size: 13px;
    color: #7f8c8d;
}

/* Package Description */
.package-description {
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Package Features */
.package-features {
    margin-bottom: 20px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    color: #5a6c7d;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-list i {
    color: #27ae60;
    font-size: 12px;
    flex-shrink: 0;
}

.more-features {
    color: #ff6b35;
    font-weight: 600;
    font-style: italic;
}

/* Package Footer */
.package-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
    margin-top: auto;
}

/* Package Pricing */
.package-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.original-price {
    color: #95a5a6;
    font-size: 14px;
    text-decoration: line-through;
}

.current-price {
    color: #2596be;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.price-note {
    color: #7f8c8d;
    font-size: 12px;
}

/* Package Button */
.package-btn {
    background-color: #ff6b35;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.package-btn:hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* Placeholder */
.luxetravel-placeholder {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .luxetravel-packages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .package-image {
        height: 250px;
    }

    .package-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .luxetravel-packages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .package-image {
        height: 280px;
    }

    .package-content {
        padding: 20px;
    }

    .package-title {
        font-size: 18px;
    }

    .package-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .package-btn {
        width: 100%;
        text-align: center;
    }

    .current-price {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .package-image {
        height: 220px;
    }

    .current-price {
        font-size: 22px;
    }

    .package-title {
        font-size: 16px;
    }

    .package-description {
        font-size: 13px;
    }
}

/* RTL Support */
[dir="rtl"] .package-location,
[dir="rtl"] .package-quick-info span,
[dir="rtl"] .features-list li {
    flex-direction: row-reverse;
}

[dir="rtl"] .package-badge {
    right: auto;
    left: 15px;
}

[dir="rtl"][data-badge-position="top-left"] .package-badge.badge-top-left {
    left: auto;
    right: 15px;
}

/* Accessibility Improvements */
.package-card:focus-within {
    outline: 2px solid #2596be;
    outline-offset: 2px;
}

.package-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .package-overlay,
    .package-btn {
        display: none;
    }

    .package-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
