/* Medication Page Styles */
.medication-page {
    font-family: 'Campton', sans-serif;
    background-color: #FEF9F8;
    min-height: 100vh;
    padding-top: 50px; /* Account for fixed header */

}

.medication-container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    max-width: 1800px; /* Larger max-width for medication page */
}

/* Main Content */
.main-content {
    padding: 30px 0;
}

/* Breadcrumbs */
.breadcrumb-section {
    padding: 15px 0;
    margin-bottom: 20px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
    margin: 0 8px;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 140px;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

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

.category-list li {
    margin-bottom: 8px;
}

.category-link {
    display: block;
    padding: 10px 15px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.category-link:hover {
    background: #f7fafc;
    color: #2d3748;
    text-decoration: none;
}

.category-link.active {
    background: #ce4f49;
    color: white;
    font-weight: 600;
}

/* Search Section */
.search-section {
    padding: 20px 0;
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
}

.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #4a5568;
    background: transparent;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.search-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.search-btn {
    background: #ce4f49;
    border: none;
    padding: 15px 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    min-width: 60px;
}

.search-btn:hover {
    background: #b8443e;
}

.search-icon {
    font-size: 18px;
}

/* Mobile Search Bar - Hidden by default */
.mobile-search-section {
    display: none;
    padding: 20px 0;
    margin-bottom: 50px;
    justify-content: center;
}

.mobile-search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: 20px;
}

.mobile-search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #4a5568;
    background: transparent;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.mobile-search-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.mobile-search-btn {
    background: #ce4f49;
    border: none;
    padding: 15px 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    min-width: 60px;
}

.mobile-search-btn:hover {
    background: #b8443e;
}

.mobile-search-icon {
    font-size: 18px;
}

/* Product Section */
.product-section {
    padding: 30px 0;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

/* Product Grid - Using Bootstrap Row Layout */
.product-grid {
    margin-bottom: 40px;
}

/* Import home page product styles */
.product-card {
    display: block;
    padding: 10px;
    margin-bottom: 20px;
}

.feature-product-item {
    padding: 45px 25px 35px;
    box-shadow: 0px 3px 6px #00000029;
    border-radius: 20px;
    opacity: 1;
    position: relative;
    background-color: #ffffff;
}

.feature-product-price {
    font-weight: 700;
}

.product-label {
    font-weight: 500;
    font-size: 12px;
    color: #8D8D8B;
}

.product-label-text {
    font-size: 12px;
    color: #8D8D8B;
    margin-bottom: 0px;
}

.product-description {
    font-size: 12px;
    color: #8D8D8B;
}

.product-variants {
    display: flex;
    width: 100%;
    gap: 10px;
}

.select-dosage, .select-pill-count {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.feature-select {
    background-color: #f6f6f6;
    color: #8D8D8D;
    border: 1px solid #E1E1E1;
    font-size: 12px;
    text-align: center;
}

.feature-button {
    margin-top: 15px;
    text-align: center;
    padding: 8px;
    background-color: #CE4F49;
    border-radius: 7px;
    width: 100%;
    height: auto;
    text-transform: uppercase;
    color: #ffffff;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.feature-button:hover {
    background-color: #b8443e;
}

.full-product-info {
    text-align: center;
    color: #666666;
    font-size: 15px;
    padding-top: 5px;
    cursor: pointer;
    text-decoration: none;
}

.full-product-info:hover {
    color: #CE4F49;
    font-weight: 500;
    text-decoration: none;
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
    text-decoration: none;
}

.page-item.active .page-link {
    background: #ce4f49;
    border-color: #ce4f49;
    color: white;
}

.page-item.disabled .page-link {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-container {
        max-width: 1140px;
    }
    .medication-container {
        max-width: 1140px;
    }
    .feature-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 991.98px) {
    .header-container {
        max-width: 960px;
    }
    .medication-container {
        max-width: 960px;
    }
    
    .sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    .product-section {
        padding: 20px 0;
    }
}

@media (max-width: 767.98px) {
    /* Mobile-specific overflow prevention */
    .medication-page {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .main-content {
        overflow-x: hidden;
        width: 100%;
    }
    
    .header-container {
        max-width: 720px;
    }
    .medication-container {
        max-width: 100%;
        padding-right: 15px;
        padding-left: 15px;
        overflow-x: hidden;
    }
    
    /* Mobile Layout: Hide breadcrumbs */
    .breadcrumb-section {
        display: none;
    }
    
    /* Mobile Layout: Show mobile search, hide desktop search */
    .mobile-search-section {
        display: flex;
        padding: 15px 10px;
        margin-bottom: 20px;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: #FEF9F8;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Add top padding to main content to account for fixed search bar */
    .medication-page {
        padding-top: 80px;
    }
    
    .mobile-search-container {
        max-width: 100%;
        margin: 0;
    }
    
    .search-section {
        display: none;
    }
    
    /* Mobile Layout: Simplify column structure */
    .medication-page .row {
        margin: 0;
        width: 100%;
    }
    
    .medication-page .col-lg-2,
    .medication-page .col-lg-10,
    .medication-page .col-md-3,
    .medication-page .col-md-9 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Mobile Layout: Sidebar styling */
    .sidebar {
        position: static;
        margin-bottom: 20px;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 100%;
    }
    
    /* Mobile Layout: Product grid - single column */
    .product-grid {
        display: block;
    }
    
    .product-grid .col-md-4 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding-left: 15px;
        padding-right: 15px;
        margin-bottom: 20px;
    }
    
    /* Mobile Layout: Product cards - Match home page featured products */
    .feature-product-item .row {
        flex-direction: column;
        align-items: center;
    }

    .feature-product-item .col-md-5,
    .feature-product-item .col-md-7 {
        width: 100%;
        text-align: center;
    }

    .feature-product-image {
        display: block;
        margin-left: auto;
        margin-right: auto;
        max-width: 60%;
        height: auto;
    }

    .feature-product-details {
        text-align: center;
    }

    .product-label-text {
        text-align: center;
    }

    .product-variants {
        justify-content: center;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 575.98px) {
    .header-container {
        max-width: 540px;
    }
    .medication-container {
        max-width: 540px;
    }
    .search-input {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 10px 12px;
        min-width: 50px;
    }
    
    .search-icon {
        font-size: 16px;
    }
    
    .product-section {
        padding: 15px 0;
    }
    
    .feature-product-item {
        padding: 25px 15px 25px;
    }
    
    .feature-button {
        padding: 10px 8px;
        font-size: 11px;
    }
}

/* Mobile-specific overflow prevention (only when class is present) */
body.medication-page-active {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

html.medication-page-active {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}