/* =========================================================================
   KỀM BẾN THÀNH — design tokens
   Ý tưởng: vàng (--gold) đại diện cho sự cao cấp/hoàn thiện, thép (--steel)
   đại diện cho chất liệu lưỡi kềm. Hai tông màu giao nhau theo đường chéo
   135deg xuyên suốt trang là chữ ký thị giác (mô phỏng một đường "cắt").
   ========================================================================= */
:root {
    --ink: #17140f;
    --ink-soft: #3a342a;
    --paper: #faf7f2;
    --cream: #f4ecdb;
    --line: #e7e0d1;

    --gold: #b8863d;
    --gold-light: #e3bd76;
    --gold-dark: #8a5f24;

    --steel: #45565f;
    --steel-light: #7c94a0;
    --steel-dark: #263239;

    --dark: var(--ink);

    --font-display: 'Playfair Display', 'Be Vietnam Pro', serif;
    --font-body: 'Be Vietnam Pro', sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 10px rgba(23, 20, 15, .06);
    --shadow-md: 0 14px 34px rgba(23, 20, 15, .10);
    --shadow-gold: 0 14px 34px rgba(184, 134, 61, .28);
    --cut: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 45%, var(--steel) 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink-soft);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { color: inherit; }

h1, h2, h3, h4, .brand, .admin-brand {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -.01em;
}

