/* ==============================================================================
   Thai Pipe Revamp 2026 - Modern Corporate Industrial Stylesheet
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --tp-navy: #002b5c;
    --tp-navy-dark: #07172c;
    --tp-blue-main: #0066cc;
    --tp-blue-hover: #004d99;
    --tp-cyan: #00a0e9;
    --tp-cyan-glow: rgba(0, 160, 233, 0.35);
    --tp-bg-light: #f8fafc;
    --tp-text-dark: #1e293b;
    --tp-text-muted: #64748b;
    --tp-card-border: #e2e8f0;
}

body {
    font-family: 'Prompt', system-ui, -apple-system, sans-serif;
    background-color: var(--tp-bg-light);
    color: var(--tp-text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Navbar */
.navbar-main {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(0, 43, 92, 0.05);
    transition: all 0.3s ease;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.brand-logo {
    height: 52px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
@media (min-width: 992px) {
    .brand-logo {
        height: 68px;
    }
}
.brand-logo:hover {
    transform: scale(1.02);
}

.nav-link {
    font-weight: 500;
    color: #334155 !important;
    padding: 0.65rem 1.1rem !important;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.35rem;
    left: 1.1rem;
    right: 1.1rem;
    height: 2px;
    background: var(--tp-cyan);
    transform: scaleX(0);
    transition: transform 0.25s ease;
    border-radius: 2px;
}
.nav-link:hover, .nav-link.active {
    color: var(--tp-blue-main) !important;
}
.nav-link:hover::after, .nav-link.active::after {
    transform: scaleX(1);
}

/* Top Utility Bar */
.top-bar {
    background: linear-gradient(90deg, var(--tp-navy-dark) 0%, var(--tp-navy) 100%);
    color: #cbd5e1;
    font-size: 0.83rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-bar a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}
.top-bar a:hover {
    color: #ffffff;
}

/* Top Contact Item Styles */
.top-contact-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.top-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #cbd5e1 !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 400;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.top-contact-item:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}
.contact-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 160, 233, 0.15);
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.top-contact-item:hover .contact-icon {
    background: #00a0e9;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(0, 160, 233, 0.4);
}
.contact-divider {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    user-select: none;
}

/* Modern Capsule Language Switcher */
.lang-switch-capsule {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    padding: 2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 500;
    color: #94a3b8 !important;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-pill:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}
.lang-pill.active {
    background: linear-gradient(135deg, var(--tp-blue-main) 0%, var(--tp-cyan) 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 160, 233, 0.4);
}
.lang-flag {
    width: 15px;
    height: 11px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* CMS Admin Button in Top Bar (Frosted Glass Style) */
.btn-cms-admin {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1 !important;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.22rem 0.7rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: all 0.25s ease;
}
.btn-cms-admin:hover {
    background: rgba(0, 160, 233, 0.2);
    border-color: rgba(0, 160, 233, 0.6);
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(0, 160, 233, 0.3);
}
.btn-cms-admin i {
    color: #38bdf8;
    transition: transform 0.2s;
}
.btn-cms-admin:hover i {
    transform: scale(1.1);
}

/* Hero Carousel */
.hero-slider-item {
    min-height: 440px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 23, 44, 0.92) 0%, rgba(0, 43, 92, 0.75) 60%, rgba(0, 102, 204, 0.35) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 4rem 0;
}
.hero-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Trust Stats Bar */
.trust-bar {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--tp-card-border);
    box-shadow: 0 10px 30px -5px rgba(0, 43, 92, 0.07);
    margin-top: -2.5rem;
    position: relative;
    z-index: 10;
    padding: 1.5rem 1rem;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-item:not(:last-child) {
    border-right: 1px solid #f1f5f9;
}
@media (max-width: 991.98px) {
    .trust-bar {
        margin-top: 1rem;
    }
    .stat-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 1rem;
    }
}

/* Category Cards */
.category-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--tp-card-border);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.category-card:hover {
    transform: translateY(-8px);
    border-color: var(--tp-cyan);
    box-shadow: 0 20px 30px -10px rgba(0, 43, 92, 0.12);
}
.category-img-box {
    height: 200px;
    background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.category-img-box img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}
.category-card:hover .category-img-box img {
    transform: scale(1.08);
}
.category-info {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.category-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--tp-navy);
    margin-bottom: 0.4rem;
    transition: color 0.2s;
}
.category-card:hover .category-title {
    color: var(--tp-blue-main);
}
.category-desc {
    color: var(--tp-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}
.category-footer {
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-cat-view {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tp-blue-main);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: gap 0.2s;
}
.category-card:hover .btn-cat-view {
    gap: 0.7rem;
    color: var(--tp-cyan);
}

/* Section Headings */
.modern-section-header {
    margin-bottom: 2.5rem;
}
.modern-badge-sub {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tp-cyan);
    margin-bottom: 0.4rem;
    display: inline-block;
}
.modern-title {
    font-size: clamp(1.4rem, 2.8vw, 1.85rem);
    font-weight: 700;
    color: var(--tp-navy);
    line-height: 1.3;
}
.modern-subtitle {
    color: var(--tp-text-muted);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

/* Media Spotlight Section */
.media-section {
    background: linear-gradient(135deg, var(--tp-navy-dark) 0%, var(--tp-navy) 100%);
    border-radius: 24px;
    padding: 3.5rem 2.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 43, 92, 0.25);
}
.video-glow-box {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 160, 233, 0.2);
}

