﻿
/* =========================================================
   SÀN GIAO DỊCH NÔNG SẢN VĨNH LONG - DQ CUSTOM STYLE
   File path: Content/css/DQCustomStyle.css
   ========================================================= */

/* ---------------------------------------------------------
   1. RESET & GLOBAL VARIABLES
   --------------------------------------------------------- */
:root {
    --primary-color: #2e7d32; /* Xanh lá tươi nông nghiệp */
    --primary-dark: #1b5e20; /* Xanh lá đậm header/footer */
    --accent-color: #f57c00; /* Cam nổi bật nút bấm/giá */
    --accent-hover: #e65100;
    --text-color: #333333;
    --text-muted: #666666;
    --bg-light: #f4f6f8;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --font-main: 'Segoe UI', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ---------------------------------------------------------
   2. TOP BAR & HEADER
   --------------------------------------------------------- */
.top-bar {
    background-color: var(--primary-dark);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 6px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-contacts span {
    margin-right: 15px;
}

.top-links a {
    color: #e8f5e9;
    margin-left: 12px;
}

    .top-links a:hover {
        color: #ffffff;
        text-decoration: underline;
    }

/* Main Header */
.main-header {
    background-color: #ffffff;
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-img {
    height: 62px; /* Chiều cao tối ưu cho logo tròn */
    width: auto; /* Tự động tính chiều rộng theo tỉ lệ */
    max-width: 65px;
    object-fit: contain; /* Giữ nguyên tỉ lệ ảnh không bị biến dạng */
    display: block;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--accent-color);
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Header Search - Tối ưu kéo dài tối đa */
.header-search {
    flex: 1;
    max-width: 750px; /* Kéo dài thanh tìm kiếm */
}

.search-box {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
    background-color: #ffffff;
    width: 100%;
}

.search-input {
    border: none;
    padding: 10px 18px;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.btn-search {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 28px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.2s;
}

    .btn-search:hover {
        background-color: var(--primary-dark);
    }

/* ---------------------------------------------------------
   3. MAIN NAVIGATION MENU
   --------------------------------------------------------- */
.main-nav {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 14px 20px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .nav-link:hover,
    .nav-item.active .nav-link {
        background-color: var(--primary-dark);
        color: #fffde7;
    }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 10px 15px;
    cursor: pointer;
}

/* ---------------------------------------------------------
   4. HERO BANNER SLIDER
   --------------------------------------------------------- */
.hero-slider {
    position: relative;
    height: 220px;
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.slides-track {
    display: flex;
    width: 300%;
    height: 100%;
    animation: sliderAnim 15s infinite ease-in-out;
}

.slide-item {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@keyframes sliderAnim {
    0%, 28% {
        transform: translateX(0);
    }

    33%, 61% {
        transform: translateX(-33.333%);
    }

    66%, 95% {
        transform: translateX(-66.666%);
    }

    100% {
        transform: translateX(0);
    }
}

.hero-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    color: #ffffff;
    z-index: 2;
}

    .hero-text-overlay h1 {
        font-size: 1.8rem;
        font-weight: 800;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
        margin-bottom: 8px;
    }

    .hero-text-overlay p {
        font-size: 0.98rem;
        max-width: 800px;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
        line-height: 1.5;
    }

/* ---------------------------------------------------------
   5. FEATURES BAR & PRODUCT GRID
   --------------------------------------------------------- */
.features-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.feature-card {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

    .section-title h2 {
        font-size: 1.3rem;
        color: var(--primary-dark);
        text-transform: uppercase;
    }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-body {
    padding: 12px 15px;
}

.product-tag {
    background: #e8f5e9;
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 8px 0;
    color: var(--text-color);
}

.product-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.05rem;
}

.product-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ---------------------------------------------------------
   6. PAGE CONTENT AREA
   --------------------------------------------------------- */
.page-content {
    min-height: 500px;
    padding: 10px 0 30px 0;
}

/* ---------------------------------------------------------
   7. FOOTER
   --------------------------------------------------------- */
.main-footer {
    background-color: #1a301a;
    color: #d1e7dd;
    margin-top: 40px;
    padding-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

    .footer-col h3::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 40px;
        height: 3px;
        background-color: var(--accent-color);
    }

.footer-col ul {
    list-style: none;
}

    .footer-col ul li {
        margin-bottom: 10px;
    }

        .footer-col ul li a {
            color: #c8e6c9;
            font-size: 0.9rem;
        }

            .footer-col ul li a:hover {
                color: #ffffff;
                padding-left: 4px;
            }

.contact-info p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.footer-bottom {
    background-color: #112211;
    text-align: center;
    padding: 15px 0;
    font-size: 0.85rem;
    color: #a3b899;
}

/* ---------------------------------------------------------
   8. NÚT CẤU HÌNH & MODAL POPUP (CẤU HÌNH GIAO DIỆN)
   --------------------------------------------------------- */
.btn-config {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

    .btn-config:hover {
        background: var(--accent-color);
        border-color: var(--accent-color);
        color: #ffffff;
    }

.config-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

    .config-modal-overlay.show {
        display: flex;
    }

.config-modal-card {
    background: #ffffff;
    width: 360px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: configModalFadeIn 0.25s ease-out;
    color: var(--text-color);
}

@keyframes configModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.config-modal-header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
}

.config-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
}

    .config-modal-close:hover {
        opacity: 1;
    }

.config-modal-body {
    padding: 20px;
}

.config-group {
    margin-bottom: 20px;
}

    .config-group:last-child {
        margin-bottom: 0;
    }

.config-label {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-dark);
}

.font-size-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f8e9;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.btn-size {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-size:hover {
        background: var(--primary-color);
        color: #ffffff;
        border-color: var(--primary-color);
    }

.font-size-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.theme-btn {
    border: 2px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

    .theme-btn.active {
        border-color: var(--primary-color);
        background: #e8f5e9;
        color: var(--primary-dark);
    }

/* ---------------------------------------------------------
   9. DARK MODE OVERRIDES
   --------------------------------------------------------- */
body.dark-mode {
    --bg-light: #121212;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
}

    body.dark-mode .main-header,
    body.dark-mode .feature-card,
    body.dark-mode .product-card {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    body.dark-mode .product-title {
        color: #ffffff;
    }

    body.dark-mode .search-box,
    body.dark-mode .search-input {
        background-color: #2a2a2a;
        color: #ffffff;
    }

    body.dark-mode .config-modal-card {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    body.dark-mode .config-label {
        color: #81c784;
    }

    body.dark-mode .font-size-controls {
        background: #2a2a2a;
    }

    body.dark-mode .btn-size {
        background: #333333;
        color: #ffffff;
        border-color: #444444;
    }

    body.dark-mode .theme-btn {
        background: #2a2a2a;
        color: #ffffff;
    }

        body.dark-mode .theme-btn.active {
            background: #1b381e;
            color: #81c784;
            border-color: #81c784;
        }

/* ---------------------------------------------------------
   10. RESPONSIVE (ĐA THIẾT BỊ)
   --------------------------------------------------------- */
@media (max-width: 992px) {
    .header-flex {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        flex: 100%;
        max-width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .menu-toggle {
        display: block;
        width: 100%;
        text-align: left;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-dark);
    }

        .nav-menu.show {
            display: flex;
        }

    .nav-link {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hero-slider {
        height: 170px;
    }

    .hero-text-overlay {
        padding: 0 20px;
    }

        .hero-text-overlay h1 {
            font-size: 1.25rem;
        }

        .hero-text-overlay p {
            font-size: 0.85rem;
        }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* Style riêng cho nút Đăng nhập / Đăng ký trên Top Bar */
.top-links .auth-link {
    color: #fffde7;
    font-weight: 600;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.top-links .auth-link:hover {
    background: var(--accent-color);
    color: #ffffff;
    text-decoration: none;
}


/* =========================================================
   CẤU HÌNH LỀ RESPONSIVE CHO CẢ MÁY TÍNH BẢNG & ĐIỆN THOẠI
   ========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

/* 1. DÀNH CHO MÁY TÍNH BẢNG (TABLET: Màn hình <= 1024px) */
@media (max-width: 1024px) {
    body,
    .main-wrapper,
    .container,
    .container-fluid,
    .main-content-wrapper {
        padding-left: 10px !important; /* Cách lề 10px cho tablet nhìn cân đối */
        padding-right: 10px !important;
    }

    .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }

    .card,
    .vip-enterprise-section,
    .banner-container {
        width: 100% !important;
    }
}

/* 2. DÀNH CHO ĐIỆN THOẠI (MOBILE: Màn hình <= 576px) */
@media (max-width: 576px) {
    body,
    .main-wrapper,
    .container,
    .container-fluid,
    .main-content-wrapper {
        padding-left: 6px !important; /* Cách lề 6px cho màn hình nhỏ */
        padding-right: 6px !important;
    }

    .row {
        margin-left: -3px !important;
        margin-right: -3px !important;
    }
}