::selection { background: var(--gold-light); color: var(--ink); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Topbar ---- */
.topbar { background: var(--ink); color: #cfc9bd; font-size: .8rem; letter-spacing: .01em; }
.topbar-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding: 8px 0; }
.topbar-social { display: flex; gap: 16px; }
.topbar-social a { color: #cfc9bd; text-decoration: none; font-size: .85rem; transition: color .15s ease; }
.topbar-social a:hover { color: var(--gold-light); }

/* ---- Main nav ---- */
.main-nav {
    background: rgba(250, 247, 242, .92);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(23,20,15,.03);
    padding-top: 4px;
    padding-bottom: 4px;
}
.brand {
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--ink) !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.brand span {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.admin-link { color: var(--gold-dark) !important; font-weight: 600; }

.main-nav .nav-link {
    position: relative;
    color: var(--ink-soft) !important;
    font-weight: 500;
    padding: .55rem .6rem !important;
    transition: color .15s ease;
    white-space: nowrap;
}
.main-nav .navbar-nav { flex-wrap: nowrap; }
@media (min-width: 992px) {
    .main-nav .navbar-collapse { flex-wrap: nowrap; }
    .main-nav form.d-flex { flex: 0 1 200px; }
    .main-nav form input.form-control { min-width: 0; }
}
.main-nav .nav-link::after {
    content: "";
    position: absolute;
    left: .85rem; right: .85rem; bottom: .3rem;
    height: 2px;
    background: var(--cut);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}
.main-nav .nav-link:hover { color: var(--ink) !important; }
.main-nav .nav-link:hover::after { transform: scaleX(1); }
.main-nav .navbar-nav .dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 8px; }
.main-nav .dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.main-nav .dropdown-item:hover { background: var(--cream); }
.main-nav form input.form-control { border-radius: 30px 0 0 30px; border-color: var(--line); }
.main-nav form .btn-gold { border-radius: 0 30px 30px 0; }

/* ---- Buttons ---- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
    background-size: 160% 160%;
    background-position: 0% 0%;
    border: none;
    color: #fff !important;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: var(--shadow-gold);
    transition: background-position .35s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-gold:hover { background-position: 100% 100%; color: #fff; transform: translateY(-2px); box-shadow: 0 18px 38px rgba(184,134,61,.34); }
.btn-gold:active { transform: translateY(0); }
.btn-outline-secondary { border-color: var(--line); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.cart-badge { position: absolute; top: 0; right: -8px; font-size: .65rem; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 78%); overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
    content: "";
    position: absolute;
    top: -20%; right: -8%;
    width: 46%; height: 140%;
    background: var(--cut);
    opacity: .12;
    transform: rotate(12deg);
    pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 72px 0; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 14px; }
.hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--cut); display: inline-block; }
.hero-title { font-size: clamp(2.1rem, 4vw, 3.3rem); font-weight: 700; line-height: 1.1; margin-bottom: 18px; }
.hero-title em { font-style: italic; color: var(--gold-dark); }
.hero-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 28px; }
.hero-cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-link-secondary { font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; transition: color .15s ease, border-color .15s ease; }
.hero-link-secondary:hover { color: var(--gold-dark); border-color: var(--gold-dark); }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1; }
.hero-stat-label { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }
.hero-media { position: relative; }
.hero-media-frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); isolation: isolate; }
.hero-media-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,20,15,0) 55%, rgba(23,20,15,.45) 100%); }
.hero-banner { max-width: 100%; width: 100%; height: 440px; object-fit: cover; display: block; }
.hero-badge-float { position: absolute; bottom: -20px; left: -20px; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 14px 20px; display: flex; align-items: center; gap: 12px; z-index: 2; }
.hero-badge-float .icon { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.hero-badge-float strong { display: block; font-size: .9rem; color: var(--ink); }
.hero-badge-float span { display: block; font-size: .76rem; color: var(--ink-soft); }

@media (max-width: 991px) {
    .hero-inner { grid-template-columns: 1fr; padding: 44px 0; gap: 32px; }
    .hero-banner { height: 300px; }
    .hero-badge-float { left: 12px; bottom: -16px; padding: 10px 14px; }
}

/* =========================================================================
   SECTION TITLES
   ========================================================================= */
.section-title { font-weight: 700; font-size: 1.6rem; margin-bottom: 2rem; padding-left: 0; border-left: none; position: relative; display: inline-block; }
.section-title::after { content: ""; display: block; width: 64px; height: 3px; margin-top: 10px; background: var(--cut); border-radius: 3px; }

.policy-strip { background: transparent; padding-top: 8px; padding-bottom: 8px; }
.policy-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 20px; height: 100%; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.policy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-light); }
.policy-card .policy-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; background: linear-gradient(135deg, var(--cream), #fff); border: 1px solid var(--line); }
.policy-card strong { display: block; font-size: .95rem; color: var(--ink); }
.policy-card .small { color: var(--ink-soft); }

/* =========================================================================
   PRODUCT CARDS
   ========================================================================= */
.product-card { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; position: relative; background: #fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.product-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--cut); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; z-index: 3; }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.product-card:hover::before { transform: scaleX(1); }
.product-card .product-img-wrap { overflow: hidden; }
.product-img { height: 200px; width: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .product-img { transform: scale(1.06); }
.discount-badge { position: absolute; top: 12px; left: 12px; z-index: 4; border-radius: 20px !important; font-weight: 700; padding: 4px 10px; }
.bestseller-badge { position: absolute; top: 12px; right: 12px; z-index: 4; border-radius: 20px !important; font-weight: 700; padding: 4px 10px; }
.price { color: var(--gold-dark); font-weight: 700; font-size: 1.05rem; }
.original-price { text-decoration: line-through; color: #999; margin-left: 6px; font-size: .85rem; }
.product-card .card-title a { transition: color .15s ease; }
.product-card .card-title a:hover { color: var(--gold-dark) !important; }
.product-card .btn-gold { display: flex; align-items: center; justify-content: center; gap: 6px; }

.category-card-link { text-decoration: none; display: block; }
.category-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 240px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease; }
.category-card-link:hover .category-card { box-shadow: var(--shadow-md); }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.category-card-link:hover .category-card img { transform: scale(1.07); }
.category-card-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,20,15,0) 35%, rgba(23,20,15,.82) 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; color: #fff; }
.category-card-overlay .eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); font-weight: 700; margin-bottom: 4px; }
.category-card-overlay h3 { color: #fff; font-weight: 700; margin-bottom: 4px; font-family: var(--font-display); }
.category-card-overlay p { color: #e6e1d6; margin-bottom: 0; font-size: .875rem; }

.category-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.category-pill { padding: 9px 20px; border-radius: 30px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .88rem; transition: all .18s ease; }
.category-pill:hover { border-color: var(--gold); color: var(--gold-dark); transform: translateY(-1px); }
.category-pill.active { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; border-color: transparent; box-shadow: var(--shadow-gold); }

.blog-card-link { text-decoration: none; }
.blog-card { border: 1px solid var(--line) !important; border-radius: var(--radius-md); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.blog-card-link:hover .blog-card { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.blog-card img { height: 180px; object-fit: cover; }
.blog-card .card-title { font-family: var(--font-display); }

.product-detail-img { max-height: 420px; width: 100%; object-fit: cover; border-radius: var(--radius-md); }
.specs-table th { width: 200px; color: var(--ink-soft); font-weight: 600; }
.usage-guide { background: var(--cream); border-radius: var(--radius-sm); padding: 18px; border-left: 3px solid var(--gold); }

.review-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.review-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow-sm); }

.cart-line { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: box-shadow .15s ease; }
.cart-line:hover { box-shadow: var(--shadow-sm); }
.cart-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.cart-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); position: sticky; top: 90px; box-shadow: var(--shadow-sm); }

