﻿:root {
    --primary-color: #E60000;
    --bg-color: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --card-bg: #1a1a1a;
    --nav-bg: rgba(10, 10, 10, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   Navigation Bar
========================================= */
header {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header .logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 72px;
    max-width: 190px;
    overflow: hidden;
}

header .logo img {
    max-height: 64px;
    max-width: 190px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: 0.3s;
    padding: 10px 0;
    display: inline-block;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content li {
    width: 100%;
    list-style: none;
}

.dropdown-content a {
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 15px;
}

.dropdown-content a:hover {
    background: var(--primary-color);
    color: #fff;
    padding-left: 25px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-main);
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    .menu-icon {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        padding: 20px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .menu-toggle:checked~.nav-menu {
        display: flex;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.02);
        display: none;
        padding-left: 20px;
        width: 100%;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* =========================================
   Hero & Content
========================================= */
main {
    flex: 1;
}

.hero {
    height: 60vh;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), var(--bg-color)), url('../images/bn.png') center/cover;
    padding: 0 20px;
}

.hero h1 {
    font-size: clamp(40px, 8vw, 80px);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.hero h1 span {
    color: var(--primary-color);
}

.hero p {
    font-size: clamp(16px, 4vw, 20px);
}

.about-hero {
    text-align: center;
    padding: 100px 20px 40px;
}

.about-hero h1 {
    font-size: clamp(40px, 8vw, 72px);
    margin-bottom: 18px;
}

.about-hero h1 span {
    color: var(--primary-color);
}

.about-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
}

.about-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-text h2 {
    font-size: clamp(32px, 5vw, 44px);
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-muted);
    line-height: 1.8;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.values-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    margin-top: 40px;
}

.values-header h2 {
    font-size: clamp(32px, 5vw, 44px);
    margin-bottom: 15px;
}

.values-grid {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.value-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.value-card:hover {
    transform: translateY(-6px);
}

.value-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 18px;
}

.value-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.value-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

.section-title {
    text-align: center;
    font-size: 30px;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    transition: transform 0.3s;
    border-bottom: 4px solid transparent;
    display: flex;
    flex-direction: column;
}

.card-img-wrapper {
    height: 220px;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 20px;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--primary-color);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 22px;
    color: var(--primary-color);
}

.card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* =========================================
   Footer
========================================= */
footer {
    background: var(--card-bg);
    padding: 50px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-col h4 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-main);
    font-weight: bold;
}

.footer-col h4 span {
    color: var(--primary-color);
}

.footer-col p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
}

.footer-col ul a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.social-links a {
    display: inline-block;
    margin-right: 10px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    transition: 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 14px;
}

.footer-dropdown {
    position: relative;
    display: inline-block;
    margin-top: 15px;
}

.footer-dropbtn {
    background-color: rgba(230, 0, 0, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s ease;
    width: 100%;
    justify-content: space-between;
}

.footer-dropbtn:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.footer-drop-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background-color: var(--card-bg);
    min-width: 280px;
    box-shadow: 0px -8px 25px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(230, 0, 0, 0.3);
    border-radius: 10px;
    z-index: 10;
    overflow: hidden;
}

.footer-drop-content a {
    color: var(--text-main);
    padding: 14px 20px;
    text-decoration: none;
    display: block;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s ease;
}

.footer-drop-content a:last-child {
    border-bottom: none;
}

.footer-drop-content a:hover {
    background-color: rgba(230, 0, 0, 0.2);
    color: var(--primary-color);
    padding-left: 25px;
}

.footer-drop-content.show-menu {
    display: block;
    animation: fadeUpDrop 0.3s ease;
}

@keyframes fadeUpDrop {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Left Icon (Back to Main Index)
========================================= */
.header-left {
    display: flex;
    align-items: center; /* 👈 เพิ่มบรรทัดนี้เพื่อบังคับให้เนื้อหาตรงกลาง */
    gap: 16px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-main);
    text-decoration: none;
}

.back-to-main {
    color: var(--text-main);
    font-size: 18px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s ease;
}

.back-to-main:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
}
.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

/* Skeleton Loading */
body.is-loading {
    overflow: hidden;
}

body.is-loading > *:not(.skeleton-loader) {
    visibility: hidden;
}

body.page-ready > *:not(.skeleton-loader) {
    visibility: visible;
}

