/**
 * Pathology Tests & Packages Filter Catalog Stylesheet
 *
 * Scoped entirely to .ptbs-fc-wrap and .ptbs-fc-* classes.
 * Uses CSS Custom Properties for theme adaptability.
 *
 * @package Pathology_Booking_System
 * @version 1.0.0
 */

:root {
    --ptbs-fc-primary: #0056b3;
    --ptbs-fc-primary-hover: #004494;
    --ptbs-fc-accent: #00a699;
    --ptbs-fc-accent-hover: #008f84;
    --ptbs-fc-badge-bg: #e6f7f5;
    --ptbs-fc-badge-color: #00a699;
    --ptbs-fc-text-dark: #0b192c;
    --ptbs-fc-text-muted: #64748b;
    --ptbs-fc-border: #f1f5f9;
    --ptbs-fc-border-hover: #cbd5e1;
    --ptbs-fc-radius: 16px;
    --ptbs-fc-card-radius: 16px;
    --ptbs-fc-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    --ptbs-fc-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.07);
}

/* ==========================================================================
   Main Catalog Container & 2-Column Layout
   ========================================================================== */
.ptbs-fc-wrap {
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
    margin: 20px 0 40px 0;
}

.ptbs-fc-wrap *,
.ptbs-fc-wrap *::before,
.ptbs-fc-wrap *::after {
    box-sizing: border-box;
}

.ptbs-fc-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
}

/* Mobile Filter Toggle Button (hidden on desktop) */
.ptbs-fc-mobile-filter-trigger {
    display: none;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ptbs-fc-text-dark);
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ==========================================================================
   Left Sidebar: Filters Panel
   ========================================================================== */
.ptbs-fc-sidebar {
    flex: 0 0 270px;
    width: 270px;
    background: #ffffff;
    border: 1px solid var(--ptbs-fc-border);
    border-radius: var(--ptbs-fc-radius);
    box-shadow: var(--ptbs-fc-shadow);
    padding: 24px 20px;
}

.ptbs-fc-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 8px;
}

.ptbs-fc-sidebar__title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ptbs-fc-text-dark);
    margin: 0;
    letter-spacing: -0.3px;
}

.ptbs-fc-clear-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--ptbs-fc-primary);
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.ptbs-fc-clear-btn:hover {
    color: var(--ptbs-fc-primary-hover);
    text-decoration: underline;
}

/* Accordion Filter Groups */
.ptbs-fc-group {
    border-bottom: 1px solid #f1f5f9;
}

.ptbs-fc-group:last-child {
    border-bottom: none;
}

.ptbs-fc-group__header {
    width: 100%;
    background: none;
    border: none;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: color 0.2s;
}

.ptbs-fc-group__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ptbs-fc-text-dark);
}

.ptbs-fc-group__chevron {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.25s ease;
}

.ptbs-fc-group.is-open .ptbs-fc-group__chevron {
    transform: rotate(180deg);
}

.ptbs-fc-group__body {
    display: none;
    padding: 0 0 16px 0;
    max-height: 280px;
    overflow-y: auto;
}

.ptbs-fc-group.is-open .ptbs-fc-group__body {
    display: block;
}

/* Custom Scrollbar for Filter Lists */
.ptbs-fc-group__body::-webkit-scrollbar {
    width: 5px;
}
.ptbs-fc-group__body::-webkit-scrollbar-track {
    background: #f8fafc;
}
.ptbs-fc-group__body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Custom Checkbox Design */
.ptbs-fc-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    user-select: none;
    position: relative;
    padding-left: 26px;
    line-height: 1.4;
    transition: color 0.2s;
}

.ptbs-fc-checkbox:last-child {
    margin-bottom: 0;
}

.ptbs-fc-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.ptbs-fc-checkbox__mark {
    position: absolute;
    top: 1px;
    left: 0;
    height: 17px;
    width: 17px;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ptbs-fc-checkbox:hover input ~ .ptbs-fc-checkbox__mark {
    border-color: var(--ptbs-fc-accent);
}

.ptbs-fc-checkbox input:checked ~ .ptbs-fc-checkbox__mark {
    background-color: var(--ptbs-fc-accent);
    border-color: var(--ptbs-fc-accent);
}

.ptbs-fc-checkbox__mark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ptbs-fc-checkbox input:checked ~ .ptbs-fc-checkbox__mark::after {
    display: block;
}

.ptbs-fc-checkbox input:checked ~ .ptbs-fc-checkbox__label {
    color: var(--ptbs-fc-text-dark);
    font-weight: 600;
}

/* ==========================================================================
   Right Column: Main Content (Search + Grid + Pagination)
   ========================================================================== */
.ptbs-fc-main {
    flex: 1;
    min-width: 0;
}

/* Search Bar (Matching Reference) */
.ptbs-fc-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ptbs-fc-search-input-wrap {
    flex: 1;
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ptbs-fc-search-input-wrap:focus-within {
    border-color: var(--ptbs-fc-accent);
    box-shadow: 0 0 0 3px rgba(0, 166, 153, 0.12);
}

.ptbs-fc-search-icon {
    font-size: 15px;
    color: #94a3b8;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.ptbs-fc-search-input {
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--ptbs-fc-text-dark);
    width: 100%;
    height: 48px;
    background: transparent;
    font-family: inherit;
}

.ptbs-fc-search-input::placeholder {
    color: #94a3b8;
}

.ptbs-fc-search-btn {
    background: var(--ptbs-fc-accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    border: none;
    border-radius: 10px;
    padding: 0 28px;
    height: 48px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ptbs-fc-search-btn:hover {
    background: var(--ptbs-fc-accent-hover);
}

.ptbs-fc-search-btn:active {
    transform: scale(0.98);
}

/* Grid Wrapper & Loading Overlay */
.ptbs-fc-grid-wrap {
    position: relative;
    min-height: 250px;
}

.ptbs-fc-grid {
    display: grid;
    gap: 20px;
}

.ptbs-fc-grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ptbs-fc-grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ptbs-fc-grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ptbs-fc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ptbs-fc-radius);
    z-index: 10;
}

.ptbs-fc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--ptbs-fc-accent);
    border-radius: 50%;
    animation: ptbs-fc-spin 0.8s linear infinite;
}

