/*
Theme Name: DK Harvest
Theme URI: https://dkharvest.com
Author: DevTran
Author URI: https://dkharvest.com
Description: Theme bán hàng cho DK Harvest — hạt dinh dưỡng thuần tự nhiên. Header & footer theo bộ nhận diện DK Harvest.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dk-harvest
*/

/* ============================================================
   0. BIẾN & RESET
   ============================================================ */
:root {
    --dk-cream:      #FBF4E4;   /* nền header */
    --dk-cream-2:    #FCF8EE;
    --dk-orange:     #E4A02A;   /* màu thương hiệu */
    --dk-orange-d:   #C9861A;
    --dk-brown:      #3A2A1B;   /* nền footer */
    --dk-brown-2:    #2C2013;
    --dk-brown-line: #55402c;
    --dk-ink:        #2B2622;   /* chữ chính */
    --dk-muted:      #7d7266;
    --dk-cream-soft: #efe2c8;   /* chữ mờ trên nền nâu */
    --dk-radius:     12px;
    --dk-maxw:       1200px;
    --dk-font:       'Be Vietnam Pro', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --dk-serif:      'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.dk-body {
    margin: 0;
    font-family: var(--dk-font);
    color: var(--dk-ink);
    background: #fff;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.dk-body a { color: inherit; text-decoration: none; }
.dk-body img { max-width: 100%; height: auto; display: block; }
.dk-container { max-width: var(--dk-maxw); margin: 0 auto; padding: 0 24px; }

.dk-skip-link {
    position: absolute; left: -9999px; top: 0; background: #fff; padding: 10px 16px;
    border-radius: 8px; z-index: 1000;
}
.dk-skip-link:focus { left: 12px; top: 12px; }

/* ============================================================
   1. HEADER
   ============================================================ */
.dk-header {
    position: sticky; top: 0; z-index: 500;
    background: var(--dk-cream);
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.dk-header__inner {
    display: flex; align-items: center; gap: 28px;
    min-height: 78px;
}

/* --- Logo --- */
.dk-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.dk-logo img { width: 64px; height: 64px; border-radius: 50%; object-fit: contain; }
.dk-logo__text { line-height: 1; }
.dk-logo__text b {
    font-family: var(--dk-serif); font-size: 20px; font-weight: 700;
    letter-spacing: .5px; color: var(--dk-ink); display: block;
}
.dk-logo__text span { font-size: 11px; color: var(--dk-muted); letter-spacing: .3px; }

/* --- Nav --- */
.dk-nav { flex: 1; }
.dk-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; gap: 30px; justify-content: center;
}
.dk-menu > li { position: relative; }
.dk-menu > li > a {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 15px; font-weight: 500; color: var(--dk-ink);
    padding: 8px 0; position: relative; transition: color .18s;
}
.dk-menu > li > a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
    background: var(--dk-orange); transition: right .22s ease;
}
.dk-menu > li:hover > a,
.dk-menu > li.current-menu-item > a,
.dk-menu > li.current_page_item > a { color: var(--dk-orange-d); }
.dk-menu > li:hover > a::after,
.dk-menu > li.current-menu-item > a::after,
.dk-menu > li.current_page_item > a::after { right: 0; }

.dk-menu .dk-caret { width: 10px; height: 10px; opacity: .6; }

/* Dropdown */
.dk-menu .sub-menu,
.dk-menu .dk-submenu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
    min-width: 210px; background: #fff; border-radius: 12px; padding: 8px;
    box-shadow: 0 16px 40px rgba(60,40,10,.16); list-style: none; margin: 0;
    opacity: 0; visibility: hidden; transition: .2s; z-index: 10;
}
.dk-menu > li:hover .sub-menu,
.dk-menu > li:hover .dk-submenu,
.dk-menu > li:focus-within .sub-menu,
.dk-menu > li:focus-within .dk-submenu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.dk-menu .sub-menu a,
.dk-menu .dk-submenu a {
    display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px;
    color: var(--dk-ink); transition: background .15s, color .15s; white-space: nowrap;
}
.dk-menu .sub-menu a:hover,
.dk-menu .dk-submenu a:hover { background: var(--dk-cream); color: var(--dk-orange-d); }

