/*!
Theme Name: 18Digital
Theme URI: https://18digital.asia
Author: 18digital.asia
Author URI: https://18digital.asia
Description: Theme được vận hành và phát triển bởi 18digital.asia
Version: 2.1.0
Tested up to: 5.4
Requires PHP: 7.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: digital
Template: hello-elementor
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.

digital_theme is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.

Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/
*/


/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Generic
	- Normalize
	- Box sizing
# Base
	- Typography
	- Elements
	- Links
	- Forms
## Layouts
# Components
	- Navigation
	- Posts and pages
	- Comments
	- Widgets
	- Media
	- Captions
	- Galleries
# plugins
	- Jetpack infinite scroll
# Utilities
	- Accessibility
	- Alignments

--------------------------------------------------------------*/


/*--------------------------------------------------------------
# Generic
--------------------------------------------------------------*/


/* Normalize
--------------------------------------------- */


/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */


/* Document
	 ========================================================================== */


/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

form#form-contact {
    display: flex;
}


/* === Container chính === */

.category-posts-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}


/* === Mỗi danh mục === */

.category-section {
    margin-bottom: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}


/* Tiêu đề danh mục */

.category-title {
    font-size: 24px;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 700;
}

.category-title a {
    color: inherit;
    text-decoration: none;
}

.category-title a:hover {
    color: #e74c3c;
}


/* === Grid: 2 cột cho desktop === */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}


/* === Mỗi bài viết (post item) === */

.post-grid-item {
    background: #ffffff !important;
    /* Nền trắng */
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.post-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
}


/* Flex bên trong: ảnh trái - nội dung phải */

.post-flex-container {
    display: flex;
    height: 100%;
    flex: 1;
    box-sizing: border-box;
}


/* Ảnh đại diện */

.post-grid-item .post-image {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    height: 140px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.post-grid-item .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Nội dung bên phải */

.post-content {
    flex: 2;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.post-content h3 {
    margin: 0 0 10px 0;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    color: #2c3e50;
}

.post-content h3 a {
    color: #2980b9;
    text-decoration: none;
}

.post-content h3 a:hover {
    color: #e74c3c;
    text-decoration: underline;
}

.post-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: normal;
}


/* === Responsive: Tablet & Mobile === */

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        /* 1 cột */
        gap: 16px;
    }
    .post-flex-container {
        flex-direction: row;
        /* Giữ nguyên ảnh trái - nội dung phải nếu màn hình đủ rộng */
    }
    .post-grid-item .post-image {
        height: 120px;
        min-width: 100px;
        max-width: 120px;
    }
}


/* === Mobile nhỏ === */

@media (max-width: 480px) {
    .post-flex-container {
        flex-direction: column;
        /* Ảnh lên trên, nội dung xuống dưới */
    }
    .post-grid-item .post-image {
        height: 180px;
        max-width: 100%;
    }
    .post-content {
        padding: 12px;
    }
    .post-content h3 {
        font-size: 16px;
    }
    .post-excerpt {
        font-size: 13px;
    }
}


/* === Reset box-sizing để tránh bị ảnh hưởng === */

.category-posts-container *,
.category-posts-container *::before,
.category-posts-container *::after {
    box-sizing: border-box;
}


/* style form */

.form-contact {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

#form-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

#form-contact input,
#form-contact button {
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#form-contact input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#form-contact input::placeholder {
    color: #999;
}

#form-contact button {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

#form-contact button:hover {
    background-color: #2980b9;
}


/* === Desktop: 4 input + button trên 1 hàng === */

@media (min-width: 992px) {
    #form-contact {
        flex-wrap: nowrap;
    }
    #form-contact input,
    #form-contact button {
        flex: 1;
        min-width: 180px;
    }
}


/* === Tablet: từ 768px đến 991px === */

@media (min-width: 768px) and (max-width: 991px) {
    #form-contact {
        flex-wrap: wrap;
    }
    #form-contact>input,
    #form-contact>button {
        flex: 1 1 calc(50% - 10px);
        min-width: 200px;
    }
    #form-contact>button {
        flex: 1 1 100%;
        margin-top: 10px;
    }
}


/* === Mobile: nhỏ hơn 768px === */

@media (max-width: 767px) {
    #form-contact {
        flex-direction: column;
        gap: 12px;
    }
    #form-contact input,
    #form-contact button {
        width: 100%;
        min-height: 45px;
    }
}


/* === Popup Styles === */

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.popup-close:hover {
    color: #e74c3c;
}

