/*
Theme Name: MONA Theme
Theme URI: https://mona.media
Author: MONA Media
Author URI: https://mona.media
Description: Premium WordPress theme by MONA Media. Mobile-first, accessible, SEO-ready, optimized for Core Web Vitals.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: monamedia
Domain Path: /languages
Tags: ecommerce, woocommerce, block-theme-ready, accessibility-ready, translation-ready, custom-logo, custom-menu, featured-images, sticky-post, threaded-comments
*/

/*
 * The theme header above is required by WordPress.
 * Actual styles are organized in /assets/css/ as modules
 * and enqueued via inc/classes/class-mona-enqueue.php. This file is intentionally
 * kept minimal for clean separation of concerns.
 */

/*
 * WordPress additions to the prototype CSS (assets/css/*.css is the prototype, verbatim).
 * Only what server-rendered markup needs where the prototype used a JS-built element.
 */

/* Pagination and news category chips are real links here (prototype: <button> + JS). */
.pager a { display: grid; place-items: center; min-width: 44px; height: 44px; font: 600 var(--fs-small)/1 var(--body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pager a:hover { color: var(--ink); }
.pager [aria-current] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--accent); }
.pager span.pager__step { opacity: .3; }
.news-cats__chip[aria-current="page"] { background: var(--ink); color: var(--paper); }
.news-cats__chip[aria-current="page"] small { color: var(--paper); opacity: .7; }

/* Messages the server returns on cart / checkout. */
.cart__note, .co__msg { margin: 0 0 20px; padding: 14px 18px; background: var(--tint); color: var(--ink); font-size: var(--fs-small); }
.co__msg { color: var(--danger); }
.cart-row__info form { display: inline; }

/* Order page: the prototype's success popup, laid out as a page. */
.co-done--page { position: static; display: block; max-height: none; overflow: visible; max-width: 560px; margin: 0 auto clamp(40px, 5vw, 80px); }
.co-done__pay { margin-top: 20px; font-size: var(--fs-small); }
.co-done__pay img { max-width: 220px; height: auto; }
.tk-res__ship { margin-top: 16px; font-size: var(--fs-small); }

/* Generic page (no template) and product description. */
.page-text { padding-block: clamp(24px, 3vw, 40px) var(--section-y); }
.page-text .post__body { max-width: 760px; }

/* giỏ hàng: đang gửi đổi số lượng / bỏ mẫu */
.js-cart-region.is-busy .cart__list, .js-cart-region.is-busy .sum { pointer-events: none; opacity: .6; transition: opacity .2s; }

/* liên hệ: lựa chọn (radio / checkbox / đồng ý) do form builder thêm */
.ct-choices { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ct-choices label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ct-choices input { width: auto; height: auto; accent-color: currentColor; }

/* ── Đang tải danh sách (lọc / phân trang AJAX ở danh mục, tìm kiếm, tin tức) ──
   1. thanh vàng mảnh chạy trên đỉnh màn hình (.load-bar, main.js → busy())
   2. thẻ đang hiện mờ đi, vệt sáng quét qua ảnh
   3. kết quả mới: từng thẻ hiện dần, lần lượt (--i do main.js đặt) */
.load-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 2px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease) .15s; }
.admin-bar .load-bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .load-bar { top: 46px; } }
.load-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--accent-grad); box-shadow: 0 0 10px var(--accent); transform: translateX(-100%); }
html.is-fetching .load-bar { opacity: 1; transition-delay: 0s; }
html.is-fetching .load-bar::before { animation: load-run 1.1s cubic-bezier(.45, 0, .2, 1) infinite; }
@keyframes load-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.cat.is-loading .cat__grid, .cat.is-loading .js-cat-pager,
.news-page.is-loading .news-lead, .news-page.is-loading .news-page__grid, .news-page.is-loading .pager { pointer-events: none; }
.cat.is-loading .p-card, .news-page.is-loading .n-card, .news-page.is-loading .news-lead { opacity: .55; transition: opacity .25s var(--ease) .1s; }
.cat.is-loading .p-card__media::after, .news-page.is-loading .n-card__media::after, .news-page.is-loading .news-lead__img::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(247, 225, 181, .32) 50%, transparent 70%);
  background-size: 250% 100%; animation: load-sheen 1.2s linear infinite;
}
.n-card__media, .news-lead__img { position: relative; }
@keyframes load-sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.is-fresh > .p-card, .is-fresh > .n-card, .news-lead.is-fresh { animation: load-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes load-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  html.is-fetching .load-bar::before { animation: none; width: 100%; transform: none; opacity: .6; }
  .cat.is-loading .p-card__media::after, .news-page.is-loading .n-card__media::after, .news-page.is-loading .news-lead__img::after { animation: none; background: none; }
  .is-fresh > .p-card, .is-fresh > .n-card, .news-lead.is-fresh { animation: none; }
}
