﻿/* =====================================================================
   shop.css - STYLE CHUNG cho mọi trang công khai (trang chủ, khóa học, sản phẩm, đăng nhập)
   Menu, banner, nút, thẻ đều định nghĩa tại đây; các view chỉ dùng class, không gán màu trực tiếp.
   ===================================================================== */
:root {
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --shop-primary: #0077b6; --shop-primary-dark: #023e8a; --shop-amber: #00a8e8;
  --shop-dark: #0b3c6e; --shop-text: #1d2f44; --shop-bg: #f7fbff;
  --soft-sky: #e3f4ff; --soft-aqua: #e0f7fa; --soft-green: #e6fcf5; --soft-indigo: #edf2ff;
}
html { scroll-behavior: smooth; }
body.shop { background: var(--shop-bg); color: var(--shop-text); font-family: var(--bs-body-font-family); -webkit-text-size-adjust: 100%; }
/* Màu liên kết thường dùng biến của Bootstrap (độ ưu tiên thấp) để KHÔNG đè màu chữ của nút / menu */
body.shop { --bs-link-color-rgb: 0, 119, 182; --bs-link-hover-color-rgb: 2, 62, 138; }

/* ---------- Menu (giống nhau trên mọi trang) ---------- */
.navbar.shop-nav { background: linear-gradient(90deg, #023e8a 0%, #0077b6 55%, #00a8e8 100%) !important; box-shadow: 0 2px 12px rgba(0,0,0,.15); padding-top: .55rem; padding-bottom: .55rem; }
.shop-nav .navbar-brand, .shop-nav .shop-brand { color: #fff !important; font-weight: 800; letter-spacing: .2px; display: flex; align-items: center; gap: .55rem; }
.shop-brand img { width: 40px; height: 40px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.25)); }
.shop-footer .brand-img { width: 34px; height: 34px; margin-right: .5rem; vertical-align: middle; }
.shop-nav .nav-link { color: rgba(255,255,255,.95) !important; font-weight: 600; }
.shop-nav .nav-link:hover, .shop-nav .nav-link:focus, .shop-nav .nav-link.show { color: #caf0f8 !important; }
.shop-nav .navbar-toggler { border-color: rgba(255,255,255,.8); }
.shop-nav .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(255,255,255,.35); }
.shop-nav .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
.shop-nav .dropdown-menu { border: 0; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.shop-nav .dropdown-item:hover { background: var(--soft-sky); color: var(--shop-primary-dark); }
.shop-nav .btn-light { color: var(--shop-primary-dark); font-weight: 600; }

/* ---------- Nút / chip ---------- */
.btn-shop, .btn-shop:visited { background: var(--shop-primary); color: #fff; border: 0; font-weight: 600; }
.btn-shop:hover, .btn-shop:focus, .btn-shop:active { background: var(--shop-primary-dark); color: #fff; }
.btn-outline-shop { border: 2px solid var(--shop-primary); color: var(--shop-primary); font-weight: 600; background: transparent; }
.btn-outline-shop:hover { background: var(--shop-primary); color: #fff; }
.btn, .form-control, .form-select { min-height: 40px; }

/* ---------- Banner trang con (mọi trang trừ trang chủ) ---------- */
.page-banner { background: linear-gradient(135deg, #d0ebff 0%, #a5d8ff 55%, #99e9f2 100%); position: relative; overflow: hidden; padding: 1.6rem 0 1.5rem; }
.page-banner::before, .page-banner::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.35); }
.page-banner::before { width: 220px; height: 220px; right: -50px; top: -90px; }
.page-banner::after { width: 140px; height: 140px; left: -40px; bottom: -70px; }
.page-banner .container { position: relative; z-index: 1; }
.page-banner h1 { color: var(--shop-dark); font-weight: 800; font-size: 1.9rem; margin: 0; }
.page-banner p { color: #1b4f7a; margin: .35rem 0 0; max-width: 720px; }

/* ---------- Banner trang chủ ---------- */
.home-hero { background: linear-gradient(135deg, #e3f4ff 0%, #bfe6ff 50%, #aeeaf5 100%); position: relative; overflow: hidden; padding: 2.2rem 0 2.6rem; border-radius: 0 0 36px 36px; }
.home-hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.4); right: -120px; top: -160px; }
.home-hero::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.3); left: -90px; bottom: -120px; }
.home-hero .container { position: relative; z-index: 1; }
.hero-pill { display: inline-block; background: #fff; color: var(--shop-primary-dark); font-weight: 700; border-radius: 999px; padding: .3rem .9rem; font-size: .85rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.hero-title { font-size: 2.5rem; font-weight: 800; line-height: 1.15; color: var(--shop-dark); margin: .8rem 0; }
.hero-title span { color: var(--shop-primary); }
.hero-lead { font-size: 1.1rem; color: #24527d; max-width: 540px; }
.hero-points { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: #24527d; font-weight: 600; font-size: .95rem; }
.hero-points li { display: inline-flex; align-items: center; }
.hero-points li::before { content: ""; display: inline-block; flex: 0 0 auto; width: 1.2em; height: 1.2em; margin-right: .4rem; background: url(../lib/emoji/check-mark-button.svg) center / contain no-repeat; }
.hero-collage { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: .75rem; height: clamp(250px, 40vw, 410px); }
.hc { position: relative; margin: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 22px rgba(2,62,138,.25); border: 4px solid #fff; background: #fff; }
.hc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hc figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92); color: var(--shop-dark); border-radius: 999px; padding: .1rem .65rem; font-size: .8rem; font-weight: 700; }
.hc-main { grid-row: 1 / span 2; transform: rotate(-1.2deg); }
.hc-a { transform: rotate(1.4deg); }
.hc-b { transform: rotate(-.8deg); }

/* ---------- Tiêu đề khu vực ---------- */
.section-title { font-weight: 800; color: var(--shop-dark); }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; background: var(--shop-primary); border-radius: 2px; margin-top: .35rem; }
.link-more { font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ---------- Thẻ sản phẩm / khóa học ---------- */
.p-card { border: 0; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.07); transition: transform .2s, box-shadow .2s; height: 100%; }
.p-card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.p-card .p-img { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: #f1f3f5; }
.course-card .c-img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: #f1f3f5; }
.p-card .p-name { color: var(--shop-text); text-decoration: none; font-weight: 700; }
.p-card .p-name:hover { color: var(--shop-primary); }
.price { color: var(--shop-primary); font-weight: 800; }
.price-lg { font-size: 1.9rem; }
.badge-feature { position: absolute; top: 10px; left: 10px; z-index: 2; }

/* ---------- Khối nền nhạt dùng chung ---------- */
.soft-box { border-radius: 18px; padding: 1rem; }
.soft-sky { background: var(--soft-sky); }
.soft-aqua { background: var(--soft-aqua); }
.soft-green { background: var(--soft-green); }
.soft-indigo { background: var(--soft-indigo); }

/* ---------- Bộ lọc, nhóm ---------- */
.filter-bar .btn { border-radius: 999px; }
.cat-panel .list-group { border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.cat-panel .list-group-item { color: var(--shop-text); }
.cat-panel .list-group-item.active { background: var(--shop-primary); border-color: var(--shop-primary); color: #fff; }
.pagination .page-link { color: var(--shop-primary); }
.pagination .page-item.active .page-link { background: var(--shop-primary); border-color: var(--shop-primary); color: #fff; }

/* ---------- Trang chi tiết ---------- */
.gallery-main { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; background: #f1f3f5; }
.gallery-strip { display: flex; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-thumb { flex: 0 0 auto; width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.gallery-thumb.active { border-color: var(--shop-primary); }
.desc-text { white-space: pre-line; }
.info-grid dt { color: #868e96; font-weight: 500; font-size: .85rem; }
.info-grid dd { margin-bottom: .6rem; font-weight: 600; }
.objective-list li { margin-bottom: .35rem; }
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #cfe8f7; box-shadow: 0 -4px 14px rgba(0,0,0,.08); display: flex; gap: .6rem; align-items: center; }
.mobile-cta .price { font-size: 1.1rem; white-space: nowrap; }
body.has-cta { padding-bottom: 76px; }

/* ---------- Đăng nhập ---------- */
.auth-card { max-width: 420px; margin: 2rem auto; border: 0; border-radius: 20px; box-shadow: 0 8px 28px rgba(2,62,138,.18); overflow: hidden; }
.auth-card .auth-head { background: linear-gradient(135deg, #a5d8ff, #99e9f2); padding: 1.2rem; text-align: center; color: var(--shop-dark); font-weight: 800; font-size: 1.2rem; }

/* ---------- Chân trang ---------- */
.shop-footer { background: #052a52; color: #d4e9f7; }
.shop-footer a { color: #90e0ef; }

/* ---------- Điện thoại / máy tính bảng ---------- */
#mobileSearch .form-control, #mobileSearch .btn { min-height: 44px; }
@media (max-width: 991.98px) {
  .shop-nav .navbar-collapse { padding: .4rem 0 .6rem; }
  .shop-nav .nav-link { padding: .6rem 0; font-size: 1.05rem; }
  .shop-nav .dropdown-menu { background: #fff8f0; box-shadow: none; }
  .hero-title { font-size: 2rem; }
  .home-hero { border-radius: 0 0 28px 28px; padding-top: 1.4rem; }
}
@media (max-width: 575.98px) {
  .hero-title { font-size: 1.65rem; }
  .hero-lead { font-size: 1rem; }
  .hero-collage { height: 230px; gap: .5rem; }
  .hc { border-width: 3px; border-radius: 16px; }
  .hc figcaption { font-size: .7rem; }
  .page-banner { padding: 1.1rem 0; }
  .page-banner h1 { font-size: 1.45rem; }
  .section-title { font-size: 1.25rem; }
  .p-card .card-body { padding: .6rem; }
  .p-card .p-name { font-size: .92rem; }
  .p-card .badge { font-size: .65rem; }
  .price-lg { font-size: 1.5rem; }
  .container { padding-left: .85rem; padding-right: .85rem; }
}
.auth-head { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.auth-logo { background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
/* Hộp nhập kết quả trên điện thoại: ô nhận xét và danh sách mẫu chiếm gần hết màn hình */
@media (max-width: 991.98px) { #resNotes { min-height: 38vh; } .tpl-list { max-height: 58vh; } .res-switch .btn { padding: .55rem .5rem; } #resModal .modal-footer { position: sticky; bottom: 0; background: #fff; } }

/* Nhóm khóa học / nhóm sản phẩm: ô biểu tượng trên trang chủ và danh sách */
.cat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.cat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .45rem; padding: .9rem .6rem; border-radius: 16px; background: #fff; border: 1px solid #d0ebff; text-decoration: none; color: #1b3a57; box-shadow: 0 2px 8px rgba(2, 62, 138, .06); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(2, 62, 138, .14); color: #0b5394; }
.cat-tile .ci { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e7f5ff, #c5f6fa); }
.cat-tile .ci .emo { width: 38px; height: 38px; }
.cat-tile b { font-size: .9rem; line-height: 1.2; }
.cat-ico { width: 1.45em; height: 1.45em; vertical-align: -.35em; margin-right: .3rem; }
.list-group-item .emo { margin-right: .4rem; width: 1.5em; height: 1.5em; vertical-align: -.4em; }
.page-banner .cat-big { width: 1.35em; height: 1.35em; vertical-align: -.25em; margin-right: .4rem; }
@media (max-width: 575.98px) { .cat-strip { grid-template-columns: repeat(3, 1fr); } .cat-tile .ci { width: 52px; height: 52px; } .cat-tile .ci .emo { width: 30px; height: 30px; } .cat-tile b { font-size: .78rem; } }
