/* =========================================
   หน้า Single Factory (B2B Layout)
   ========================================= */
.single-factory-container { max-width: 1200px; margin: 40px auto 80px; padding: 0 20px; }

/* Breadcrumb */
.cpt-breadcrumb { margin-bottom: 25px; font-size: 0.95em; color: #666; }
.cpt-breadcrumb a { color: #0073aa; text-decoration: none; font-weight: 500; }
.cpt-breadcrumb .current-page { color: #222; font-weight: bold; }

/* Hero Media */
.factory-hero-media { border-radius: 12px; overflow: hidden; margin-bottom: 40px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.factory-hero-img { width: 100%; height: auto; max-height: 500px; object-fit: cover; display: block; }
.responsive-video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.responsive-video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Layout 2 Columns */
.factory-layout-grid {
    display: grid;
    grid-template-columns: 1fr 350px; /* ซ้ายยืดหยุ่น ขวาฟิกซ์ 350px */
    gap: 50px;
    align-items: start; /* ให้ Sidebar ไม่ยืดตามความสูงเนื้อหา */
}

/* =========================================
   🚨 คาถาสะกด Grid & Slider ไม่ให้ขยายร่าง (แก้บั๊ก 26M Pixel)
   ========================================= */
.factory-main-content { 
    min-width: 0; /* สำคัญมาก! ล็อคไม่ให้คอลัมน์ซ้ายขยายร่างตาม Slider */
}
.factory-gallery-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden; 
}
.cpt-product-gallery {
    width: 100% !important; 
    max-width: 100% !important;
    overflow: hidden !important; 
}
/* ========================================= */

/* Main Content (Left) */
.factory-title { font-size: 2.5em; font-weight: 800; color: #111; margin-bottom: 30px; line-height: 1.3; }

/* Capabilities Box */
.factory-capabilities-box {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 25px 30px; margin-bottom: 40px;
}
.factory-capabilities-box .box-title { margin-top: 0; margin-bottom: 20px; font-size: 1.2em; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.factory-capabilities-box .box-title i { color: #0073aa; }
.capability-list { list-style: none; padding: 0; margin: 0; }
.capability-list li { margin-bottom: 12px; font-size: 1.05em; color: #334155; line-height: 1.6; }
.cert-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cert-badges .badge { background: #0073aa; color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 0.85em; font-weight: 600; letter-spacing: 0.5px; }

/* Text Content */
.factory-entry-content { font-size: 1.1em; line-height: 1.8; color: #444; margin-bottom: 50px; }
.factory-gallery-section h3 { margin-bottom: 20px; border-left: 4px solid #0073aa; padding-left: 15px; }

/* Sticky Sidebar (Right) */
.factory-sidebar { height: 100%; }
.sticky-element {
    position: sticky;
    top: 100px; /* ระยะห่างจากขอบจอบน (ปรับให้พ้น Header เมนูเว็บพี่) */
}

.factory-contact-card {
    background: #fff; border-radius: 12px; padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); border-top: 5px solid #0073aa;
}
.factory-contact-card .card-title { font-size: 1.2em; font-weight: 700; margin-top: 0; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }

.contact-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; color: #555; font-size: 1.05em; line-height: 1.5; }
.contact-item i { font-size: 1.3em; color: #0073aa; margin-top: 3px; flex-shrink: 0; }
.contact-item a { color: #555; text-decoration: none; transition: color 0.2s; }
.contact-item a:hover { color: #0073aa; }
.contact-item.address { font-style: normal; } /* Reset address italic */

/* Google Maps Button */
.map-action { margin-top: 25px; }
.btn-gmap {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    background: #10b981; color: #fff; text-decoration: none; padding: 14px 20px;
    border-radius: 8px; font-weight: bold; font-size: 1.1em; transition: all 0.3s ease;
}
.btn-gmap:hover { background: #059669; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3); color: #fff; }

/* Mobile Adjustments */
@media (max-width: 991px) {
    .factory-layout-grid { grid-template-columns: 1fr; gap: 40px; }
    .sticky-element { position: relative; top: 0; }
    .factory-title { font-size: 2em; }
}