/* Reusable Listing Card Component CSS */

/* Container */
.listing-card-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

.listing-card {
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.125);
    background-color: #fff;
    box-shadow: 5.13px 3.63px 27px 0px rgba(192, 221, 238, .5);
    transition: all 0.3s ease;
    display: block;
    overflow: visible;
}

.listing-card:hover {
    box-shadow: 0 0 18px 5px rgba(0, 0, 0, .15);
}

/* Ribbon Styles */
.ribbon-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
}

.ribbon-wrapper {
    position: relative;
}

.ribbon {
    width: auto;
    line-height: 18px;
    padding: 4px 10px 4px 15px;
    position: absolute;
    left: -12px;
    top: -10px;
    background: #215D80; /* var(--hst-blue) */
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 20;
}

.ribbon::before {
    content: "";
    position: absolute;
    height: 0px;
    width: 0px;
    bottom: -7px;
    left: 0.1px;
    border-top: 7px solid #05243B; /* var(--hst-navy) */
    border-left: 12px solid transparent;
}

.ribbon::after {
    content: "";
    position: absolute;
    height: 0px;
    width: 0px;
    right: -14.5px;
    top: 0px;
    border-top: 13.2px solid #215D80; /* var(--hst-blue) */
    border-bottom: 13.2px solid #215D80; /* var(--hst-blue) */
    border-right: 15px solid transparent;
}

/* Product Start Section (Rank, Image, Rating) */
.product-start {
    text-align: center;
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-rank {
    position: absolute;
    top: 20px;
    left: 15px;
    margin: 0;
    line-height: 1;
}

.product-count {
    color: #A5A5A5;
    font-size: 31px;
    font-weight: 600;
}

.product-image {
    max-width: 100%;
    height: auto;
    width: 180px;
    margin: 1rem 0;
}

/* Rating */
.listing-card .rating-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
}

.listing-card .rating-wrapper.mb-3 {
    margin-bottom: 1rem;
}

.listing-card .rating-pt {
    font-size: 28px;
    font-weight: 700;
    color: #ffae00;
}

.listing-card .word-score {
    font-size: 13px;
    text-transform: uppercase;
    color: #72798A;
    margin: 0;
}

.listing-card .star-rating-wrapper {
    position: relative;
    display: inline-block;
    font-size: 18px;
    white-space: nowrap;
}

.listing-card .rating-list,
.listing-card .rating-list-background {
    padding: 0;
    margin: 0;
    list-style: none;
}

.listing-card .rating-list {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.listing-card .rating-list li,
.listing-card .rating-list-background li {
    display: inline-block;
}

.listing-card .rating-list-background li {
    color: #e0e0e0;
}

.listing-card .rating-list-background li i,
.listing-card .rating-list li i {
    display: inline-block;
    color: #ffae00; /* Solid golden color */
    text-shadow: 0px 1px 2px rgba(0,0,0,0.15);
    background: none !important; /* Ensure no gradient interferes */
    -webkit-text-fill-color: #ffae00 !important; /* Ensure text fill matches */
}

.listing-card .rating-list-background li i {
    color: #e0e0e0;
    text-shadow: none;
    -webkit-text-fill-color: #e0e0e0 !important;
}

/* Product Offer Image (Mobile/Tablet often hidden or adjusted) */
.offerImage-wrapper {
    display: none; /* Often hidden in desktop view of the main chart or handled differently */
}

/* Product Details Section */
.product-details {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-title {
    font-size: 20px;
    font-weight: 600;
    color: #09BCBE;
    margin-bottom: 0.75rem;
}

.product-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-details-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: #575F72;
    font-size: 15px;
    line-height: 1.4;
}

.product-details-list li::before {
    content: '\2713'; /* Checkmark */
    position: absolute;
    left: 0;
    color: #575F72;
    font-weight: bold;
}

/* Product Pricing/CTA Section */
.product-pricing {
    background-color: #f8f9fa; /* Slight background for distinction or just white */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
}

.offer-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.offer-note {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #05243B;
    margin-bottom: 0;
}

.btn-view-plan {
    display: inline-block;
    background-color: #9EC235; /* var(--hst-green) */
    color: #05243B; /* var(--hst-navy) */
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
    max-width: 250px;
}

.btn-view-plan:hover {
    background-color: #215D80; /* var(--hst-blue) */
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 93, 128, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .listing-card .row {
        flex-direction: column;
    }
    
    .product-start,
    .product-details,
    .product-pricing {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .product-start {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .product-details {
        padding-left: 2.5rem !important; /* Force left padding */
        padding-right: 1.5rem !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
        text-align: left !important; /* Ensure text aligns left */
    }

    /* Target the list specifically to ensure it indents */
    .product-details-list {
        padding-left: 0.5rem !important;
        margin-left: 0 !important;
    }

    /* Target list items to ensure they respect the container padding */
    .product-details-list li {
        padding-left: 1.5rem !important; /* Space for the checkmark */
        text-align: left !important;
    }

    .chart-rank {
        position: static;
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding: 20px 0 10px 0; /* Increased top padding */
    }
    
    .product-image {
        width: 200px; /* Increased explicit width */
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }
    
    .product-pricing .rating-wrapper {
        margin-bottom: 1rem;
    }

    /* CRITICAL FIX: Reset any transforms and ensure rating stays inside card on mobile */
    .listing-card .rating-wrapper,
    .product-start .rating-wrapper,
    .product-pricing .rating-wrapper {
        transform: none !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    /* Ensure the card and pricing column grow with content on small devices */
    .listing-card,
    .listing-card .product-pricing,
    .listing-card .product-start {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    /* Ensure the row flexes properly */
    .listing-card .row {
        height: auto !important;
    }
}

/* Extra small devices: slightly reduce rating size to keep it inside card */
@media (max-width: 480px) {
    .listing-card .rating-pt {
        font-size: 24px;
    }

    .listing-card .star-rating-wrapper {
        font-size: 16px;
    }
}
