/* ========================================
   Topforms Computer Co., Ltd. - Main Stylesheet
   ======================================== */

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E7D32;
    --secondary-color: #1976D2;
    --accent-color: #C62828;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #F5F5F5;
    --bg-white: #FFFFFF;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Sarabun', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-title p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* === Header & Navigation === */
header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0;
    font-size: 0.9rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
}

.contact-info a {
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-info a:hover {
    opacity: 0.8;
}

.header-main {
    padding: 15px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo a:hover .logo-img {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.logo p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.2;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 10px 0;
    position: relative;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* === Hero Section === */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero-banner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.hero .tagline {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);
}

/* === About Section === */
.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    text-align: justify;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* === Products Section === */
.products {
    background-color: var(--bg-white);
}

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

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-content {
    padding: 25px;
}

.product-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-content p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.product-features {
    list-style: none;
    margin-bottom: 20px;
}

.product-features li {
    padding: 5px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.product-features li::before {
    content: '✓ ';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 5px;
}

/* === Gallery Section === */
.gallery {
    background-color: var(--bg-light);
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 125, 50, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

/* === Contact Section === */
.contact {
    background-color: var(--bg-white);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info-box {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 10px;
}

.contact-info-box h3 {
    color: var(--primary-color);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.contact-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.contact-item p {
    color: var(--text-light);
    margin: 0;
}

.contact-form {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.btn-submit:hover {
    background-color: #1B5E20;
}

/* === Footer === */
footer {
    background-color: var(--text-dark);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 10px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ccc;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #ccc;
}

/* === Quick Contact Buttons === */
.quick-contact {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.quick-contact-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
}

.quick-contact-btn:hover {
    transform: scale(1.1);
}

.btn-line {
    background-color: #00B900;
}

.btn-phone {
    background-color: var(--secondary-color);
}

.btn-email {
    background-color: var(--accent-color);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .header-top {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: var(--shadow);
        padding: 20px;
    }
    
    nav ul.active {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .about-content,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .about-features {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-contact {
        bottom: 20px;
        right: 20px;
    }
}

/* === Cookie Consent Styles === */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.98) 0%, rgba(25, 118, 210, 0.98) 100%);
    color: white;
    padding: 20px;
    z-index: 9997;
    display: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.cookie-consent-banner.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.cookie-consent-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex: 1;
    min-width: 300px;
}

.cookie-consent-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    opacity: 0.9;
}

.cookie-consent-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: white;
}

.cookie-consent-text p {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    opacity: 0.95;
    line-height: 1.5;
}

.cookie-learn-more {
    display: inline-block;
    color: #FFD700;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #FFD700;
    transition: all 0.3s ease;
}

.cookie-learn-more:hover {
    color: white;
    border-bottom-color: white;
}

.cookie-consent-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    min-width: max-content;
}

.btn-cookie-accept {
    background-color: #FFD700;
    color: #2E7D32;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-cookie-accept:hover {
    background-color: #FFED4E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-cookie-settings {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 23px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-cookie-settings:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* === Cookie Settings Modal === */
.cookie-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

.cookie-settings-overlay.show {
    display: block;
}

.cookie-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
    animation: scaleIn 0.3s ease;
}

.cookie-settings-modal.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.cookie-settings-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.cookie-settings-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.cookie-settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.cookie-settings-body {
    padding: 25px;
    background-color: #fafafa;
}

.cookie-settings-intro {
    margin: 0 0 25px 0;
    color: var(--text-light);
    font-weight: 500;
}

.cookie-option {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.cookie-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.cookie-option-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.cookie-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.cookie-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-option-title {
    cursor: pointer;
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-option input[type="checkbox"]:disabled ~ .cookie-option-title {
    opacity: 0.7;
}

.cookie-option-description {
    margin: 0 0 0 35px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.cookie-settings-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    background-color: #f5f5f5;
    border-radius: 0 0 12px 12px;
}

.btn-cookie-reject {
    flex: 1;
    background-color: #f44336;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cookie-reject:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

.btn-cookie-save {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cookie-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

/* Responsive Cookie Consent */
@media (max-width: 768px) {
    .cookie-consent-container {
        flex-direction: column;
        gap: 20px;
    }

    .cookie-consent-content {
        width: 100%;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-cookie-accept,
    .btn-cookie-settings {
        width: 100%;
        justify-content: center;
    }

    .cookie-settings-modal {
        width: calc(100vw - 40px);
    }

    .cookie-settings-content {
        max-height: 90vh;
    }
}
    
    
    .quick-contact-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }


@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .contact-form,
    .contact-info-box {
        padding: 20px;
    }
}