/* --- Actions (icons) --- */
.dk-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dk-icon-btn {
    width: 42px; height: 42px; border: 0; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    color: var(--dk-ink); position: relative; transition: background .16s, color .16s;
}
.dk-icon-btn:hover { background: rgba(228,160,42,.14); color: var(--dk-orange-d); }
.dk-icon-btn svg { width: 22px; height: 22px; }
.dk-cart__badge {
    position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--dk-orange); color: #fff; border-radius: 999px; font-size: 11px;
    font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

/* --- Search bar (toggle) --- */
.dk-search { display: none; border-top: 1px solid rgba(0,0,0,.06); background: var(--dk-cream-2); }
.dk-search.is-open { display: block; }
.dk-search form { display: flex; gap: 10px; padding: 14px 0; }
.dk-search input[type="search"] {
    flex: 1; border: 1px solid #e2d7bf; background: #fff; border-radius: 10px;
    padding: 12px 16px; font: inherit; font-size: 15px; outline: none;
}
.dk-search input[type="search"]:focus { border-color: var(--dk-orange); }
.dk-search button {
    border: 0; background: var(--dk-orange); color: #fff; font-weight: 600;
    padding: 0 22px; border-radius: 10px; cursor: pointer;
}

/* --- Hamburger --- */
.dk-burger { display: none; }

/* ============================================================
   2. NEWSLETTER BAND
   ============================================================ */