.popup-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 25px 30px 20px;
    text-align: center;
    border-radius: 12px 12px 0 0;
}

.popup-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
}

.popup-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.popup-body {
    padding: 25px 30px 30px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 5px 0 0;
}

.checkbox-group a {
    color: #3498db;
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.popup-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-submit-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}


/* Animations */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Responsive */

@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        margin: 20px;
    }
    .popup-header h2 {
        font-size: 20px;
    }
    .popup-header p {
        font-size: 14px;
    }
    .popup-body {
        padding: 20px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 12px;
        font-size: 14px;
    }
    .popup-submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}


/* Ngăn cuộn khi popup mở */

body.popup-open {
    overflow: hidden;
}


/* === Project Registration Form - CSS độc lập === */

.project-reg-form-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 400px;
    margin: 20px auto;
    padding: 0 15px;
}

.project-reg-form-container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 25px;
    box-sizing: border-box;
}

.project-reg-form-header {
    text-align: center;
    margin-bottom: 20px;
}

.project-reg-form-header h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.project-reg-form-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
}

.project-reg-form-element {
    margin-bottom: 16px;
}

.project-reg-form-element input[type="text"],
.project-reg-form-element input[type="tel"] {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
}

.project-reg-form-element input[type="text"]:focus,
.project-reg-form-element input[type="tel"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.project-reg-form-element input::placeholder {
    color: #999;
}

.project-reg-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
}

.project-reg-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.project-reg-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.project-reg-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    display: none;
    box-sizing: border-box;
}

.project-reg-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.project-reg-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}


/* Responsive */

@media (max-width: 768px) {
    .project-reg-form-wrapper {
        margin: 15px auto;
        padding: 0 10px;
    }
    .project-reg-form-container {
        padding: 20px;
    }
    .project-reg-form-header h3 {
        font-size: 20px;
    }
    .project-reg-form-header p {
        font-size: 14px;
    }
    .project-reg-form-element input[type="text"],
    .project-reg-form-element input[type="tel"] {
        padding: 12px;
        font-size: 14px;
    }
    .project-reg-submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}


/* Reset box-sizing để tránh xung đột */

.project-reg-form-wrapper *,
.project-reg-form-wrapper *::before,
.project-reg-form-wrapper *::after {
    box-sizing: border-box;
}

.fixed-footer-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.fixed-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: white;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.fixed-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fixed-btn i {
    width: 20px;
    height: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* Hotline Button */

.hotline-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.hotline-btn:hover {
    background: linear-gradient(135deg, #219653, #27ae60);
}

.hotline-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/></svg>');
}


/* Zalo Button */

.zalo-btn {
    background: linear-gradient(135deg, #0068ff, #0085ff);
}

.zalo-btn:hover {
    background: linear-gradient(135deg, #0056cc, #0073e6);
}

.zalo-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12c0 1.54.36 3.04 1.06 4.39L1 23l6.61-2.06C9.03 21.62 10.5 22 12 22c5.52 0 10-4.48 10-10S17.52 2 12 2zm-1.25 15.5c-.17 0-.34-.04-.5-.13-.47-.27-.63-.88-.36-1.35.75-1.31 1.16-2.82 1.16-4.38 0-.41.33-.75.75-.75s.75.34.75.75c0 1.69-.45 3.32-1.29 4.75-.16.27-.46.43-.77.43zm4.7-3.5c-.41 0-.75-.34-.75-.75 0-2.9-2.36-5.25-5.25-5.25-.41 0-.75-.34-.75-.75s.34-.75.75-.75c3.72 0 6.75 3.03 6.75 6.75 0 .41-.34.75-.75.75z"/></svg>');
}


/* Price Button */

.price-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.price-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a5281b);
}

.price-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
}


/* Responsive */

@media (max-width: 768px) {
    .fixed-footer-buttons {
        right: 15px;
        bottom: 15px;
        gap: 10px;
    }
    .fixed-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .fixed-btn i {
        width: 18px;
        height: 18px;
    }
    .fixed-btn span {
        display: none;
        /* Ẩn text trên mobile để tiết kiệm không gian */
    }
    .fixed-btn:before {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .fixed-footer-buttons {
        right: 10px;
        bottom: 10px;
    }
}


/* Reset box-sizing */

.fixed-footer-buttons *,
.fixed-footer-buttons *::before,
.fixed-footer-buttons *::after {
    box-sizing: border-box;
}