.checkout-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; }
.payment-options { display: flex; flex-direction: column; gap: 8px; }
.payment-option { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.payment-option:hover { border-color: var(--gold); background: var(--cream); }

.bank-info-box { background: var(--cream); border: 1px dashed var(--gold); border-radius: var(--radius-sm); padding: 16px; }
.shipper-info-box { background: var(--cream); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 12px 16px; }
.bank-info-content { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.bank-qr-img { width: 150px; max-width: 45%; border-radius: 10px; border: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.bank-info-text { flex: 1; min-width: 200px; }
.bank-acc-number { font-weight: 700; color: var(--gold-dark); letter-spacing: .03em; }
.btn-copy { border: 1px solid var(--gold); background: #fff; color: var(--gold-dark); border-radius: 6px; padding: 2px 10px; font-size: .78rem; cursor: pointer; margin-left: 6px; }
.btn-copy:hover { background: var(--gold); color: #fff; }
@media (max-width: 576px) {
    .bank-info-content { flex-direction: column; align-items: center; text-align: center; }
    .bank-qr-img { width: 180px; max-width: 70%; }
}

.order-receipt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); max-width: 600px; box-shadow: var(--shadow-sm); }
.success-icon { font-size: 3rem; }

.track-form { max-width: 600px; }
.order-status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; background: #eee; }
.status-processing { background: #fff3cd; color: #856404; }
.status-packaging { background: #cfe2ff; color: #084298; }
.status-delivering { background: #d1e7dd; color: #0f5132; }
.status-received { background: #d4edda; color: #155724; }

.blog-detail { max-width: 800px; }
.blog-detail h1 { font-family: var(--font-display); }
.blog-content p { margin-bottom: 1rem; line-height: 1.8; white-space: pre-wrap; }

.auth-box { max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 34px; box-shadow: var(--shadow-sm); }
.auth-box h3 { font-family: var(--font-display); }

.contact-info { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { background: var(--ink); color: #cfc9bd; margin-top: 70px; position: relative; }
.site-footer::before { content: ""; display: block; height: 4px; background: var(--cut); }
.site-footer h5 { color: #fff; font-family: var(--font-display); font-size: 1.3rem; }
.site-footer h6 { color: #fff; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }
.site-footer p { color: #b9b2a2; }
.site-footer .text-muted { color: #b9b2a2 !important; }
.site-footer hr { border-color: rgba(255,255,255,.12); opacity: 1; }
.site-footer .border-secondary { border-color: rgba(255,255,255,.12) !important; }

.social-links { display: flex; gap: 10px; }
.social-icon { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 1.5rem; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.social-icon:hover { background: var(--gold); transform: translateY(-3px); }

/* ---- Admin ---- */
.admin-body { background: #f4f5f7; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; background: var(--ink); color: #ddd; padding: 24px 16px; flex-shrink: 0; }
.admin-brand { font-weight: 700; margin-bottom: 24px; color: #fff; }
.admin-brand span { color: var(--gold-light); }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { color: #ccc; text-decoration: none; padding: 10px 12px; border-radius: 8px; transition: background .15s ease, color .15s ease; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-content { flex-grow: 1; padding: 32px; }
.admin-stat-card, .admin-panel { background: #fff; border-radius: var(--radius-sm); padding: 20px; border: 1px solid #e5e5e5; box-shadow: var(--shadow-sm); }
.admin-table th { background: #fafafa; }

.feedback-card { border-left: 4px solid #eee; }
.feedback-unread { border-left: 4px solid var(--gold); background: #fffdf6; }

.admin-login-body { background: radial-gradient(circle at 30% 20%, var(--steel-dark), var(--ink) 70%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.admin-login-box { background: #fff; border-radius: var(--radius-md); padding: 36px; width: 380px; box-shadow: var(--shadow-md); }

/* ---- Social Float (cạnh phải màn hình, xếp dọc từ trên xuống) ---- */
.social-float { position: fixed; bottom: 160px; right: 24px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 1040; }
.social-float-btn { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; text-decoration: none; color: #fff; background: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .15s ease, box-shadow .15s ease; }
.social-float-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.social-float-btn.fb { background: #1877f2; }
.social-float-btn.zalo { background: #0068ff; }
.social-float-btn.tiktok { background: #000; }
.social-float-btn.youtube { background: #ff0000; }

/* ---- Chat Widget ---- */
.chat-toggle-btn { position: fixed; bottom: 90px; right: 24px; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #fff; border: none; font-size: 1.5rem; box-shadow: var(--shadow-gold); z-index: 1050; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.chat-toggle-btn:hover { transform: translateY(-3px) scale(1.04); }
.chat-window { position: fixed; bottom: 160px; right: 24px; width: 360px; max-width: 92vw; height: 480px; max-height: 70vh; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-md); display: flex; flex-direction: column; overflow: hidden; z-index: 1050; }
.chat-header { background: var(--ink); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.chat-status { font-size: .7rem; color: #9be89b; }
.chat-messages { flex-grow: 1; overflow-y: auto; padding: 12px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: .875rem; line-height: 1.5; white-space: pre-wrap; }
.chat-bubble.user { align-self: flex-end; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #fff; }
.chat-bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.chat-input-row { display: flex; border-top: 1px solid var(--line); }
.chat-input-row input { flex-grow: 1; border: none; padding: 12px; outline: none; background: #fff; }
.chat-input-row button { border: none; background: var(--gold-dark); color: #fff; width: 50px; transition: background .15s ease; }
.chat-input-row button:hover { background: var(--gold); }

@media (max-width: 576px) {
    .admin-sidebar { display: none; }
    .chat-window { right: 10px; left: 10px; width: auto; }
    .social-float { right: 16px; bottom: 150px; }
    .chat-toggle-btn { right: 16px; }
    .hero-inner { padding: 32px 0; }
}
