/* General and Desktop Styling */
.product-list-container {
    width: 100%;
    padding: 20px;
}

.product-box {
    position: relative;
    background-color: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    padding-top: 20px;
    margin-bottom: 40px; /* Consistent bottom margin for all devices */
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.product-cta-vertical,
.product-cta-container {
    display: block; /* Visible by default on mobile */
}

.product-cta-vertical-desktop {
    display: none; /* Hidden by default */
}

.product-box:hover {
    border-color: #005A9C;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.product-box:first-child {
    border-color: #005A9C;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.product-number {
    position: absolute;
    top: -20px; /* Positions the element slightly above the box */
    left: 10px; /* Adjusts distance from the left edge */
    background-color: #005A9C;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Optional shadow for visibility */
}

.product-badge {
    display: inline-block;
    margin-bottom: 5px;
    background-color: #FFC107;
    color: white;
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    position: relative;
    left: 0;
    top: -10px; /* Adjust to move badge up if needed */
}

/* Style the trophy icon */
.product-badge .bi-trophy-fill {
    color: white; /* Ensures trophy icon is white */
    margin-right: 5px; /* Spacing between icon and text */
}

.product-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.product-image {
    width: 190px;
}

.product-image img {
    width: 190px;
    height: 190px;
    border-radius: 5px;
    object-fit: contain;
}

.product-info {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: calc(100% - 200px);
    flex-wrap: wrap;
}

.product-info-container {
    flex-grow: 1;
    margin-right: 20px;
    max-width: 60%;
}

.product-title {
    font-size: 18px;
    margin-top: 0 !important;
    font-weight: bold;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-title a {
    color: #111111 !important;
}

.product-merchant {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

/* General Styling for Rating Element */
.product-box .rating-tooltip-wrapper svg {
    display: block !important;
    margin: 0 auto;
}

.rating-tooltip-wrapper {
    position: relative; /* Allows absolute positioning within */
    display: inline-flex;
    align-items: center;
    justify-content: flex-start; /* Keeps the rating element aligned to the left */
}

.advertising-disclosure-icon {
    position: absolute;
    top: -5px;
    right: 0;
    margin-top: -5px; /* Adjust as needed */
    margin-right: -5px; /* Adjust as needed */
}

.product-cta-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 10px; /* Space between title and CTA button */
    }

.product-cta-container .text-muted {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
}

.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.view-price-btn {
    text-align: center;
    font-weight: bold;
    padding: 8px 15px;
    max-width: 180px;
    color: #ffffff !important;
    background: #f44336;
    border: 1px solid #d32f2f;
    cursor: pointer;
}

.view-price-btn:hover {
    background: #d32f2f;
    border-color: #b71c1c;
    color: #ffffff !important;
}

.read-more-toggle {
    display: inline-flex;
    font-size: 14px;
    color: #005A9C;
    background: none;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.read-more-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.read-more-content.open {
    max-height: 1000px; /* Adjust as needed */
    opacity: 1;
}

.checkmark-list {
    list-style: none;
    padding-left: 0;
}

.checkmark-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.checkmark-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    color: green;
    font-weight: bold;
    font-size: 18px;
}

.read-more-toggle-desktop {
    display: inline-flex;
}

.read-more-toggle-mobile {
    display: none;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    
    .product-list-container {
        background-color: #fbfcfd;
    }
    
    .breadcrumbs-container {
        text-align: left;
        padding-left: 0; /* Adjust padding if needed */
        margin-left: 20px; /* Adjust margin if needed */
    }
    
    .product-box {
        width: 100%; /* Full width on mobile */
        flex-direction: column;
        align-items: center;
    }
    
    .product-content {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 20px;
        align-items: flex-start;
    }

    .product-info {
        width: 100% !important;
        position: relative;
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
    }

    .product-info-container {
        flex-grow: 1;
        margin-right: 20px;
        max-width: 100%;
    }

    .product-image {
        width: 110px !important;
        height: 110px !important;
    }

    .product-image img {
        width: 110px !important;
        height: 110px !important;
        max-width: 110px !important;
        max-height: 110px !important;
        border-radius: 5px !important;
    }

    .title-rating-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .rating-container {
        width: 40px !important;
        height: 40px !important;
        display: flex; /* Ensures centering if needed */
        align-items: center;
        justify-content: center;
    }
    
    .product-title {
        font-size: 14px !important;
        flex: 1 !important;
        max-width: 100% !important;
        text-align: left !important;
        margin: 0 !important;
    }

    .product-merchant {
        font-size: 12px !important;
        width: 100% !important;
        text-align: left !important;
        margin-top: 5px !important;
    }

    .cta-container {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 5px !important;
    }
    
    .product-cta-container .view-price-btn {
        display: block; /* Ensures it behaves as a block element */
        width: 100% !important; /* Forces full width */
        max-width: 100% !important; /* Removes any max-width constraints */
        box-sizing: border-box; /* Ensures padding doesn’t affect width */
        margin: 0 auto; /* Centers it in the container */
    }
    
    .view-price-btn {
        padding: 5px 10px; /* Adjust padding to make the button thinner */
        font-size: 14px; /* Optionally adjust font size */
    }

    .text-muted {
        font-size: 12px;
        text-align: center;
        margin-top: 5px;
    }

    .read-more-toggle {
        font-size: 12px;
        align-self: flex-start;
        margin-top: 10px;
        justify-content: flex-start;
        display: inline-flex;
    }
    
    .read-more-toggle-desktop {
        display: none;
    }

    .read-more-toggle-mobile {
        display: inline-flex;
    }
    
    .rating-tooltip-wrapper {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    
    .product-box .rating-tooltip-wrapper svg {
        width: 50px !important;
        height: 50px !important;
    }

    .product-box .rating-tooltip-wrapper svg text {
        font-size: 36px !important;
    }

    /* Position Adjustments on Mobile */
    .product-box .rating-tooltip-wrapper {
        position: absolute !important;
        top: 55px !important;
        right: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    /* Optional: Adjust tooltip positioning for mobile */
    .tooltip-icon {
        margin-left: 5px; /* Adjust spacing between rating and tooltip */
    }
    
    .product-badge-mobile {
    position: absolute;
    top: -15px; /* Positions it at the top of the product box */
    left: auto;
    right: 10px; /* Aligns badge closer to the right */
    background-color: #FFC107;
    color: white;
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    display: inline-block; /* Keeps the badge only as wide as its content */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Optional shadow for better visibility */
    }
    
    .product-badge-desktop {
        display: none; /* Hide desktop badge on mobile screens */
    }
    .product-badge-mobile {
        display: inline-block; /* Show mobile badge on mobile screens */
    }
    
    .glyphicon .glyphicon-info-sign .light-grey-icon {
        top:-5px !important;
    }
}

/* Center align the Read More toggle below the image on desktop only */
@media (min-width: 992px) { /* Adjust breakpoint if needed */
    .read-more-toggle {
        display: block;
        text-align: center;
        margin-top: 10px; /* Space between image and Read More */
    }
    
    .product-image {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
     .read-more-toggle-mobile {
        display: none;
    }
    
    .read-more-toggle-desktop {
        display: block; /* Ensure desktop toggle is visible */
    }
}

/* Desktop-Only Styling */
@media (min-width: 769px) {
    /* Hide mobile-specific containers on desktop */
    .product-cta-vertical,
    .product-cta-container {
        display: none;
    }

    /* Show the desktop-specific version */
    .product-cta-vertical-desktop {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 20px; /* Optional: adjust spacing as needed */
    }
    
    .product-box {
        width: 75%;
        margin: 0 auto;
        margin-bottom: 40px;
    }

    /* Additional styling for the CTA button and rating within .product-cta-vertical-desktop */
    .cta-container {
        text-align: center;
        margin-top: 10px;
    }

    .view-price-btn {
        font-size: 14px;
        padding: 5px 10px;
        font-weight: bold;
        background-color: #f44336;
        border: 1px solid #d32f2f;
        color: #fff !important;
        text-decoration: none;
    }

    .view-price-btn:hover {
        background-color: #d32f2f;
    }

    .text-muted {
        font-size: 12px;
        color: #555;
        margin-top: 5px;
    }
    
    .rating-container {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .product-box .rating-element svg {
        width: 75px !important;
        height: 75px !important;
    }

    .product-box .rating-element text {
        font-size: 18px !important;
    }

    .tooltip-icon-container {
        margin-left: 8px; /* Adjust to control space between rating and tooltip */
        cursor: pointer;
    }

    /* Styling the tooltip icon */
    .tooltip-icon-container i {
        font-size: 18px;
        color: #555; /* Tooltip icon color */
    }
    
    .rating-tooltip-wrapper {
        position: relative; /* Ensures the tooltip icon is positioned relative to this container */
        display: inline-flex;
        align-items: center;
    }
    
    .product-box .rating-tooltip-wrapper svg {
        width: 75px !important;
        height: 75px !important;
    }

    .product-box .rating-tooltip-wrapper svg text {
        font-size: 28px !important;
    }

    .tooltip-icon {
        position: absolute;
        top: -5px;      /* Adjusted to add space above */
        right: -10px;   /* Adjusted to add space to the right */
        cursor: pointer;
        font-size: 18px;
        color: #555; /* Tooltip icon color */
    }
    
    /* Styling for tooltip icon to ensure clear visibility */
    .tooltip-icon i {
        font-size: 16px;
        color: #ccc;
    }
    
    .product-badge-desktop {
        display: inline-block; /* Show desktop badge on desktop screens */
    }
    .product-badge-mobile {
        display: none; /* Hide mobile badge on desktop screens */
    }
    
    .product-badge-desktop {
        display: inline-block; /* Ensures width matches content */
        position: relative;
        top: -10px; /* Adjust the vertical position if needed */
        left: 0; /* Align to the left */
        background-color: #FFC107;
        color: white;
        padding: 5px 15px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: bold;
        z-index: 1; /* Ensures it sits above the content */
        margin-bottom: 5px; /* Adds space below the badge */
    }

    /* Additional styling if necessary */
    .product-title {
        margin-top: 0; /* Ensure no space above title */
    }
}
