:root {
    --primary-color: #0d2d52; /* สีน้ำเงินเข้ม */
    --secondary-color: #ffffff;
    --accent-color: #d93025;  /* สีแดง */
    --text-color: #333333;
    --light-gray: #f4f7f6;
    --font-family: 'Sarabun', sans-serif;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--secondary-color);
    line-height: 1.6;
}

.highlight {
    color: #007bff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Header & Navigation --- */
.header {
    background-color: var(--secondary-color);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img {
    height: 50px;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-right .btn-contact {
    margin-left: 10px;
}

.language-select {
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin-right: 5px;
    margin-left: 15px;

}

.desktop-only { display: none; }

@media (min-width: 769px) {
    .desktop-only { display: inline-block; }
    .mobile-only { display: none; }
}

.nav-menu a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease, transform 0.2s ease;
}

.nav-menu a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.nav-menu a:not(.btn-contact)::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #f8c21a, #d4af37);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-menu a:not(.btn-contact):hover::after {
    width: 100%;
}

/* Dropdown */
.nav-menu li { position: relative; }
.nav-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--secondary-color);
    box-shadow: var(--shadow);
    list-style: none;
    padding: 10px 0;
}
.nav-menu .dropdown-menu li { margin: 0; }
.nav-menu .dropdown-menu a {
    display: block;
    padding: 8px 20px;
    white-space: nowrap;
}
.nav-menu .dropdown-menu a:hover {
    background-color: var(--light-gray);
    color: var(--accent-color);
}
.nav-menu li:hover > .dropdown-menu { display: block; }

a.btn-contact {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

a.btn-contact:hover {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    background-image: linear-gradient(rgba(13, 45, 82, 0.7), rgba(13, 45, 82, 0.7)), url('https://placehold.co/1920x1080/cccccc/969696?text=Industrial+Safety');
    background-size: cover;
    background-position: center;
    height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--secondary-color);
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    font-weight: 400;
}

.btn {
    text-decoration: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--secondary-color);
}

.btn-quote {
    background-image: linear-gradient(45deg, #ff9a00, #ff6a00);
    color: var(--secondary-color);
    /* Match dimensions with .btn-primary by using an equal border width */
    border: 2px solid transparent;
    margin-left: 10px;
    margin-top: 10px;
}

.btn-quote:hover {
    opacity: 0.9;
}

/* --- Services Section --- */
#services {
     background-color: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--secondary-color);
    border-radius: 10px;
    padding: 35px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.service-card .service-icon {
    width: 300px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 8px;
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 0.95rem;
    flex-grow: 1;
}

.service-card a {
    margin-top: 20px;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
}

/* --- Why Choose Us Section --- */
.subtitle {
    margin-top: 10px;
    color: #666;
    font-size: 1.1em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: left;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card .icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 1.2em;
    color: #0d2c6c;
}

.card p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}

/* --- Clients Section --- */
#clients {
    background-color: var(--light-gray);
}

.clients-slider {
    overflow: hidden;
}

.clients-track {
    display: flex;
    align-items: center;
    animation: scroll 20s linear infinite;
}


.client-logo {
    width: 150px;
    height: 80px;
    object-fit: contain;
    margin-right: 40px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.client-logo:hover {
    opacity: 1;
}

.clients-note {
    text-align: center;
    margin-top: 20px;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(var(--scroll-width)); }
}

/* --- Contact Section --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: var(--secondary-color);
    padding: 50px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.service-detail-description {
    margin-bottom: 20px;
}

.contact-info h3, .contact-form h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.contact-info .icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    color: var(--primary-color);
}

.map-container {
    margin-top: 20px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.map-container iframe {
    width: 100%;
    height: 300px;
    border: 0;
}

.contact-social {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
}

.contact-social .social-item {
    display: flex;
    flex-direction: column;
    align-items: left;
    text-decoration: none;
    color: inherit;
}

.contact-social .line-qr,
.contact-social .facebook-icon {
    width: 120px;
    height: 120px;
}

.contact-social .social-label {
    font-size: 0.9rem;
    margin-top: 8px;
    white-space: nowrap;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-family: var(--font-family);
    font-size: 1rem;
}

.btn-submit {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-submit:hover {
    opacity: 0.9;
}

/* --- Footer --- */
.footer {
    background-color: var(--primary-color);
    color: #a9b4c2;
    text-align: center;
    padding: 30px 0;
    margin-top: 80px;
}

.footer p {
    margin: 5px 0;
}

/* --- Accordion --- */
.accordion details {
    margin-bottom: 15px;
}

.accordion summary {
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    position: relative;
    list-style: none;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.accordion details[open] summary::after {
    content: '\2212';
}

.accordion details > *:not(summary) {
    padding: 15px 20px;
    background-color: var(--light-gray);
    border-radius: 0 0 8px 8px;
    margin-top: 10px;
}

/* --- Info Cards --- */
.info-cards {
    display: grid;
    gap: 20px;
}

.info-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background-color: var(--secondary-color);
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.info-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.info-card .preview {
    color: var(--text-color);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.info-card .read-more {
    align-self: flex-start;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    background: linear-gradient(145deg, #e6f2ff, #ffffff);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #a4cafe;
    box-shadow: 0 10px 25px rgba(64, 152, 215, 0.15);
    position: relative;
    z-index: 1001;
}

.modal-title {
    margin: 0 0 20px;
    color: #4098d7;
    text-align: center;
    font-weight: 700;
}

.modal-body {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4098d7;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 768px) {
    .info-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--secondary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 20px 0;
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .section-title {
        font-size: 2.2rem;
    }
}

/* Position Facebook chat plugin */
.fb_dialog.fb_dialog_advanced {
    bottom: 20px !important;
    right: 20px !important;
}
