/* Medication Details - Card Style based on design reference */

/* Responsive Hero Title - Only affects long titles */
.medication-hero-title-medium {
    font-size: 4rem !important;
    line-height: 1.1;
    word-break: break-word;
}

.medication-hero-title-small {
    font-size: 3rem !important;
    line-height: 1.1;
    word-break: break-word;
    hyphens: auto;
}

/* Responsive adjustments for long titles only */
@media (max-width: 1199px) {
    .medication-hero-title-medium {
        font-size: 3rem !important;
    }
    .medication-hero-title-small {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 991px) {
    .medication-hero-title-medium {
        font-size: 2.5rem !important;
    }
    .medication-hero-title-small {
        font-size: 2rem !important;
    }
}

@media (max-width: 767px) {
    .medication-hero-title-medium,
    .medication-hero-title-small {
        font-size: 1.4rem !important;
        line-height: 1.1;
    }

    /* Scale regular hero titles too */
    .hero-content .display-1 {
        font-size: 1.6rem !important;
        line-height: 1.1;
    }

    /* Scale other hero text */
    .hero-content .fs-4,
    .hero-info .fs-4 {
        font-size: 1rem !important;
    }

    .hero-info h2 {
        font-size: 1.3rem !important;
    }

    .hero-content-row .lead {
        font-size: 0.95rem !important;
        line-height: 1.3;
    }
}

/* Additional responsive breakpoints for better scaling */
@media (max-width: 575px) {
    .medication-hero-title-medium,
    .medication-hero-title-small {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    /* Also scale regular display-1 titles */
    .hero-content .display-1 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    /* Adjust hero content wrapper for very small screens */
    .hero-content-wrapper {
        margin-top: 1rem !important;
        padding: 1rem !important;
    }

    /* Adjust concentration text */
    .hero-content .fs-4 {
        font-size: 1rem !important;
    }

    /* Scale all hero content row content */
    .hero-content-row h2 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    .hero-content-row .lead {
        font-size: 1rem !important;
        line-height: 1.4;
    }

    /* Adjust hero content row margins */
    .hero-content-row {
        margin-top: 1rem !important;
    }
}

@media (max-width: 480px) {
    .medication-hero-title-medium,
    .medication-hero-title-small,
    .hero-content .display-1 {
        font-size: 1.1rem !important;
        line-height: 1.4;
    }

    .hero-content-wrapper {
        margin-top: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .hero-content .fs-4 {
        font-size: 0.9rem !important;
    }

    /* Scale all hero content row content */
    .hero-content-row h2 {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }

    .hero-content-row .lead {
        font-size: 0.9rem !important;
        line-height: 1.4;
    }

    .hero-content-row {
        margin-top: 0.5rem !important;
    }
}

@media (max-width: 360px) {
    .medication-hero-title-medium,
    .medication-hero-title-small,
    .hero-content .display-1 {
        font-size: 1rem !important;
        line-height: 1.4;
    }

    .hero-content-wrapper {
        margin-top: 0 !important;
        padding: 0.5rem !important;
    }

    .hero-content .fs-4 {
        font-size: 0.85rem !important;
    }

    /* Scale all hero content row content */
    .hero-content-row h2 {
        font-size: 1rem !important;
        line-height: 1.3;
    }

    .hero-content-row .lead {
        font-size: 0.85rem !important;
        line-height: 1.4;
    }

    .hero-content-row {
        margin-top: 0 !important;
    }
}

/* Fix hero section padding for navbar clearance in medium screens */
/* Fix hero section padding for navbar clearance in medium screens */
@media (min-width: 577px) and (max-width: 767px) {
    .mt-173 {
        margin-top: 20px !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hero-content-row.mt-173 {
        margin-top: 100px !important;
    }

    /* Scale text for tablet range with compact hero */
    .hero-content .display-1 {
        font-size: 2.2rem !important;
        line-height: 1.1;
        margin-bottom: 0.5rem !important;
    }

    .medication-hero-title-medium {
        font-size: 2rem !important;
        line-height: 1.1;
        margin-bottom: 0.5rem !important;
    }

    .medication-hero-title-small {
        font-size: 1.8rem !important;
        line-height: 1.1;
        margin-bottom: 0.5rem !important;
    }

    .hero-content .fs-4,
    .hero-info .fs-4 {
        font-size: 1.1rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem !important;
    }

    .hero-info h2 {
        font-size: 1.3rem !important;
        line-height: 1.2;
        margin-bottom: 0.5rem !important;
    }

    /* Compact spacing for hero content */
    .hero-content-row {
        margin-top: 1rem !important;
        min-height: auto !important;
    }

    .hero-content-row .lead {
        font-size: 1rem !important;
        line-height: 1.3;
        margin-bottom: 0 !important;
    }

    /* Scale the entire hero content wrapper */
    .hero-content-wrapper {
        transform: scale(0.95);
        transform-origin: top center;
        margin-top: 1rem !important;
    }
}

/* Fix for larger resolutions - more robust spacing and scaling */
@media (min-width: 992px) {
    /* Expand hero space for desktop */
    .hero-background {
        min-height: 34rem !important;
        padding-top: 3rem !important;
        padding-bottom: 3.5rem !important;
    }

    .hero-content-row {
        margin-top: 3rem !important;
        padding-top: 2.5rem !important;
        padding-bottom: 2rem !important;
    }

    .hero-content-wrapper {
        margin-top: 0 !important;
        padding-top: 3rem !important;
        transform: none !important;
        max-width: 90%;
    }

    .hero-content .display-1 {
        font-size: clamp(3rem, 2.5vw + 1.2rem, 4.2rem) !important;
        line-height: 1.1 !important;
        margin-bottom: 1.2rem !important;
    }

    .medication-hero-title-medium {
        font-size: clamp(2.6rem, 2vw + 1rem, 3.6rem) !important;
        line-height: 1.15 !important;
        margin-bottom: 1.2rem !important;
    }

    .medication-hero-title-small {
        font-size: clamp(2.2rem, 1.8vw + 0.8rem, 3.2rem) !important;
        line-height: 1.15 !important;
        margin-bottom: 1.2rem !important;
    }

    .hero-info h2 {
        font-size: clamp(1.6rem, 1vw + 1rem, 2.2rem) !important;
        line-height: 1.3 !important;
        margin-bottom: 1.2rem !important;
    }

    .hero-info .fs-4,
    .hero-content .fs-4 {
        font-size: clamp(1.2rem, 0.8vw + 0.9rem, 1.6rem) !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }

    .hero-content-row .lead {
        font-size: clamp(1.1rem, 0.8vw + 0.8rem, 1.6rem) !important;
        line-height: 1.5 !important;
    }

    /* Keep medication imagery contained on desktop */
    .medication-image-wrapper {
        min-height: 500px !important;
    }

    .medication-main-image {
        min-height: 500px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .medication-main-image img {
        max-width: 100% !important;
        max-height: 550px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 15px !important;
        background: white !important;
        padding: 30px !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
    }
}

@media (min-width: 1400px) {
    .hero-content .display-1 {
        font-size: clamp(3.6rem, 1.8vw + 2rem, 4.8rem) !important;
    }

    .medication-hero-title-medium {
        font-size: clamp(3.2rem, 1.5vw + 1.6rem, 4.2rem) !important;
    }

    .medication-hero-title-small {
        font-size: clamp(2.8rem, 1.3vw + 1.4rem, 3.8rem) !important;
    }

    .hero-info h2 {
        font-size: clamp(1.8rem, 0.9vw + 1.2rem, 2.4rem) !important;
    }

    .hero-info .fs-4,
    .hero-content .fs-4,
    .hero-content-row .lead {
        font-size: clamp(1.3rem, 0.8vw + 1rem, 1.8rem) !important;
    }
}

/* Fix image sizing for tablet and mobile resolutions */
@media (max-width: 991px) {
    .medication-image-wrapper {
        min-height: 350px !important;
    }

    .medication-main-image {
        min-height: 350px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .medication-main-image img {
        max-width: 100% !important;
        max-height: 400px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 15px !important;
        background: white !important;
        padding: 25px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    /* Improve thumbnails for smaller resolutions */
    .medication-thumbnails {
        gap: 10px !important;
        justify-content: center !important;
    }

    .medication-thumb {
        width: 65px !important;
        height: 65px !important;
        object-fit: contain !important;
        padding: 6px !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    }

    .medication-thumb:hover,
    .medication-thumb.active {
        transform: scale(1.1) !important;
        border-color: #46c1a8 !important;
        box-shadow: 0 4px 12px rgba(70, 193, 168, 0.3) !important;
    }
}

.medication-image-wrapper {
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 400px;
}

.medication-main-image {
    height: 100%;
    min-height: 400px;
}

.medication-main-image img {
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.medication-thumbnails-wrapper {
    background: transparent;
    padding-top: 15px;
}

.medication-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.medication-thumb {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    padding: 8px;
}

.medication-thumb:hover,
.medication-thumb.active {
    border-color: #46c1a8;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(70, 193, 168, 0.3);
}

.medication-admin-route {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.medication-details-wrapper {
    background: white;
}

.medication-price-section .discount-badge {
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

.medication-manufacturer p {
    font-size: 0.9rem;
    line-height: 1.3;
}

.discount-badge {
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
}

.current-price {
    color: #333;
    font-size: 2rem;
    margin: 0;
}

.medication-rating-section {
    /* Now uses flexbox for horizontal alignment */
}

.availability-section {
    /* No margin needed with flexbox gap */
}

.rating-stars i {
    font-size: 0.9rem;
}

.availability-badge {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 15px;
    border: none;
}

.availability-badge.btn-success {
    background: #28a745 !important;
}

.availability-badge.btn-secondary {
    background: #6c757d !important;
}

/* Manufacturer styling moved to price section */

.medication-important-info,
.medication-specialty-info {
    /* Removed card styling - now plain text */
}

.medication-important-info h6,
.medication-specialty-info h6 {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.medication-coverage h6 {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.payment-methods {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 20px 0;
}

.payment-icon {
    height: 25px;
    width: auto;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    padding: 2px;
    background: white;
}

.medication-contact {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.quantity-selector .input-item {
    min-width: 80px;
    display: flex;
    align-items: center;
}

.quantity-selector .nice-select {
    width: 80px;
    height: 35px;
    line-height: 33px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0;
}

.quantity-selector label {
    font-size: 0.9rem;
    white-space: nowrap;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    height: 35px;
}

.action-buttons .theme-btn-1 {
    background: #46c1a8 !important;
    border: none;
    color: white;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
}

.action-buttons .theme-btn-1:hover {
    background: white !important;
    color: #46c1a8 !important;
    border: 2px solid #46c1a8 !important;
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .medication-image-wrapper {
        min-height: 300px !important;
    }

    .medication-main-image {
        min-height: 300px !important;
    }

    .medication-main-image img {
        max-height: 320px !important;
        padding: 20px !important;
    }

    .medication-thumbnails {
        gap: 8px !important;
    }

    .medication-thumb {
        width: 55px !important;
        height: 55px !important;
        padding: 5px !important;
    }

    .current-price {
        font-size: 1.6rem;
    }

    .action-buttons .theme-btn-1 {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}


/* Information Banner Section Styles */

.info-box {
    text-align: center;
    padding: 60px 20px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-box-1 {
    background: rgba(69, 191, 166, 0.5);
    border-radius: 15px 0 0 15px;
}

.info-box-2 {
    background: rgba(69, 191, 166, 0.7);
}

.info-box-3 {
    background: rgba(69, 191, 166, 0.8);
    border-radius: 0 15px 15px 0;
}

.info-box .info-icon i {
    font-size: 7rem;
    color: #ffffff;
}

.info-box .info-content p {
    color: #071C1F;
    font-weight: 600;
    line-height: 1.4;
    font-size: 16px;
}

.emoji-accent {
    color: #f39c12;
    font-weight: bold;
}

/* Hero background for larger resolutions */
@media (min-width: 768px) {
    .hero-background {
        min-height: 26rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Keep compact for smaller screens */
@media (max-width: 767px) {
    .hero-background {
        min-height: 22rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Responsive for info banner */
@media (max-width: 768px) {
    .info-box {
        padding: 40px 15px;
        min-height: 220px;
        margin-bottom: 0;
    }

    .info-box .info-icon i {
        font-size: 3rem;
    }

    .info-box .info-content p {
        font-size: 14px;
    }

    .info-box-1 {
        border-radius: 15px 15px 0 0;
    }

    .info-box-3 {
        border-radius: 0 0 15px 15px;
    }

    .info-banner-section>.col-lg-4 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 576px) {
    /* MOBILE NAVBAR ADJUSTMENTS: Reset conflicting styles for mobile navbar */
    .ltn__about-us-area {
        margin-top: 0 !important; /* Reset negative margin for mobile navbar */
    }

    .medication-image-wrapper {
        min-height: 250px !important;
    }

    .medication-main-image {
        min-height: 250px !important;
    }

    .medication-main-image img {
        max-height: 270px !important;
        padding: 15px !important;
    }

    .medication-thumbnails {
        gap: 6px !important;
    }

    .medication-thumb {
        width: 50px !important;
        height: 50px !important;
        padding: 4px !important;
    }

    .info-box {
        padding: 30px 15px;
        min-height: 200px;
    }

    .info-box .info-icon i {
        font-size: 2.5rem;
    }

    .info-box .info-content p {
        font-size: 13px;
    }

    /* MOBILE NAVBAR: Reduced hero background for mobile navbar */
    .hero-background {
        min-height: 25rem !important; /* Reducido para mobile navbar */
        padding-top: 1rem !important; /* Reducido para mobile navbar */
    }
}

/* Responsive adjustments for nice-select dropdowns below 450px */
@media (max-width: 450px) {
    /* SOLUTION: Hide nice-select wrapper and show native select on mobile */
    .input-item .nice-select {
        display: none !important;
    }

    .input-item select,
    #presentationSelect,
    #quantitySelect {
        display: block !important;
        width: 100% !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 8px !important;
        background-color: white !important;
        color: #333 !important;
        font-weight: 500 !important;
        appearance: auto !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
    }

    .input-item {
        position: relative !important;
    }

    /* Also apply to quantity selector */
    .quantity-selector .nice-select {
        display: none !important;
    }

    .quantity-selector select,
    .quantity-selector #quantitySelect {
        display: block !important;
        width: 75px !important;
        min-width: 75px !important;
        height: 42px !important;
        padding: 10px 12px !important;
        font-size: 15px !important;
        line-height: 1.5 !important;
        border: 2px solid #e9ecef !important;
        border-radius: 8px !important;
        background-color: white !important;
        background-image: none !important;
        color: #333 !important;
        font-weight: 600 !important;
        appearance: auto !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        text-align: center !important;
        text-align-last: center !important;
        text-indent: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        cursor: pointer !important;
    }

    .quantity-selector select option,
    .quantity-selector #quantitySelect option {
        color: #333 !important;
        background-color: white !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        padding: 10px !important;
        text-align: center !important;
    }

    .quantity-selector {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .quantity-selector label {
        font-size: 14px !important;
        margin-bottom: 0 !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
    }

    .input-item .nice-select .list {
        max-width: 100% !important;
        font-size: 12px !important;
        width: 100% !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 100% !important;
        z-index: 99999 !important;
        background: white !important;
        border: 1px solid #e9ecef !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        max-height: 200px !important;
        overflow-y: auto !important;
        margin-top: 2px !important;
    }

    .input-item .nice-select .option {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
        max-width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.4 !important;
        min-height: 32px !important;
        color: #333 !important;
    }

    .input-item .nice-select.open .list {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .input-item .nice-select.open .option {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    /* Force list to be visible when nice-select has open class */
    .nice-select.open .list {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure parent containers don't clip the dropdown */
    .medication-details-wrapper .row {
        overflow: visible !important;
    }

    .medication-details-wrapper {
        overflow: visible !important;
    }

    .medication-details-card {
        overflow: visible !important;
    }

    .medication-details-card .row {
        overflow: visible !important;
    }

    .medication-details-card .col-lg-7,
    .medication-details-card .col-md-12 {
        overflow: visible !important;
    }

    .col-12:has(.input-item) {
        overflow: visible !important;
        position: relative !important;
    }

    .row:has(.input-item) {
        overflow: visible !important;
        position: relative !important;
    }

    /* Rating+Badge and Quantity Row - force to stay in same row longer */
    .medication-details-wrapper .row.mb-3.align-items-center .col-6 {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
    }

    /* Availability section - more compact */
    .availability-section {
        margin-right: 8px !important;
    }

    .availability-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }

    /* Quantity selector - more compact but stays in row */
    .quantity-selector {
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }

    .quantity-selector .nice-select {
        width: 65px !important;
        font-size: 11px !important;
        height: 30px !important;
        line-height: 28px !important;
        flex-shrink: 0 !important;
    }

    .quantity-selector .nice-select .current {
        font-size: 11px !important;
        padding-right: 20px !important;
    }

    .quantity-selector label {
        font-size: 11px !important;
        height: 30px !important;
        margin-right: 5px !important;
        white-space: nowrap !important;
    }

    /* Make the entire quantity row more flexible */
    .quantity-selector .input-item {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Adjust the row layout for smaller screens */
    .medication-details-wrapper .row.mb-3.align-items-center {
        gap: 5px !important;
        justify-content: space-between !important;
    }

    /* Make manufacturer text smaller on very small screens */
    .medication-manufacturer p {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .medication-manufacturer .proximanova-bold {
        font-size: 11px !important;
    }

    /* Extra safety for very long text in presentation selector */
    .input-item {
        overflow: hidden !important;
        max-width: 100% !important;
    }
}

/* Additional breakpoint for very small screens where quantity selector must wrap */
@media (max-width: 380px) {
    /* Force quantity selector to wrap to new line but stay within bounds */
    .medication-details-wrapper .row.mb-3.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .medication-details-wrapper .row.mb-3.align-items-center .col-6:last-child {
        align-self: flex-start !important;
        margin-top: 8px !important;
        width: 100% !important;
    }

    /* Ensure quantity selector doesn't overflow and aligns left */
    .quantity-selector {
        max-width: 100% !important;
        overflow: hidden !important;
        justify-content: flex-start !important;
    }
}