:root {
    --primary: #bd1f1f;    
    --dark: #141414;       
    --dark-card: #1f1f1f;  
    --light: #ffffff;      
    --gray: #aaaaaa;       
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
}

body {
    background-color: var(--dark);
    color: var(--light);
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* --- Header --- */
header {
    background-color: rgb(20, 20, 20);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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


.logo img {
    width: 150px;         
    height: auto;         
    display: block;
}

.logo {
    color: var(--light);
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 1px;
}

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


nav ul {
    position: relative;             
    display: flex;
    list-style: none;
    background-color: #161616;
    padding: 6px;
    border-radius: 30px;
    border: 1px solid #252525;
    z-index: 1;                     
}

nav a {
    position: relative;
    display: inline-block;
    color: var(--gray);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    z-index: 3;                     
    transition: color 0.25s ease;
}

nav a:hover,
nav a.active {
    color: #ffffff !important;
}

nav ul::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 105px;                   
    height: calc(100% - 12px);      
    background-color: var(--primary);
    border-radius: 20px;
    z-index: 2;                     
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    transform: translateX(0);       
    pointer-events: none;           
}

nav ul:has(li:nth-child(2) a.active)::before {
    transform: translateX(109px);   
    width: 105px;                   
}

nav ul:has(li:nth-child(3) a.active)::before {
    transform: translateX(218px);   
    width: 105px;
}

nav ul:has(li:nth-child(2) a:hover):not(:has(a.active))::before { transform: translateX(109px); }
nav ul:has(li:nth-child(3) a:hover):not(:has(a.active))::before { transform: translateX(218px); }


.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)), url('images/ploybg.jpg') no-repeat center top/cover;

    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    gap: 5px;
    background-color: var(--primary);
    color: var(--light);
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    width: max-content;
    transition: transform 0.3s, background-color 0.3s;
}

.btn:hover {
    /*transform: scale(1.05);*/
    background-color: #7f060c;
}



.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary);
    padding-left: 1rem;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--light);
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

.car-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    
    gap: 25px;
}

.car-card {
    background-color: rgb(24, 24, 24);
    border-radius: 26px;
    overflow: hidden;
    
    width: 315px; 
    margin: 0 auto; 
    position: relative;
    border: 1px solid #2a2a2a;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                border-color 0.4s ease;
    will-change: transform, box-shadow; 
}

.car-card:hover {
    transform: translateY(-3px); 
    border-color: #ffffff; 

}

.car-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.car-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/*.car-card:hover .car-img-wrapper img {
    transform: scale(1.05);
}*/

.badge {
    position: absolute;
    display: flex;
    gap: 3px;
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 25px;
    text-transform: uppercase;
}

