/* ===================== */
/* FOOTER COMPONENT */
/* ===================== */

.footer {
    background: #e5e7eb;
    margin-top: 40px;
    transition: background-color 0.3s ease;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1.35fr 1fr 1.25fr;
    gap: 44px;
}

/* column */
.footer-col {
    min-width: 0;
}

/* brand */
.footer-brand h2 {
    margin: 0 0 10px;
    color: #065f46;
    font-size: 24px;
    font-weight: 800;
    transition: color 0.3s ease;
}

/* text */
.footer-col p {
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.65;
    transition: color 0.3s ease;
}

/* heading */
.footer-col h3,
.footer-social h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    transition: color 0.3s ease;
}

/* ===================== */
/* CATEGORY LIST */
/* ===================== */

.footer-links,
.footer-category-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-category-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 34px;
    row-gap: 9px;
}

.footer-category-links li {
    margin: 0;
    padding: 0;
    line-height: 1.45;
}

.footer-category-links a {
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    line-height: 1.45;
    display: inline-block;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.footer-category-links a:hover {
    color: #065f46;
    text-decoration: underline;
}

/* ===================== */
/* SOCIAL ICONS */
/* ===================== */

.footer-social {
    margin-top: 24px;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.social-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    text-decoration: none;
    border: none;

    box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease,
        opacity 0.2s ease;
}

.social-icon-btn:hover {
    transform: translateY(-3px);
    text-decoration: none;
    filter: brightness(1.08);
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.22);
}

.social-icon-btn img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}

/* TikTok */
.social-icon-btn.tiktok {
    background: #000000;
}

/* Shopee */
.social-icon-btn.shopee {
    background: #ee4d2d;
}

/* LINE */
.social-icon-btn.line {
    background: #06c755;
}

/* Instagram */
.social-icon-btn.instagram {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%);
}

/* ===================== */
/* FOOTER BOTTOM */
/* ===================== */

.footer-bottom {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #d1d5db;
    font-size: 13px;
    color: #374151;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* ===================== */
/* TABLET */
/* ===================== */

@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ===================== */
/* MOBILE */
/* ===================== */

@media (max-width: 768px) {
    .footer {
        margin-top: 45px;
    }

    .footer-container {
        padding: 36px 20px;
        display: grid;
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .footer-col {
        width: 100%;
        min-width: 0;
    }

    .footer-brand h2 {
        font-size: 22px;
    }

    .footer-col p {
        font-size: 14px;
        line-height: 1.75;
    }

    .footer-col h3,
    .footer-social h3 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    /* สำคัญ: มือถือให้หมวดหมู่เป็น 2 คอลัมน์ */
    .footer-category-links {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 36px;
        row-gap: 9px;
        align-items: start;
    }

    .footer-category-links li {
        margin: 0;
        padding: 0;
        line-height: 1.45;
    }

    .footer-category-links a {
        font-size: 14px;
        line-height: 1.45;
        white-space: nowrap;
    }

    .social-icons {
        gap: 10px;
    }

    .social-icon-btn {
        width: 38px;
        height: 38px;
    }

    .social-icon-btn img {
        width: 19px;
        height: 19px;
    }
}

/* ===================== */
/* SMALL MOBILE */
/* ===================== */

@media (max-width: 420px) {
    .footer-container {
        padding: 32px 16px;
    }

    .footer-brand h2 {
        font-size: 22px;
    }

    .footer-col p {
        font-size: 14px;
    }

    .footer-social {
        margin-top: 22px;
    }

    .footer-category-links {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 24px;
        row-gap: 8px;
    }

    .footer-category-links a {
        font-size: 13.5px;
        white-space: normal;
    }

    .social-icon-btn {
        width: 40px;
        height: 40px;
    }

    .social-icon-btn img {
        width: 20px;
        height: 20px;
    }
}

/* ========================================= */
/* 🌙 DARK MODE OVERRIDES */
/* ========================================= */

body.dark .footer {
    background: #0f172a;
}

body.dark .footer-brand h2 {
    color: #10b981;
}

body.dark .footer-col p {
    color: #94a3b8;
}

body.dark .footer-col h3,
body.dark .footer-social h3 {
    color: #f8fafc;
}

body.dark .footer-category-links a {
    color: #cbd5e1;
}

body.dark .footer-category-links a:hover {
    color: #10b981;
}

body.dark .footer-bottom {
    border-top-color: #1e293b;
    color: #64748b;
}

body.dark .social-icon-btn {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

body.dark .social-icon-btn:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
}