.skeleton-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    background: #0f1417;
    transition: opacity 0.35s ease;
}

body.is-loading .skeleton-loader {
    opacity: 1;
    pointer-events: auto;
}

body.page-ready .skeleton-loader {
    opacity: 0;
}

.sk-topbar,
.sk-thumb,
.sk-line,
.sk-tags,
.sk-dot {
    position: relative;
    overflow: hidden;
    background: #1c2429;
    border-radius: 10px;
}

.sk-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
    animation: skeleton-shimmer 1.25s infinite;
}

.sk-wrap,
.sk-canvas {
    width: min(1200px, 94vw);
    margin: 92px auto 0;
}

.sk-wrap {
    display: grid;
    gap: 20px;
}

.sk-topbar {
    height: 76px;
    border-radius: 0;
}

.sk-line {
    height: 14px;
    margin-bottom: 10px;
}

.sk-title {
    height: 42px;
    width: min(520px, 72%);
}

.sk-mid {
    width: 76%;
}

.sk-short {
    width: 58%;
}

.sk-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
}

.sk-panel {
    background: #151d21;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
}

.sk-product-head,
.sk-product-grid,
.sk-about-hero,
.sk-about-main,
.sk-about-values-head,
.sk-about-values-grid,
.sk-section,
.sk-hero,
.sk-grid,
.sk-split,
.sk-map {
    display: none;
}

/* Product skeleton: portfolio header + gallery cards */
body.skeleton-product .sk-product-head,
body.skeleton-product .sk-product-grid {
    display: grid;
}

body.skeleton-product .sk-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sk-pcard {
    background: #151d21;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px;
}

.sk-pcard .sk-thumb {
    margin-bottom: 10px;
}

.sk-tags {
    height: 28px;
    width: 46%;
    border-radius: 999px;
    margin-top: 8px;
}

/* About skeleton: hero + split content + values cards */
body.skeleton-about .sk-about-hero,
body.skeleton-about .sk-about-main,
body.skeleton-about .sk-about-values-head,
body.skeleton-about .sk-about-values-grid {
    display: grid;
}

body.skeleton-about .sk-about-main {
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
}

.sk-portrait {
    aspect-ratio: 4 / 5;
}

body.skeleton-about .sk-about-values-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sk-vcard {
    background: #151d21;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px;
}

.sk-dot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    margin-bottom: 12px;
}

/* Keep existing fallback template (home/contact currently uses sk-section) */
body.skeleton-home .sk-hero,
body.skeleton-home .sk-grid,
body.skeleton-contact .sk-hero,
body.skeleton-contact .sk-split,
body.skeleton-contact .sk-map {
    display: grid;
}

body.skeleton-home .sk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

body.skeleton-home .sk-card:nth-child(n+4) {
    display: none;
}

body.skeleton-contact .sk-split {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sk-mapbox {
    aspect-ratio: 16 / 5;
}

@keyframes skeleton-shimmer {
    to { transform: translateX(100%); }
}

@media (max-width: 1024px) {
    body.skeleton-product .sk-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sk-wrap,
    .sk-canvas {
        margin-top: 84px;
        gap: 14px;
    }

    .sk-title {
        height: 34px;
        width: 84%;
    }

    .sk-line {
        height: 12px;
    }

    body.skeleton-product .sk-product-grid,
    body.skeleton-about .sk-about-values-grid,
    body.skeleton-home .sk-grid {
        grid-template-columns: 1fr !important;
    }

    body.skeleton-about .sk-about-main,
    body.skeleton-contact .sk-split {
        grid-template-columns: 1fr !important;
    }

    .sk-pcard:nth-child(n+5) {
        display: none;
    }

    .sk-mapbox {
        aspect-ratio: 16 / 7;
    }
}

/* CSS สำหรับปุ่ม PDF แยกแต่ละโปรดัก */
        .pdf-btn-direct {
            display: inline-block;
            margin-top: 15px;
            padding: 8px 15px;
            background-color: #dc3545; /* สีแดงแบบไฟล์ PDF */
            color: #ffffff;
            text-decoration: none;
            border-radius: 5px;
            font-size: 0.9em;
            font-weight: 500;
            transition: background-color 0.3s;
        }
        .pdf-btn-direct:hover {
            background-color: #c82333;
            color: #ffffff;
        }
        .pdf-btn-direct i {
            margin-right: 5px;
        }