/* Branch Cards */
.modern-branch-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--tp-card-border);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.modern-branch-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 43, 92, 0.08);
    border-color: #cbd5e1;
}

/* Footer Styling (High Contrast & Clear Typography) */
.modern-footer {
    background: linear-gradient(180deg, #091a30 0%, #040c18 100%);
    color: #cbd5e1;
    padding-top: 4rem;
    padding-bottom: 2rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.modern-footer h6 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    letter-spacing: 0.3px;
}
.modern-footer p {
    color: #cbd5e1;
    line-height: 1.6;
}
.modern-footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}
.modern-footer a:hover {
    color: #38bdf8;
}
.modern-footer .footer-copyright {
    color: #94a3b8;
    font-size: 0.84rem;
}
.footer-admin-link {
    color: #94a3b8 !important;
    text-decoration: none;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}
.footer-admin-link:hover {
    color: #ffffff !important;
    background: rgba(0, 160, 233, 0.2);
    border-color: rgba(0, 160, 233, 0.5);
    box-shadow: 0 0 10px rgba(0, 160, 233, 0.3);
}

/* ==============================================================================
   Comprehensive Responsive Enhancements (Mobile, Tablet, Desktop, 4K)
   ============================================================================== */

/* 1. Mobile Navigation Menu Collapse Styling */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #ffffff;
        border-radius: 14px;
        padding: 1.25rem;
        margin-top: 0.75rem;
        box-shadow: 0 10px 30px -5px rgba(0, 43, 92, 0.12);
        border: 1px solid var(--tp-card-border);
    }
    .nav-link {
        padding: 0.65rem 0.9rem !important;
        border-radius: 8px;
    }
    .nav-link:hover, .nav-link.active {
        background: rgba(0, 102, 204, 0.06);
    }
    .nav-link::after {
        display: none !important;
    }
}

/* 2. Hero Section on Mobile & Tablet */
@media (max-width: 767.98px) {
    .hero-slider-item {
        min-height: 400px;
    }
    .hero-content {
        padding: 2.75rem 0;
        text-align: center;
    }
    .hero-badge {
        font-size: 0.78rem;
        padding: 0.35rem 0.85rem;
    }
    .hero-title {
        font-size: clamp(1.45rem, 5.5vw, 2.2rem) !important;
    }
    .hero-desc {
        font-size: 0.9rem !important;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-btn-group {
        justify-content: center !important;
    }
}

/* 3. Trust Stats Bar on Mobile */
@media (max-width: 575.98px) {
    .trust-bar {
        padding: 1rem 0.75rem;
        margin-top: 0.75rem;
        border-radius: 12px;
    }
    .stat-item {
        padding: 0.4rem 0.25rem;
        gap: 0.65rem;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    .stat-item h4 {
        font-size: 1.15rem !important;
    }
    .stat-item small {
        font-size: 0.72rem !important;
    }
}

/* 4. Category Cards Responsive Dimensions */
.category-img-box {
    height: clamp(150px, 20vw, 200px);
}
@media (max-width: 575.98px) {
    .category-card {
        border-radius: 14px;
    }
    .category-info {
        padding: 1rem 1.15rem;
    }
    .category-title {
        font-size: 0.98rem;
    }
    .category-desc {
        font-size: 0.82rem;
    }
}

/* 5. Media Spotlight Section Responsive */
@media (max-width: 767.98px) {
    .media-section {
        padding: 2rem 1.25rem;
        border-radius: 18px;
    }
    .media-section .video-glow-box {
        margin-top: 1rem;
    }
}

/* 6. Mobile Category Horizontal Scrollable Chips (products.php) */
.mobile-cat-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.25rem 0.25rem 0.75rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mobile-cat-scroll::-webkit-scrollbar {
    display: none;
}
.mobile-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid var(--tp-card-border);
    color: #475569;
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.mobile-cat-chip:hover {
    color: var(--tp-blue-main);
    border-color: var(--tp-cyan);
}
.mobile-cat-chip.active {
    background: var(--tp-blue-main);
    color: #ffffff !important;
    border-color: var(--tp-blue-main);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.25);
}
.mobile-cat-chip .badge {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    border-radius: 9999px;
    padding: 0.2em 0.55em;
}
.mobile-cat-chip.active .badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* 7. Product Cards Responsive Typography & Padding */
@media (max-width: 575.98px) {
    .product-thumb-wrapper {
        height: 135px !important;
        padding: 0.65rem !important;
    }
    .product-info {
        padding: 0.65rem 0.75rem 0.85rem !important;
    }
    .product-title {
        font-size: 0.82rem !important;
        min-height: 2.3rem !important;
        margin-bottom: 0.35rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .product-sku {
        font-size: 0.7rem !important;
    }
    .zoom-overlay {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}
