/* Factories & Sourcing Page Specific Styles */

/* Layout */
.factories-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
    margin-bottom: 3rem;
}

@media (max-width: 1200px) {
    .factories-layout {
        grid-template-columns: 240px 1fr 260px;
    }
}
@media (max-width: 991px) {
    .factories-layout {
        grid-template-columns: 1fr;
    }
}

/* Large Search Bar in Hero */
.factory-search-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    margin: 2rem auto;
    max-width: 800px;
}
.factory-search-input {
    border: none;
    outline: none;
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}
.factory-search-select {
    border: none;
    border-left: 1px solid var(--border-color);
    background: transparent;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2em;
    outline: none;
    cursor: pointer;
}
.factory-search-btn {
    border-radius: var(--radius-md);
    padding: 0.5rem 2rem;
    margin-left: 0.5rem;
}

/* Top Category Cards */
.top-category-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
@media (max-width: 991px) {
    .top-category-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
.top-category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.top-category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--brand-primary);
}
.top-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8f9fa;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.top-category-text {
    flex: 1;
}
.top-category-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}
.top-category-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Sidebar General */
.factory-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.factory-widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Filter Styles */
.filter-item {
    margin-bottom: 1.25rem;
}
.filter-item-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: block;
}
.filter-select-sm, .filter-input-sm {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    background: var(--bg-surface);
}
.filter-select-sm {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
}
.min-max-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.min-max-inputs span {
    color: var(--text-muted);
}
.checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.checkbox-list li {
    margin-bottom: 0.5rem;
}
.checkbox-list label {
    font-size: 0.8rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.checkbox-list input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

/* Toggle Switch */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.toggle-switch-label {
    font-size: 0.8rem;
    font-weight: 600;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .toggle-slider {
    background-color: var(--brand-primary);
}
input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Featured Partner Card */
.featured-partner-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.featured-partner-img-wrap {
    width: 180px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.featured-partner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.verified-badge-overlay {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.featured-partner-info {
    flex: 1;
}
.featured-partner-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.featured-partner-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.featured-partner-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
}
.featured-partner-stat-item .label {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}
.featured-partner-stat-item .val {
    font-weight: 600;
}
.featured-partner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    width: 130px;
    flex-shrink: 0;
}

/* Results List */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.results-title {
    font-size: 1rem;
    font-weight: 700;
}
.results-sort-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sort-select {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
}
.view-toggles {
    display: flex;
    gap: 0.2rem;
}
.view-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
}
.view-btn.active {
    background: #f3f4f6;
    color: var(--text-main);
}

.results-list--compact .result-list-item {
    flex-wrap: wrap;
}
.results-list--compact .result-item-stats {
    flex-basis: 100%;
    justify-content: flex-start;
}

.result-list-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.result-item-icon {
    width: 48px;
    height: 48px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
}
.result-item-info {
    flex: 1;
}
.result-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.result-item-loc {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.result-item-stats {
    display: flex;
    gap: 2rem;
    font-size: 0.8rem;
    flex: 1;
    justify-content: center;
}
.result-item-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    width: 100px;
}
.result-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 110px;
    flex-shrink: 0;
}

/* Pagination */
.custom-pagination {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
    margin: 2rem 0;
}
.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}
.page-btn:hover {
    background: #f3f4f6;
}
.page-btn.active {
    border-color: var(--border-color);
    background: var(--bg-surface);
    color: var(--brand-primary);
    font-weight: 600;
}

/* 4 Step Process */
.process-steps-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}
.process-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.process-flow {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.process-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 1rem;
}
.process-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-surface);
    position: relative;
    z-index: 2;
}
.process-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.process-step-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.process-arrow {
    position: absolute;
    top: 10px;
    right: -10px;
    color: var(--text-light);
}
.process-step:last-child .process-arrow {
    display: none;
}

/* Sourcing Request Form */
.sourcing-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.sourcing-form input[type="text"],
.sourcing-form select,
.sourcing-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    font-size: 0.85rem;
    background: var(--bg-surface);
    margin-bottom: 1rem;
}
.sourcing-form textarea {
    resize: vertical;
    min-height: 80px;
}
.file-upload-box {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    background: #f9fafb;
    margin-bottom: 1rem;
    cursor: pointer;
}
.file-upload-box i {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.file-upload-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Shortlist Widget */
.shortlist-grid {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.75rem;
    overflow-x: auto;
}
.sl-header {
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.sl-company {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.sl-row {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
}
.sl-cell {
    display: flex;
    align-items: center;
}

/* Bottom Stats Bar */
.bottom-stats-bar {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-bottom: 3rem;
}
.b-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.b-stat-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}
.b-stat-info .val {
    font-size: 1.1rem;
    font-weight: 700;
}
.b-stat-info .lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}