@keyframes ptbs-fc-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Catalog Card Design (Matching Reference)
   ========================================================================== */
.ptbs-fc-card {
    background: #ffffff;
    border: 1px solid var(--ptbs-fc-border);
    border-radius: var(--ptbs-fc-card-radius);
    box-shadow: var(--ptbs-fc-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
    position: relative;
}

.ptbs-fc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ptbs-fc-shadow-hover);
    border-color: var(--ptbs-fc-border-hover);
}

/* Circular Icon Badge */
.ptbs-fc-card__header {
    margin-bottom: 16px;
}

.ptbs-fc-card__icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--ptbs-fc-badge-bg);
    color: var(--ptbs-fc-badge-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.ptbs-fc-card__icon-badge--pkg {
    background: #eef2ff;
    color: #4f46e5;
}

/* Card Body */
.ptbs-fc-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ptbs-fc-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.ptbs-fc-card__title a {
    color: var(--ptbs-fc-text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.ptbs-fc-card__title a:hover {
    color: var(--ptbs-fc-primary);
}

.ptbs-fc-card__meta {
    font-size: 12px;
    color: var(--ptbs-fc-text-muted);
    font-weight: 500;
    margin-bottom: 18px;
}

/* Pricing Row */
.ptbs-fc-card__pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 18px;
}

.ptbs-fc-card__price {
    font-size: 20px;
    font-weight: 800;
    color: var(--ptbs-fc-text-dark);
}

.ptbs-fc-card__mrp {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

/* Action Buttons Row */
.ptbs-fc-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ptbs-fc-btn {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    border: none;
    box-sizing: border-box;
}

.ptbs-fc-btn--primary {
    flex: 1;
    background: var(--ptbs-fc-primary);
    color: #ffffff;
}

.ptbs-fc-btn--primary:hover {
    background: var(--ptbs-fc-primary-hover);
    color: #ffffff;
}

.ptbs-fc-btn--secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    padding: 9px 14px;
}

.ptbs-fc-btn--secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* No Results Container */
.ptbs-fc-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: var(--ptbs-fc-radius);
    border: 1px solid var(--ptbs-fc-border);
}

.ptbs-fc-no-results__icon {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.ptbs-fc-no-results__title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ptbs-fc-text-dark);
    margin: 0 0 8px 0;
}

.ptbs-fc-no-results__desc {
    font-size: 14px;
    color: var(--ptbs-fc-text-muted);
    max-width: 440px;
    margin: 0 auto;
}

/* ==========================================================================
   AJAX Numbered Pagination
   ========================================================================== */
.ptbs-fc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}

.ptbs-fc-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ptbs-fc-page-btn:hover:not(.is-disabled):not(.is-active) {
    border-color: var(--ptbs-fc-accent);
    color: var(--ptbs-fc-accent);
}

.ptbs-fc-page-btn.is-active {
    background: var(--ptbs-fc-accent);
    border-color: var(--ptbs-fc-accent);
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.ptbs-fc-page-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .ptbs-fc-grid--cols-3,
    .ptbs-fc-grid--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ptbs-fc-layout {
        flex-direction: column;
    }

    .ptbs-fc-mobile-filter-trigger {
        display: flex;
    }

    .ptbs-fc-sidebar {
        width: 100%;
        flex: none;
        display: none;
        margin-bottom: 20px;
    }

    .ptbs-fc-sidebar.is-mobile-open {
        display: block;
    }

    .ptbs-fc-grid--cols-2,
    .ptbs-fc-grid--cols-3,
    .ptbs-fc-grid--cols-4 {
        grid-template-columns: 1fr;
    }

    .ptbs-fc-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ptbs-fc-search-btn {
        width: 100%;
    }
}