.dk-newsletter { background: var(--dk-orange); color: #fff; }
.dk-newsletter__inner {
    display: flex; align-items: center; gap: 24px; padding: 24px 0; flex-wrap: wrap;
}
.dk-newsletter__icon {
    width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dk-newsletter__icon svg { width: 26px; height: 26px; }
.dk-newsletter__text { flex: 1; min-width: 220px; }
.dk-newsletter__text b { font-size: 18px; display: block; }
.dk-newsletter__text span { font-size: 13.5px; opacity: .92; }
.dk-newsletter form { display: flex; gap: 10px; flex: 1; min-width: 280px; max-width: 460px; }
.dk-newsletter input[type="email"] {
    flex: 1; border: 0; border-radius: 10px; padding: 13px 16px; font: inherit; font-size: 14px;
}
.dk-newsletter button {
    border: 0; background: var(--dk-brown); color: #fff; font-weight: 600; font-size: 14px;
    padding: 0 24px; border-radius: 10px; cursor: pointer; white-space: nowrap;
    transition: background .16s;
}
.dk-newsletter button:hover { background: var(--dk-brown-2); }

/* ============================================================
   3. FOOTER
   ============================================================ */
.dk-footer {
    background: var(--dk-brown);
    color: var(--dk-cream-soft);
    font-size: 14px;
}
.dk-footer a { color: var(--dk-cream-soft); transition: color .15s; }
.dk-footer a:hover { color: var(--dk-orange); }

.dk-footer__top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
    gap: 40px;
    padding: 54px 0 40px;
}
.dk-footer__brand .dk-logo__text b { color: #fff; }
.dk-footer__brand .dk-logo__text span { color: var(--dk-orange); }
.dk-footer__brand .dk-logo img {
    background: var(--dk-orange); padding: 0;
}
.dk-footer__desc { margin: 16px 0 18px; line-height: 1.7; max-width: 320px; opacity: .9; }

.dk-social { display: flex; gap: 10px; }
.dk-social a {
    width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .18s, transform .18s;
}
.dk-social a:hover { background: var(--dk-orange); transform: translateY(-2px); }
.dk-social svg { width: 18px; height: 18px; fill: #fff; }

.dk-footer__col h4 {
    color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .6px;
    text-transform: uppercase; margin: 4px 0 18px;
}
.dk-footer__col ul { list-style: none; margin: 0; padding: 0; }
.dk-footer__col li { margin-bottom: 11px; }

.dk-contact li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; line-height: 1.5; }
.dk-contact svg { width: 17px; height: 17px; fill: var(--dk-orange); flex-shrink: 0; margin-top: 3px; }

.dk-footer__bottom {
    border-top: 1px solid var(--dk-brown-line);
    padding: 20px 0; text-align: center; font-size: 13px; color: #bdae99;
}

/* ============================================================
   4. RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
    .dk-footer__top { grid-template-columns: 1fr 1fr; gap: 34px; }
}
@media (max-width: 900px) {
    .dk-header__inner { min-height: 66px; gap: 14px; }
    .dk-logo img { width: 52px; height: 52px; }
    .dk-burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 42px; height: 42px; border: 0; background: transparent; cursor: pointer;
        color: var(--dk-ink); order: 3;
    }
    .dk-burger svg { width: 26px; height: 26px; }
    .dk-nav {
        position: absolute; top: 100%; left: 0; right: 0; background: var(--dk-cream);
        border-bottom: 1px solid rgba(0,0,0,.08); box-shadow: 0 18px 30px rgba(0,0,0,.08);
        max-height: 0; overflow: hidden; transition: max-height .28s ease; flex: 0 0 100%;
    }
    .dk-nav.is-open { max-height: 80vh; overflow-y: auto; }
    .dk-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
    .dk-menu > li > a { padding: 13px 24px; }
    .dk-menu > li > a::after { display: none; }
    .dk-menu .sub-menu, .dk-menu .dk-submenu {
        position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none;
        background: transparent; padding: 0 0 6px 24px; min-width: 0;
    }
    .dk-menu .sub-menu a, .dk-menu .dk-submenu a { padding: 8px 24px; }
    .dk-actions { margin-left: auto; }
}
@media (max-width: 620px) {
    .dk-container { padding: 0 16px; }
    .dk-footer__top { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 30px; }
    .dk-logo__text span { display: none; }
    .dk-newsletter__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   5. TRANG CHỦ
   ============================================================ */

/* --- Nút chung --- */
.dk-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 15px; border-radius: 10px;
    padding: 13px 26px; cursor: pointer; transition: .18s;
}
.dk-btn--primary { background: var(--dk-orange); color: #fff; }
.dk-btn--primary:hover { background: var(--dk-orange-d); transform: translateY(-1px); }
.dk-btn--outline { background: #fff; color: var(--dk-ink); border: 1.5px solid #d8cbae; }
.dk-btn--outline:hover { border-color: var(--dk-orange); color: var(--dk-orange-d); }

/* --- Placeholder khi chưa upload ảnh --- */
.dk-ph {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; min-height: 180px;
    background: linear-gradient(135deg, #f0e3c8 0%, #e2cba0 55%, #cfa96b 100%);
    color: rgba(90,60,20,.55); border-radius: inherit;
}
.dk-ph svg { width: 54px; height: 54px; }

/* --- Tiêu đề section chung --- */
.dk-sec-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; margin-bottom: 26px;
}
.dk-sec-head h2, .dk-story h2, .dk-reviews > .dk-container > h2 {
    font-family: var(--dk-serif); font-size: 30px; font-weight: 700;
    color: var(--dk-ink); margin: 0;
}
.dk-sec-link { font-size: 14px; font-weight: 600; color: var(--dk-orange-d); white-space: nowrap; }
.dk-sec-link:hover { color: var(--dk-brown); }

/* --- 1. Hero --- */
.dk-hero { background: linear-gradient(120deg, #FBF4E4 0%, #F8ECD2 60%, #F3DFB6 100%); }
.dk-hero__grid {
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px;
    align-items: center; padding-top: 56px; padding-bottom: 56px;
}
.dk-hero__text h1 {
    font-family: var(--dk-serif); font-size: 46px; line-height: 1.18;
    color: var(--dk-ink); margin: 0 0 18px; font-weight: 700;
}
.dk-hero__text p { font-size: 17px; color: #5d5548; max-width: 460px; margin: 0 0 26px; }
.dk-hero__btns { display: flex; gap: 14px; flex-wrap: wrap; }
.dk-hero__badges {
    list-style: none; display: flex; gap: 26px; flex-wrap: wrap;
    margin: 34px 0 0; padding: 0; font-size: 13.5px; color: #5d5548; font-weight: 500;
}
.dk-hero__badges li { display: flex; align-items: center; gap: 7px; }
.dk-hero__badges svg { width: 18px; height: 18px; color: var(--dk-orange-d); }
.dk-hero__media img, .dk-hero__media .dk-ph {
    border-radius: 18px; width: 100%; aspect-ratio: 7/5; object-fit: cover;
    box-shadow: 0 24px 50px rgba(120,85,20,.18);
}

/* --- 2. Danh mục --- */
.dk-cats { background: var(--dk-cream-2); padding: 44px 0; }
.dk-cats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.dk-cat {
    position: relative; border-radius: 14px; overflow: hidden; display: block;
    aspect-ratio: 1/0.92; box-shadow: 0 8px 22px rgba(80,55,15,.12);
    transition: transform .2s;
}
.dk-cat:hover { transform: translateY(-4px); }
.dk-cat__img, .dk-cat > .dk-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.dk-cat__overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    justify-content: flex-end; padding: 18px;
    background: linear-gradient(180deg, rgba(30,18,5,0) 40%, rgba(30,18,5,.78) 100%);
    color: #fff;
}
.dk-cat__overlay b { font-family: var(--dk-serif); font-size: 21px; }
.dk-cat__overlay small { font-size: 12.5px; opacity: .9; margin-top: 3px; }
.dk-cat__arrow {
    position: absolute; right: 14px; bottom: 14px; width: 30px; height: 30px;
    border-radius: 50%; background: var(--dk-orange); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.dk-cat__arrow svg { width: 15px; height: 15px; }

/* --- 3. Sản phẩm --- */
.dk-products { background: var(--dk-cream-2); padding: 28px 0 56px; }
.dk-products__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.dk-product {
    background: #fff; border-radius: 14px; padding: 16px;
    box-shadow: 0 6px 18px rgba(80,55,15,.08); text-align: center;
    display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.dk-product:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(80,55,15,.14); }
.dk-product__media { display: block; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.dk-product__media img, .dk-product__media .dk-ph { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.dk-product h3 { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; color: var(--dk-ink); }
.dk-product h3 a:hover { color: var(--dk-orange-d); }
.dk-product p { font-size: 12.5px; color: var(--dk-muted); margin: 0 0 10px; flex: 1; }
.dk-product__price { font-size: 18px; font-weight: 800; color: var(--dk-ink); margin-bottom: 12px; }
.dk-btn--cart {
    background: var(--dk-orange); color: #fff; justify-content: center;
    font-size: 13.5px; padding: 11px 10px; width: 100%;
}
.dk-btn--cart:hover { background: var(--dk-orange-d); }
.dk-btn--cart svg { width: 16px; height: 16px; }

/* --- 4. Ưu điểm --- */
.dk-usp { background: var(--dk-cream-2); padding: 0 0 52px; }
.dk-usp__grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
    background: #fff; border-radius: 16px; padding: 26px 28px;
    box-shadow: 0 6px 18px rgba(80,55,15,.07);
}
.dk-usp__item { display: flex; gap: 13px; align-items: flex-start; }
.dk-usp__icon {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
    background: rgba(228,160,42,.14); color: var(--dk-orange-d);
    display: flex; align-items: center; justify-content: center;
}
.dk-usp__icon svg { width: 23px; height: 23px; }
.dk-usp__item b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.dk-usp__item small { font-size: 12px; color: var(--dk-muted); line-height: 1.5; }

/* --- 5. Câu chuyện --- */
.dk-story { background: #fff; padding: 60px 0; }
.dk-story__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 46px; align-items: center; }
.dk-story h2 { margin-bottom: 18px; }
.dk-story p { color: #5d5548; font-size: 15px; line-height: 1.75; margin: 0 0 14px; }
.dk-story .dk-btn { margin-top: 10px; }
.dk-story__media img, .dk-story__media .dk-ph {
    border-radius: 18px; width: 100%; aspect-ratio: 8/5; object-fit: cover;
    box-shadow: 0 20px 44px rgba(120,85,20,.16);
}

/* --- 6. Đánh giá & cam kết --- */
.dk-reviews { background: var(--dk-cream-2); padding: 56px 0; }
.dk-reviews h2 { margin-bottom: 26px; }
.dk-reviews__grid { display: grid; grid-template-columns: 1fr 1fr 1fr 0.9fr; gap: 20px; align-items: start; }
.dk-review {
    background: #fff; border-radius: 14px; padding: 22px;
    box-shadow: 0 6px 18px rgba(80,55,15,.07);
}
.dk-review__stars { color: var(--dk-orange); font-size: 16px; letter-spacing: 2px; margin-bottom: 10px; }
.dk-review p { font-size: 13.5px; color: #4d463c; line-height: 1.65; margin: 0 0 14px; }
.dk-review__who { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--dk-ink); }
.dk-review__avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--dk-orange);
    color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.dk-commit {
    background: #fff; border: 1.5px solid rgba(228,160,42,.5); border-radius: 14px;
    padding: 22px; box-shadow: 0 6px 18px rgba(80,55,15,.07);
}
.dk-commit h3 { font-size: 15px; font-weight: 800; margin: 0 0 16px; color: var(--dk-ink); }
.dk-commit__item {
    display: flex; align-items: center; gap: 11px; font-size: 13.5px; font-weight: 500;
    padding: 10px 0; border-bottom: 1px dashed #eee3cc; color: #4d463c;
}
.dk-commit__item:last-child { border-bottom: 0; }
.dk-commit__item svg { width: 21px; height: 21px; color: var(--dk-orange-d); flex-shrink: 0; }

/* --- 7. Bài viết --- */
.dk-blog { background: var(--dk-cream-2); padding: 8px 0 60px; }
.dk-blog__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.dk-post {
    background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 6px 18px rgba(80,55,15,.08); transition: transform .2s, box-shadow .2s;
}
.dk-post:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(80,55,15,.14); }
.dk-post__media { position: relative; display: block; }
.dk-post__media img, .dk-post__media .dk-ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 0; }
.dk-post__cat {
    position: absolute; left: 12px; bottom: 12px; background: var(--dk-orange);
    color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .4px;
    text-transform: uppercase; padding: 5px 10px; border-radius: 6px;
}
.dk-post h3 { font-size: 15.5px; font-weight: 700; line-height: 1.45; margin: 0; padding: 16px 18px 6px; color: var(--dk-ink); }
.dk-post:hover h3 { color: var(--dk-orange-d); }
.dk-post__more { font-size: 13px; font-weight: 600; color: var(--dk-orange-d); padding: 0 18px 18px; margin-top: auto; }

/* --- Responsive trang chủ --- */
@media (max-width: 980px) {
    .dk-hero__grid { grid-template-columns: 1fr; gap: 30px; padding-top: 40px; padding-bottom: 40px; }
    .dk-hero__text h1 { font-size: 36px; }
    .dk-cats__grid, .dk-products__grid { grid-template-columns: repeat(2, 1fr); }
    .dk-usp__grid { grid-template-columns: repeat(2, 1fr); }
    .dk-story__grid { grid-template-columns: 1fr; gap: 28px; }
    .dk-reviews__grid { grid-template-columns: 1fr 1fr; }
    .dk-blog__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .dk-hero__text h1 { font-size: 30px; }
    .dk-cats__grid, .dk-products__grid, .dk-usp__grid,
    .dk-reviews__grid, .dk-blog__grid { grid-template-columns: 1fr; }
    .dk-sec-head { flex-direction: column; gap: 6px; }
    .dk-sec-head h2 { font-size: 24px; }
}