.badge.available { background-color: #000000; color: rgb(255, 255, 255); }
.badge.sold { background-color: #000000; color: white; }
.badge.reserved {
    background-color: rgb(255, 149, 0);
    color: rgb(255, 255, 255);
}

.status-btn.reserved {
    background-color: transparent;
    color: gray;
    /*border: 1px solid rgb(215, 150, 0);*/
}

.status-btn.reserved:hover {
    /*background-color: rgb(215, 150, 0);*/
    color: #ffffff;
}


.car-info {
    padding: 1.5rem;
}

.car-title {
    font-size: 1.0rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    
}

.car-details {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 0.5rem;
}

.car-details span {
    display: inline-flex;  
    align-items: center;   
    gap: 6px;              
    color: var(--gray);
    font-size: 0.8rem;
}
.car-details svg{
    color: var(--gray);

}

.car-price {
    font-size: 1.1rem;
    color: #ffffffe2;
    font-weight: 700;
}


.main-footer {
    background-color: #0c0c0c;          
    border-top: 3px solid var(--primary); 
    color: var(--gray);
    padding-top: 4rem;
    margin-top: 5rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;                    
    gap: 3rem;
    justify-content: space-between;
}

.footer-col {
    flex: 1;
    min-width: 250px;                  
}

.footer-col h3 {
    color: var(--light);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary);
}


.brand-col .brand-desc {
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.links-col ul {
    list-style: none;
    padding: 0;
}

.links-col ul li {
    margin-bottom: 0.8rem;
}

.links-col ul li a {
    color: var(--gray);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

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


.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-contact-item svg {
    color: var(--primary);              
    flex-shrink: 0;
}

.footer-bottom {
    background-color: #060606;
    margin-top: 4rem;
    padding: 1.5rem 0;
    border-top: 1px solid #1a1a1a;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}


.modal {
    display: none; 
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 3px solid #333;
    border-radius: 4px;
}

/* ปุ่มปิด */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--light);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.modal-close:hover { color: var(--primary); }

/* ปุ่มซ้าย-ขวา */
.modal-nav {
    background: rgba(31, 31, 31, 0.8);
    border: 1px solid #333;
    color: var(--light);
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    transition: all 0.3s;
}
.modal-nav:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}
.modal-nav.prev { left: 20px; }
.modal-nav.next { right: 20px; }

.modal-counter {
    position: absolute;
    bottom: 20px;
    color: var(--gray);
    font-size: 1.1rem;
}

.view-images-btn {
    display: block;
    width: 100%;
    background-color: #2a2a2a;
    color: var(--light);
    text-align: center;
    padding: 0.6rem;
    margin-top: 1rem;
    border: 0px solid #ffffff;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}
.view-images-btn:hover {
    background-color: rgb(144, 16, 16);
    border-color: var(--primary);
}

.contact-section {
    background-color: #1a1a1a;
    padding: 4rem 0;
    border-top: 1px solid #2a2a2a;
}

.contact-subtitle {
    color: var(--gray);
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-card {
    text-align: center;
    text-decoration: none;
    color: var(--light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.7rem;
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--primary); 
}

.contact-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.contact-detail {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.contact-action {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--light);
    background-color: var(--primary);
    padding: 0.56rem 1.2rem;
    border-radius: 20px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.contact-card:hover .contact-action {
    background-color: #520004;
    transform: scale(1.0);
}

.phone-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 200px; 
}

.phone-zone {
    width: 100%;
    max-width: 220px;
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.phone-link {
    font-size: 1.1rem;
    color: var(--light);        
    text-decoration: none;      
    font-weight: 600;
    padding: 0.2rem 0;
    transition: color 0.2s ease;
    display: block;
    text-align: center;
}

.phone-link:hover {
    color: var(--primary);
    transform: scale(1.02);     
}

.zone-title {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.contact-card .contact-action {
    width: 100%;
    text-align: center;
    display: block;
}



@media screen and (max-width: 968px) {
    .hero-content h1 {
        font-size: 2.5rem; 
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
}


@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column; 
        gap: 1rem;
        padding: 1rem 0.5rem;
    }
    
    nav ul {
        gap: 1.2rem; 
    }

    nav a {
        font-size: 0.95rem;
    }

    
    .hero {
        height: 50vh; 
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.6rem;
        text-align: center;
        border-left: none; 
        padding-left: 0;
    }

    .filter-buttons {
        justify-content: center; 
        flex-wrap: wrap; 
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        flex: 1 1 auto; 
        text-align: center;
    }

    .car-grid {
        grid-template-columns: 1fr; 
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    
    .modal-content {
        max-width: 95%; 
    }

    .modal-nav {
        font-size: 1.5rem;
        padding: 0.6rem 1rem; 
    }
    
    .modal-nav.prev { left: 5px; }
    .modal-nav.next { right: 5px; }
    
    .modal-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}

@media screen and (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr; 
    }
    
    .contact-card {
        padding: 1.5rem 1rem; 
    }
}

.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)), url('images/ploybg.jpg') no-repeat center center;
    background-attachment: fixed; 
    background-size: cover;
    background-position: center 30%;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
}


.hero-slider-wrapper {
    position: relative;
    height: 70vh; 
    width: 100%;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-track {
    display: flex;
    width: 300%; 
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); 
}

.slide-item {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    
    background-size: cover; 
    background-position: center 25%; 
    
    background-color: var(--dark); 
}


.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 1rem;
}


.hamburger {
    display: none;
    flex-direction: column;
    gap: 8px;                 
    cursor: pointer;
    z-index: 2000;
    padding: 4px;
    transition: transform 0.2s ease;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 2px;              
    background-color: var(--light);
    border-radius: 1px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
}

.hamburger.active span:nth-child(1) {
    width: 16px;              
    background-color: var(--primary);
    transform: translateX(12px); 
}
.hamburger.active span:nth-child(2) {
    opacity: 0;               
}
.hamburger.active span:nth-child(3) {
    width: 22px;              
    background-color: var(--primary);
    transform: translateX(6px);  
}


@media screen and (max-width: 768px) and (max-width: 1024px) {
    
    .header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        position: relative !important;
        padding: 1rem !important;
    }

    .hamburger {
        display: flex;
        order: 1;
        margin-right: auto;
    }

    .logo {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
    }

    
    nav {
        position: fixed;
        top: 0;
        left: -100%;             
        width: 80%;              
        height: 100vh;
        background: rgb(18, 18, 18); 
        border-right: 1px solid rgba(189, 31, 31, 0.3); 
        padding: 7rem 2rem 2rem 2rem;
        transition: left 0.4s cubic-bezier(0.1, 0.9, 0.2, 1); 
        z-index: 1500;
        order: 3;
        display: flex;
        flex-direction: column;
    }

    nav.active {
        left: 0;                 
    }
    nav ul::before {
        display: none !important; 
    }


    nav ul {
        display: flex;
        flex-direction: column;
        background-color: transparent !important; 
        border: none !important;                 
        padding: 0;
        gap: 1rem;
        width: 100%;
    }

    nav ul li {
        width: 100%;
    }

    nav a {
        display: flex !important;
        align-items: center;
        padding: 0.68rem 1.5rem;
        color: #ffffff !important;
        font-size: 0.9rem;
        font-weight: 600;
        text-decoration: none;
        
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 25px;    
        transition: all 0.25s ease;
        text-align: left;
    }

    
    nav a:hover, nav a.active {
        background-color: var(--primary);                        
        color: white !important;               
        transform: translateX(8px);                     
    }
}

