/**
 * ===============================
 * CSS VARIABLES
 * ===============================
 */
:root {
    /* Colors */
    --primary: #0d6efd;
    --primary-dark: #0043a8;
    --secondary: #1e40af;
    --secondary-dark: #1e3a8a;
    --success: #198754;
    --danger: #ef4444;
    --warning: #ffc107;

    /* Grays */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Indigo */
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-200: #c7d2fe;
    --indigo-600: #4f46e5;

    /* Blue */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;

    /* Spacing */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 50px;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

/**
 * ===============================
 * TYPOGRAPHY
 * ===============================
 */
.subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary);
}

.main-title {
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.category-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    display: block;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/**
 * ===============================
 * BUTTONS & INTERACTIVE
 * ===============================
 */
.btn-dark-custom {
    background-color: var(--gray-900);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-base);
}

.btn-dark-custom:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-detail {
    border-radius: var(--radius-md);
    padding: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-base);
}

.btn-checkout {
    background-color: var(--blue-600) !important;
    border: none !important;
    padding: 1rem !important;
    font-weight: 600 !important;
    transition: opacity 0.2s !important;
}

.btn-checkout:hover {
    background-color: var(--blue-700) !important;
    color: white !important;
}

.btn-pay {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--blue-600) 100%);
    color: white;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: none;
    width: 100%;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.2s;
    margin-top: 1rem;
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-like {
    background-color: var(--indigo-50) !important;
    color: var(--indigo-600) !important;
}

.btn-like:hover {
    background-color: var(--indigo-100) !important;
}

.btn-share {
    background-color: #fff1f2 !important;
    color: #e11d48 !important;
}

.btn-share:hover {
    background-color: #ffe4e6 !important;
}

/**
 * ===============================
 * FILTER & SEARCH
 * ===============================
 */
.filter-btn {
    border-radius: var(--radius-full);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-base);
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
    margin: 0.25rem;
}

.filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

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

.filter-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.filter-wrapper::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: white;
    border: 1px solid var(--gray-200);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    color: var(--gray-500);
}

.filter-chip.active {
    background: var(--blue-600);
    color: white;
    border-color: var(--blue-600);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.search-container {
    position: relative;
    max-width: 500px;
}

.search-container i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
}

.search-input {
    padding: 14px 14px 14px 50px;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: var(--transition-base);
    font-size: 1rem;
}

.search-input:focus {
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
    border-color: var(--blue-600);
    outline: none;
}

/* ปุ่มค้นหา */
.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-base);
}

/* hover */
.search-btn:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--blue-600);
}

/* focus จาก keyboard */
.search-btn:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
}

/* ขยับ padding input เผื่อปุ่ม */
.search-input {
    padding-right: 64px; /* เผื่อปุ่มด้านขวา */
}


/**
 * ===============================
 * CARDS
 * ===============================
 */
.card-custom {
    border: none;
    border-radius: var(--radius-lg);
    transition: box-shadow 0.3s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-lg) !important;
}

.feature-card {
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 40px;
    transition: var(--transition-base);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

.blog-card,
.article-card {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.blog-card:hover,
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

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

.product-card:hover .icon-box {
    transform: scale(1.1);
}

.service-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: 24px;
    padding: 28px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--blue-100);
}

.service-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.sidebar-card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.contact-card {
    transition: var(--transition-base);
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-lg);
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 0.5rem 1.5rem rgba(13, 110, 253, 0.15);
}

.contact-card.active {
    border-color: var(--primary);
    background-color: #f0f7ff;
    box-shadow: 0 0.5rem 1.5rem rgba(13, 110, 253, 0.2);
    outline: 4px solid rgba(13, 110, 253, 0.1);
}

/**
 * ===============================
 * ICONS & BADGES
 * ===============================
 */
