/*
Theme Name:           Flatsome
Theme URI:            http://flatsome.uxthemes.com
Author:               UX-Themes
Author URI:           https://uxthemes.com
Description:          Multi-Purpose Responsive WooCommerce Theme
Version:              3.20.2
Requires at least:    6.4
Requires PHP:         7.4
WC requires at least: 8.3
Text Domain:          flatsome
License:              https://themeforest.net/licenses
License URI:          https://themeforest.net/licenses
*/


/***************
All custom CSS should be added to Flatsome > Advanced > Custom CSS,
or in the style.css of a Child Theme.
***************/

/* ===== ĐỊNH DẠNG POPUP MAKER & CUSTOM MODAL PREMIUM ===== */
.pum-container.popmake,
.vf-modal-wrapper {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25) !important;
    border: none !important;
    padding: 0 !important; /* Set to 0 so header & banner stretch */
    max-width: 600px !important;
    width: 90% !important;
    position: relative !important;
    overflow: visible !important; /* Do NOT set overflow: hidden so close button can float outside */
}

.vf-modal-container {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    width: 100% !important;
}

/* Nút Đóng (Close) của cả hai Popup - Floating outside top-right corner */
.vf-modal-close,
.pum-container .pum-close,
.pum-theme-16 .pum-content + .pum-close {
    position: absolute !important;
    top: -12px !important; /* Float outside top */
    right: -12px !important; /* Float outside right */
    background: #000000 !important; /* Black circle background */
    color: #ffffff !important; /* White X icon */
    border: 2px solid #ffffff !important; /* White border */
    border-radius: 50% !important; /* Circle shape */
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
}
.vf-modal-close:hover,
.pum-container .pum-close:hover,
.pum-theme-16 .pum-content + .pum-close:hover {
    color: #da251d !important;
    background: #000000 !important;
    transform: scale(1.1) !important;
}

/* Logo & Banner Header */
.vf-popup-header-custom {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 25px !important; /* Standard padding works since close button is outside */
    background: #ffffff !important;
    box-sizing: border-box !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}
.vf-popup-header-custom img {
    object-fit: contain !important;
}
.vf-popup-body-custom,
.vf-modal-content {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}
.pum-container textarea,
#vfContactModal textarea {
    height: 80px !important;
    padding: 12px 14px !important;
    resize: none !important;
}

/* Form inputs & select styling */
.pum-container select,
.pum-container input:not([type="submit"]),
.pum-container textarea,
#vfContactModal select,
#vfContactModal input:not([type="submit"]),
#vfContactModal textarea {
    width: 100% !important;
    height: 45px !important;
    padding: 0 14px !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    color: #333333 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0 !important; /* Managed by grid gap */
}

/* Custom placeholder */
.pum-container input::placeholder,
.pum-container textarea::placeholder,
#vfContactModal input::placeholder,
#vfContactModal textarea::placeholder {
    color: #999999 !important;
}

/* Hiệu ứng khi focus */
.pum-container select:focus,
.pum-container input:not([type="submit"]):focus,
.pum-container textarea:focus,
#vfContactModal select:focus,
#vfContactModal input:not([type="submit"]):focus,
#vfContactModal textarea:focus {
    border-color: #da251d !important;
    box-shadow: 0 0 0 3px rgba(218, 37, 29, 0.12) !important;
}

/* Form Grid & Layout */
.vf-form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vf-form-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.vf-form-col {
    flex: 1;
    min-width: 0;
}

/* Custom Select styling to have standard arrow */
.pum-container select,
#vfContactModal select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
    padding-right: 30px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Checkbox / Consent area styling */
.vf-form-consent {
    margin: 15px 0 10px;
    font-size: 12.5px !important;
    line-height: 1.45;
    color: #444444 !important;
    text-align: left;
}
.vf-form-consent label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    font-weight: 500 !important;
}
.vf-form-consent input[type="checkbox"] {
    width: 15px !important;
    height: 15px !important;
    margin: 2px 0 0 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #da251d !important;
}

/* Submit button styling - Center aligned & pill shaped */
.pum-container input[type="submit"],
#vfContactModal input[type="submit"] {
    display: inline-block !important;
    width: auto !important;
    min-width: 240px !important;
    height: 46px !important;
    padding: 0 40px !important;
    background: #1a1a1e !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    border-radius: 50px !important; /* Pill shape */
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    margin: 10px auto 0 !important;
}

.pum-container input[type="submit"]:hover,
#vfContactModal input[type="submit"]:hover {
    background: #da251d !important; /* Red hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(218, 37, 29, 0.35) !important;
}

/* Neutralize CF7 auto paragraphs and line breaks inside grid */
.vf-form-grid p {
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}
.vf-form-grid br {
    display: none !important;
}
.vf-form-grid .wpcf7-form-control-wrap {
    display: block !important;
    width: 100% !important;
}