/* IPAD */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    
    /* 📸 แก้ไขรูปใน Hero ให้ตึงเต็มตา สมส่วนกับหน้าต่าง iPad ไม่แบนขัดใจ */
    .hero, 
    .hero-slider-wrapper {
        height: 60vh;
    }
    
    .slide-item {
        background-size: cover;
        background-position: center center;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .car-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 1rem;
    }

    .car-card {
        width: 100%; 
        max-width: 100%;
    }

    .car-img-wrapper {
        height: 240px; 
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.dealer-tag {
    position: absolute;
    top: 10px;
    left: 10px; 
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 20px;
    text-transform: uppercase;
    z-index: 10;
}


.dealer-tag.ploywhan {
    background-color: #ad1c1c;
    color: #ffb301;
    border: 1px solid var(--primary);
}

.dealer-tag.station {
    background-color: #ad1c1c;
    color: #ffffff;
    border: 1px solid #444;
}


.contact-phone {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    color: #888; 
}

.contact-phone .phone-title {
    display: inline-flex;     
    align-items: center;      
    gap: 4px;                 
    font-weight: 600;
}

.contact-phone svg {
    display: block;
    width: 20px;              
    height: 20px;             
    flex-shrink: 0;           
}
.back-btn svg{
        display: block;
    width: 20px;              
    height: 20px;             
    flex-shrink: 0;           

}

.status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-btn.available {
    background-color: transparent;
    color: gray;
    border-color: #ffffff00; 
}

.status-btn.available:hover {
    /*background-color: var(--primary);*/
    color: #ffffff;

}

.status-btn.sold {
    /*background-color: #2a2a2a;*/
    color: var(--gray);
    pointer-events: none; 
}

.status-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


#imageModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); 
    display: none;                  
    align-items: center;
    justify-content: center;
}

#imageModal:target {
    display: flex !important;
}

#imageModal img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 4px;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    text-decoration: none;
    z-index: 3100;
}


.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2.5rem 0;
    width: 100%;
}

.page-btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    padding: 0.6rem 1rem;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: #ffffff; 
    color: #000;
}

.page-btn.active {
    background: #b70a0a;
    color: #ffffff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #222;
}