.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.icon-circle {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.icon-blue {
    background-color: var(--blue-50);
    color: var(--blue-600);
}

.icon-indigo {
    background-color: var(--indigo-50);
    color: var(--indigo-600);
}

.icon-slate {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.badge-tech {
    background-color: var(--indigo-100);
    color: var(--indigo-600);
    font-weight: 600;
    padding: 0.5em 1.2em;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.badge-role {
    background-color: #e7f1ff;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.solution-badge {
    background-color: var(--blue-100);
    color: var(--secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.category-badge {
    font-size: 0.85rem;
    background-color: var(--blue-50);
    color: var(--blue-600);
    padding: 2px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.copy-badge {
    cursor: pointer;
    font-size: 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--blue-600);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.playing-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(79, 70, 229, 0.85);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
    white-space: nowrap;
}

/**
 * ===============================
 * LISTS & FEATURES
 * ===============================
 */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    border-top: 1px solid var(--gray-50);
    padding-top: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.expertise-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.expertise-list li {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.expertise-list i {
    color: var(--success);
    margin-right: 0.5rem;
}

/**
 * ===============================
 * HERO & SECTIONS
 * ===============================
 */
.hero-section {
    padding: 100px 0 100px;
}

.hero-header {
    background: linear-gradient(rgba(13, 110, 253, 0.9), rgba(13, 110, 253, 0.9)),
        url('https://images.unsplash.com/photo-1557426272-fc759fdf7a8d?auto=format&fit=crop&q=80&w=1920');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 0;
    margin-bottom: -3rem;
    border-radius: 0 0 2rem 2rem;
    height: 375px;
}

.header-section {
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.cta-section {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border-radius: 0;
}

.cta-section-product {
    background: white;
    border-radius: 2rem;
    padding: 3rem;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-md);
    margin-top: 5rem;
}

.cta-section-contact {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    color: white;
    overflow: hidden;
    position: relative;
}

.cta-section-contact::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.summary-box,
.order-summary {
    background: #203147;
    color: white;
    padding: 2rem;
    border-radius: 16px;
}

/**
 * ===============================
 * STATS & VALUES
 * ===============================
 */
.stat-item {
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    padding-left: 1.5rem;
}

.stat-item h2 {
    font-size: 3rem;
    font-weight: 800;
}

.value-card {
    border-top: 4px solid;
}

.border-blue {
    border-color: var(--primary) !important;
}

.border-green {
    border-color: var(--success) !important;
}

.border-yellow {
    border-color: var(--warning) !important;
}

/**
 * ===============================
 * IMAGES & MEDIA
 * ===============================
 */
.team-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 4px solid rgba(13, 110, 253, 0.2);
}

.author-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 4px solid #f0f2ff;
}

.agent-photo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e9ecef;
}

.agent-photo-sidebar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-md);
}

.img-hover-zoom {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

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

.thumbnail-container {
    position: relative;
    width: 120px;
    flex-shrink: 0;
}

.thumbnail-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.carousel-item img {
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

/**
 * ===============================
 * VIDEO PLAYER
 * ===============================
 */
.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.video-player-wrapper:hover {
    box-shadow: 0 20px 25px -5px rgba(var(--bs-primary-rgb), 0.3);
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.playlist-header {
    background-color: var(--bs-primary);
    color: white;
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.playlist-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
}

.playlist-item:hover {
    background-color: var(--gray-100);
}

.playlist-item.current-video {
    background-color: var(--indigo-50);
    border-color: var(--indigo-200);
}

/**
 * ===============================
 * FORMS & INPUTS
 * ===============================
 */
.input-field {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}

.input-field:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.qty-box {
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.tax-info-section {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    display: none;
}

.tax-info-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/**
 * ===============================
 * SPECIAL ELEMENTS
 * ===============================
 */
.quote-box {
    border-left: 5px solid var(--indigo-600);
    padding: 1.5rem;
    background: #f0f2ff;
    font-style: italic;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin: 2rem 0;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    color: white;
    text-decoration: none;
}

.share-btn:hover {
    transform: scale(1.1);
    color: white;
}

.bg-facebook {
    background-color: #1877f2;
}

.bg-x {
    background-color: #000000;
}

.bg-link {
    background-color: var(--indigo-600);
}

.bank-header {
    background: var(--gray-50);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bank-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: white;
    transition: var(--transition-fast);
}

.step-item {
    text-align: center;
    padding: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--blue-600);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: bold;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.category-accent {
    width: 6px;
    height: 32px;
    background-color: var(--blue-600);
    border-radius: 10px;
}

.map-wrapper {
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid #dee2e6;
    box-shadow: var(--shadow-md);
}

/**
 * ===============================
 * ACCORDION & FAQ
 * ===============================
 */
.faq-accordion .accordion-item {
    border: none;
    margin-bottom: 1rem;
}

.faq-accordion .accordion-button {
    border-radius: var(--radius-md) !important;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background-color: #f0f7ff;
    color: var(--primary);
    box-shadow: none;
}

.faq-item {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.accordion-button:not(.collapsed) {
    background-color: var(--blue-50);
    color: var(--secondary);
}

/**
 * ===============================
 * UTILITIES
 * ===============================
 */
.transition-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.transition-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border: 2px dashed var(--gray-300);
    transition: var(--transition-fast);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.animate-card {
    animation: fadeIn 0.5s ease forwards;
}

.remove-link {
    color: var(--gray-400);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.remove-link:hover {
    color: var(--danger);
}

.read-more-link i {
    transition: transform 0.2s ease;
}

.read-more-link:hover i {
    transform: translateX(5px);
}

.category-link:hover {
    color: var(--primary) !important;
    padding-left: 5px;
    transition: var(--transition-fast);
}

.view-detail {
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue-600);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s ease;
}

.service-card:hover .view-detail {
    gap: 10px;
}

/**
 * ===============================
 * ANIMATIONS
 * ===============================
 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/**
 * ===============================
 * RESPONSIVE
 * ===============================
 */
@media (max-width: 768px) {
    .carousel-item img {
        height: 300px;
    }

    .display-4 {
        font-size: 2.2rem;
    }

    .header-section {
        text-align: center;
    }

    .search-container {
        margin: 1.5rem auto 0;
    }
}

@media (min-width: 992px) {
    .offcanvas-end {
        width: 450px !important;
    }
}

/**
 * ===============================
 * SPECIAL STATES
 * ===============================
*/
#empty-state {
    text-align: center;
    padding: 100px 20px;
    background: white;
    border-radius: 32px;
    border: 2px dashed #e2e8f0;
    margin-top: 2rem;
}