/* Đảm bảo căn chỉnh lề trên thiết bị di động (Mobile Optimization) */
@media (max-width: 576px) {
    .pum-container.popmake {
        min-width: 0px !important;
        width: auto !important;
        max-width: none !important;
        left: 18px !important;
        right: 18px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
    }
    .vf-modal-wrapper {
        width: calc(100% - 36px) !important;
        max-width: calc(100% - 36px) !important;
        margin: 0 auto !important;
        left: auto !important;
        right: auto !important;
    }
    .vf-modal-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    .vf-popup-header-custom {
        padding: 12px 15px !important;
    }
    .vf-popup-header-custom img:first-child {
        max-height: 30px !important;
    }
    .vf-popup-header-custom img:last-child {
        max-height: 35px !important;
    }
    .vf-popup-banner-custom {
        padding: 12px 15px !important;
    }
    .vf-popup-banner-custom h3,
    .vf-popup-banner-custom h2 {
        font-size: 13.5px !important;
    }
    .vf-popup-banner-custom p {
        font-size: 11px !important;
    }
    .vf-popup-body-custom,
    .vf-modal-content {
        padding: 18px 15px 22px !important;
    }
    
    /* Grid stack on mobile */
    .vf-form-row:not(.full-width) {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Compact forms for mobile height optimization */
    .pum-container select,
    .pum-container input:not([type="submit"]),
    #vfContactModal select,
    #vfContactModal input:not([type="submit"]) {
        height: 42px !important;
        font-size: 14px !important;
        padding: 0 12px !important;
    }
    .pum-container textarea,
    #vfContactModal textarea {
        height: 65px !important;
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    .vf-form-consent {
        font-size: 11px !important;
        margin: 10px 0 5px !important;
    }
    .pum-container input[type="submit"],
    #vfContactModal input[type="submit"] {
        height: 44px !important;
        font-size: 14px !important;
        width: 100% !important; /* Full width button on mobile */
        min-width: 0 !important;
    }
    .vf-form-grid {
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    /* 1. Fix lỗi Popup Maker bị tràn viền */
    .pum-container.popmake {
        min-width: 0px !important;
        width: auto !important;
        max-width: none !important;
        left: 18px !important;
        right: 18px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
    }

    /* 2. Đổi màu chữ menu sidebar trên điện thoại thành màu đen và làm sáng menu con */
    .mobile-sidebar .nav-sidebar > li > a {
        color: #000000 !important;
        font-weight: bold;
    }
    .mobile-sidebar .nav-sidebar li.menu-item-has-children > a:after,
    .mobile-sidebar .nav-sidebar li.nav-dropdown-toggle > a:after {
        border-color: #000000 !important;
    }
    .mobile-sidebar .nav-sidebar {
        color: #000000 !important;
    }
    
    /* Thiết kế lại Menu Con (Sub-menu) di động cực kỳ sang trọng */
    .mobile-sidebar .nav-sidebar ul.children,
    .mobile-sidebar .nav-sidebar ul.sub-menu {
        background-color: #f7f8fa !important; /* Nền xám nhạt cao cấp */
        border-top: 1px solid #eaeaea;
        border-bottom: 1px solid #eaeaea;
        padding: 5px 0 !important;
    }
    .mobile-sidebar .nav-sidebar ul.children li a,
    .mobile-sidebar .nav-sidebar ul.sub-menu li a {
        color: #444444 !important; /* Chữ xám đậm dễ nhìn */
        font-weight: 500 !important;
        font-size: 0.92rem !important;
        padding-left: 30px !important; /* Thụt lề thụ cấp rõ ràng */
        border-bottom: none !important;
    }
    /* Hiệu ứng hover và active cho menu con */
    .mobile-sidebar .nav-sidebar ul.children li a:hover,
    .mobile-sidebar .nav-sidebar ul.sub-menu li a:hover {
        color: #da251d !important; /* Chữ chuyển đỏ Vinfast khi bấm/hover */
        background-color: #f1f2f5 !important;
    }

    /* 3. Fix lỗi phần sản phẩm xe đè lên chữ và nút bấm bị khổng lồ */
    .page-id-133 .banner-layers {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 30px 0 0 0 !important;
    }
    .page-id-133 .banner-layers .text-box {
        position: relative !important;
        transform: none !important;
        width: 100% !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    .page-id-133 .text-box .text-inner {
        padding: 0 15px 20px 15px !important;
        text-align: center !important;
    }
    .page-id-133 .banner-text-animate .button {
        width: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px 25px !important;
        border-radius: 50px !important;
        height: auto !important;
        min-height: 42px !important;
        margin-top: 10px !important;
    }

    /* 4. Thu nhỏ logo trên di động để tránh đè vào nội dung/banner */
    .header-main .logo,
    #logo {
        max-width: 110px !important; /* Giảm chiều rộng container logo trên di động */
        transition: all 0.3s ease;
    }
    .header-main .logo img,
    #logo img,
    .header-logo img {
        max-height: 45px !important; /* Giới hạn chiều cao tối đa của ảnh logo */
        height: auto !important;
        object-fit: contain !important;
    }
    .logo a {
        padding: 5px 10px !important; /* Giảm khoảng đệm xung quanh logo */
    }
}
