/* =========================================================
   FACTORIES & SUPPLIERS PAGES (Exact Design Match)
   ========================================================= */

/* Adjust body offset for pinned header */
body {
    padding-top: 132px;
    background-color: #f3f7fd;
}

/* =========================================================
   HERO BANNER (Full-width factory industrial banner)
   ========================================================= */
.factories-hero-banner {
    width: 100%;
    min-height: 380px;
    background:
        linear-gradient(
            90deg,
            rgba(235, 244, 255, 0.96) 0%,
            rgba(235, 244, 255, 0.85) 38%,
            rgba(235, 244, 255, 0.12) 72%,
            rgba(235, 244, 255, 0.0) 100%
        ),
        url("../image/factory/factory_hero.png") no-repeat right 35%;
    background-size: cover;
    border-bottom: 1px solid #dbeafe;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.factories-hero-inner {
    width: 100%;
}

.factories-hero-text h1 {
    font-size: clamp(1.9rem, 3.2vw, 2.55rem);
    font-weight: 900;
    color: #163a70;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
}

.factories-hero-text h1.hero-title-sentence {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.factories-hero-text p {
    font-size: 1.05rem;
    font-weight: 500;
    color: #2c4f82;
    line-height: 1.45;
}

/* =========================================================
   MAIN CONTENT AREA & HEADINGS
   ========================================================= */
.factories-main-bg {
    background-color: #f3f7fd;
    padding: 2.75rem 0 4.5rem 0;
}

.factories-section-heading {
    font-size: 1.35rem;
    font-weight: 800;
    color: #163a70;
    margin-bottom: 1.5rem;
}

/* =========================================================
   PAGE 1: FACTORY CATEGORIES 3-COLUMN GRID (factories.html)
   ========================================================= */
.factory-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
}

.factory-cat-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.35rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 185px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.factory-cat-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(30, 58, 138, 0.08);
}

.cat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}

.cat-code-badge {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* Pastel Badge Colors matching Reference */
.badge-fb { background-color: #ffedd5; color: #f97316; }
.badge-hh { background-color: #dcfce7; color: #22c55e; }
.badge-cm { background-color: #ffe4e6; color: #f43f5e; }
.badge-pm { background-color: #dbeafe; color: #3b82f6; }
.badge-ri { background-color: #f3e8ff; color: #c026d3; }
.badge-ed { background-color: #cffafe; color: #06b6d4; }
.badge-es { background-color: #fee2e2; color: #ef4444; }

.cat-index-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.cat-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.cat-card-body p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
    max-width: 85%;
}

.cat-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.cat-arrow-btn {
    width: 30px;
    height: 30px;
    border-radius: 0.35rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.factory-cat-card:hover .cat-arrow-btn {
    background-color: #163a70;
    border-color: #163a70;
    color: #ffffff;
}

/* =========================================================
   PAGE 2: HORIZONTAL FACTORY CARDS (factory-detail.html)
   ========================================================= */
.factory-partner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.35rem;
}

.factory-partner-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.85rem;
    display: flex;
    align-items: stretch;
    gap: 1.1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.factory-partner-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.08);
}

.partner-thumb {
    width: 145px;
    height: 118px;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

.partner-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.partner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.15rem 0.25rem;
}

.partner-badge-row {
    display: flex;
    justify-content: flex-end;
}

.verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #dcfce7;
    color: #15803d;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
}

.verified-pill .dot {
    width: 6px;
    height: 6px;
    background-color: #16a34a;
    border-radius: 50%;
}

.partner-info h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.partner-info p {
    font-size: 0.78rem;
    color: #64748b;
}

.partner-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.view-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: #ffffff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    border-radius: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.factory-partner-card:hover .view-profile-btn,
.view-profile-btn:hover {
    background-color: #163a70;
    border-color: #163a70;
    color: #ffffff;
}

/* =========================================================
   PAGINATION (Centered rounded squares)
   ========================================================= */
.factory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.75rem;
    margin-bottom: 2.5rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.45rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: #93c5fd;
    background-color: #eff6ff;
}

.page-btn.active {
    background-color: #163a70;
    border-color: #163a70;
    color: #ffffff;
}

.page-dots {
    color: #64748b;
    font-weight: 700;
    padding: 0 0.25rem;
}

/* =========================================================
   BOTTOM CTA BANNER ("Looking for a Reliable Manufacturing Partner?")
   ========================================================= */
.factory-cta-banner {
    background-color: #dce8f8;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1.4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cta-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.cta-icon {
    font-size: 2rem;
    color: #163a70;
    flex-shrink: 0;
}

.cta-divider {
    width: 1.5px;
    height: 44px;
    background-color: #93c5fd;
}

.cta-text h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #163a70;
    margin-bottom: 0.2rem;
}

.cta-text p {
    font-size: 0.85rem;
    color: #3b5984;
}

.cta-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #163a70;
    color: #ffffff;
    padding: 0.65rem 1.35rem;
    border-radius: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.cta-contact-btn:hover {
    background-color: #1e40af;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media screen and (max-width: 992px) {
    .factory-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .factory-partner-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 640px) {
    .factory-cat-grid {
        grid-template-columns: 1fr;
    }
    .factory-cta-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .cta-divider {
        display: none;
    }
}