/* ==========================================================================
   WINSTORE — WM-005 Winmaker Holding Brand System  (v2 — real DOM)
   Target: EverShop 2.1.1 default theme (shadcn tokens + BEM classes)
   60% nền sáng · 20% forest · 10% gold · 5% crimson · 5% rosegold
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* ---------------------------------------------------- WM-005 design tokens */
:root {
  --wm-forest-900: #041F18;
  --wm-forest-800: #063B2D;
  --wm-forest-700: #0B5A44;
  --wm-emerald:    #10B981;
  --wm-gold:       #B8860B;
  --wm-gold-light: #D4AF37;
  --wm-crimson:    #C60300;
  --wm-rosegold:   #C98A72;
  --wm-bg:         #F5F9F7;
  --wm-cream:      #FFF1EC;
  --wm-line:       #E2EAE6;
  --wm-ink:        #0F1E1A;
  --wm-muted:      #5C6F69;
  --wm-radius:     10px;
  --wm-shadow-sm:  0 4px 14px rgba(4,31,24,.06);
  --wm-shadow-md:  0 12px 30px rgba(4,31,24,.10);
  --wm-shadow-lg:  0 24px 50px rgba(4,31,24,.16);
  --wm-font-head:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --wm-font-body:  'Montserrat', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* --- remap shadcn/theme tokens so every utility flips to WM-005 ---
     !important so this beats the compiled app CSS regardless of load order */
  --radius: 0.625rem !important;
  --background: #FFFFFF !important;
  --foreground: #0F1E1A !important;
  --card: #FFFFFF !important;
  --card-foreground: #0F1E1A !important;
  --popover: #FFFFFF !important;
  --popover-foreground: #0F1E1A !important;
  --primary: #041F18 !important;
  --primary-foreground: #FFFFFF !important;
  --secondary: #F5F9F7 !important;
  --secondary-foreground: #041F18 !important;
  --muted: #F5F9F7 !important;
  --muted-foreground: #5C6F69 !important;
  --accent: #F3E6C4 !important;
  --accent-foreground: #041F18 !important;
  --destructive: #C60300 !important;
  --border: #E2EAE6 !important;
  --divider: #E2EAE6 !important;
  --input: #E2EAE6 !important;
  --ring: #B8860B !important;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: #FFFFFF;
  color: var(--wm-ink);
  font-family: var(--wm-font-body);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--wm-font-head);
  letter-spacing: -0.01em;
  color: var(--wm-forest-900);
}

a { color: var(--wm-forest-700); }
a:hover { color: var(--wm-gold); }

/* page width */
.page-width, .container { max-width: 1240px; margin: 0 auto; }
@media screen and (min-width: 1200px) { .page-width { padding: 0 40px; } }

/* =========================================================================
   HEADER
   ========================================================================= */
.header {
  padding: 0 !important;
  background: #fff;
  border-bottom: 2px solid var(--wm-gold-light);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 6px 24px rgba(4,31,24,.06);
}

/* brand utility strip (header__top is an empty slot — we fill it) */
.header__top {
  display: block;
  background: linear-gradient(90deg, var(--wm-forest-900), var(--wm-forest-700));
  color: #EAF5F0;
  font-size: 12.5px;
}
.header__top::after {
  content: "Hotline 0789 505 808   •   Miễn phí vận chuyển đơn từ 500K   •   Đổi trả 7 ngày   •   Thanh toán COD toàn quốc";
  display: block;
  max-width: 1240px;
  margin: 0 auto;
  padding: 7px 18px;
  letter-spacing: .02em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__middle {
  max-width: 1300px;
  margin: 0 auto;
  padding: 12px 18px !important;
  display: flex !important;
  grid-template-columns: none !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.header__middle__center { order: 1; }
.header__middle__left   { order: 3; flex: 1 1 100%; min-width: 0; overflow: hidden; }
.header__middle__right  { order: 2; margin-left: auto; flex: 0 0 auto; }

/* ---- logo ---- */
.logo { min-width: 0; }
.logo a { display: inline-flex; align-items: center; min-height: 58px; text-decoration: none; }
.logo a::before { content: none; }
.logo img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 240px !important;
  max-height: 60px !important;
  object-fit: contain;
}

/* ---- nav menu ---- */
.header__middle__left nav { width: 100%; padding: 0 !important; }
.header__middle__left nav > div { width: 100%; }
.header__middle__left ul,
.header__middle .header__middle__left ul {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0 2px;
  justify-content: flex-start !important;
  width: 100% !important;
  margin: 0; padding: 3px 0 5px;
  list-style: none;
  overflow: hidden;
}
.header__middle .header__middle__left ul::-webkit-scrollbar { display: none; }
.header__middle__left li { position: relative; flex: 0 0 auto !important; }
.header__middle__left a,
.header__middle__left button {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px !important;
  font-size: 12.6px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  color: var(--wm-forest-900) !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
  transition: background .16s ease, color .16s ease;
}
.header__middle__left a:hover,
.header__middle__left button:hover {
  background: var(--wm-bg) !important;
  color: var(--wm-forest-700) !important;
  text-decoration: none;
}

/* ---- search + icons ---- */
.header__middle__right { gap: 12px !important; }
.header__middle__right form,
.header-search-form { min-width: min(34vw, 380px); }

.header__middle__right input[type='text'],
.header__middle__right input[type='search'],
.search-box input,
.search__box input {
  border: 1.5px solid var(--wm-line) !important;
  border-radius: 999px !important;
  min-height: 44px;
  padding-left: 20px !important;
  background: var(--wm-bg) !important;
  font-family: var(--wm-font-body);
  font-size: 14px;
}
.header__middle__right input:focus,
.search-box input:focus,
.search__box input:focus {
  border-color: var(--wm-gold) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(184,134,11,.14);
  background: #fff !important;
}

.customer-icon a,
.mini-cart-icon,
.mini__cart__wrapper {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--wm-bg);
  color: var(--wm-forest-900);
  border: 1px solid var(--wm-line);
  transition: background .16s ease, color .16s ease;
}
.customer-icon a:hover,
.mini-cart-icon:hover,
.mini__cart__wrapper:hover { background: var(--wm-forest-900); color: var(--wm-gold-light); }

/* =========================================================================
   HERO / SLIDER
   ========================================================================= */
.slide__wrapper { border-radius: 0; }
.slide__image { width: 100%; height: auto; object-fit: cover; }
.slide__content { padding: 40px 28px; }

/* hero text: force dark, consistent & readable over the light WM-005 hero */
.slide__wrapper h1, .slide__wrapper h2, .slide__wrapper .h1, .slide__wrapper .h2,
.slide__content h1, .slide__content h2 {
  color: var(--wm-forest-900) !important;
  font-family: var(--wm-font-head);
  text-shadow: 0 1px 0 rgba(255,255,255,.65);
}
.slide__wrapper p, .slide__wrapper span.slide__subText, .slide__content p {
  color: #2A3A34 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* hero slider CTA buttons: fix dark-on-dark (slide sets inline bg; generic a{color} overrode text-white) */
.slide__wrapper a.inline-block,
.slide__wrapper button.inline-block {
  background: var(--wm-forest-900) !important;
  color: #F3E6C4 !important;
  border: 1.5px solid var(--wm-gold-light) !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
  box-shadow: 0 8px 20px rgba(4,31,24,.22);
  text-shadow: none !important;
}
.slide__wrapper a.inline-block:hover,
.slide__wrapper button.inline-block:hover {
  background: var(--wm-gold) !important;
  color: #FFFFFF !important;
  border-color: var(--wm-gold) !important;
}
.slide__wrapper a.inline-block *,
.slide__wrapper button.inline-block * { color: inherit !important; }

/* hero slider controls → WM-005 */
button[class*="bottom-[20px]"][class*="rounded-full"] {
  background: rgba(4,31,24,.78) !important;
  color: var(--wm-gold-light) !important;
  border: 1px solid rgba(212,175,55,.55) !important;
  transition: background .16s ease, transform .12s ease;
}
button[class*="bottom-[20px]"][class*="rounded-full"]:hover {
  background: var(--wm-forest-900) !important;
  color: #fff !important;
  transform: scale(1.06);
}

/* uniform product image box */
.product__list__image img {
  width: 100% !important;
  height: 232px !important;
  object-fit: contain !important;
  background: #fff;
}

/* =========================================================================
   CONTENT + SECTION HEADINGS
   ========================================================================= */
.content { background: linear-gradient(180deg, var(--wm-bg) 0, #FFFFFF 340px); }
.content h1, .content h2, .content .h1 { color: var(--wm-forest-900); }

/* =========================================================================
   BUTTONS (shadcn + native)
   ========================================================================= */
.button,
button.button,
a.button,
button[type='submit'],
a[class~='bg-primary'],
button[class~='bg-primary'] {
  border-radius: var(--wm-radius) !important;
  font-family: var(--wm-font-body);
  font-weight: 700 !important;
  letter-spacing: .01em;
  transition: transform .12s ease, background .18s ease;
}
.button,
button.button,
a.button,
button[type='submit'] {
  background: var(--wm-gold) !important;
  border-color: var(--wm-gold) !important;
  color: #fff !important;
}
.button:hover,
button.button:hover,
a.button:hover,
button[type='submit']:hover { background: var(--wm-gold-light) !important; color: var(--wm-forest-900) !important; }
.button:active, button[type='submit']:active { transform: translateY(1px); }

/* =========================================================================
   PRODUCT LISTING (category pages)
   ========================================================================= */
.product__grid { gap: 22px !important; }

.product__list__item__inner {
  border: 1px solid var(--wm-line);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--wm-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product__list__item__inner:hover,
.product__list__item:hover .product__list__item__inner {
  transform: translateY(-4px);
  box-shadow: var(--wm-shadow-md);
  border-color: rgba(184,134,11,.4);
}
.product__list__image { background: #fff; padding: 6px; }
.product__list__image img { border-radius: 10px; }
.product__list__info { padding: 0 16px 16px !important; }
.product__list__name {
  font-family: var(--wm-font-body) !important;
  font-weight: 600 !important;
  color: var(--wm-ink);
  line-height: 1.4 !important;
}
.product__list__link:hover .product__list__name { color: var(--wm-forest-700); }
.product__list__price, .regular-price, .price {
  font-weight: 800 !important;
  color: var(--wm-forest-900) !important;
  font-size: 16px;
}
.sale-price, .special-price, .product__list__price .sale { color: var(--wm-crimson) !important; }
.product__list__actions { padding: 0 16px 16px !important; }

/* filters / sorting / pagination */
.product__filters__header, .filter__title { color: var(--wm-forest-900); font-weight: 700; }
.filter__title { font-family: var(--wm-font-head); }
.product-sorting { color: var(--wm-forest-900); }
.price__slider, .price__filter { border-color: var(--wm-line) !important; }
.product-count { color: var(--wm-muted); }
.products-pagination a, .products-pagination span { border-radius: 8px; }
.products-pagination .active, .products-pagination [aria-current='page'] {
  background: var(--wm-forest-900); color: #fff; border-color: var(--wm-forest-900);
}

/* =========================================================================
   PRODUCT DETAIL
   ========================================================================= */
.product__page__middle { padding-top: 24px; }
.product__single__name { font-family: var(--wm-font-head); color: var(--wm-forest-900); font-weight: 800; }
.product__single__price { color: var(--wm-crimson) !important; font-weight: 900; }
.product__single__description { color: var(--wm-ink); line-height: 1.7; }
.product__single__attributes { border-color: var(--wm-line); }
.product__detail__left, .product__detail__right { align-items: flex-start; }
.product-image img, .product-media-container img { border-radius: 12px; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
  margin-top: 64px !important;
  padding: 0 !important;
  background: var(--wm-forest-900) !important;
  border-top: 3px solid var(--wm-gold-light) !important;
  color: #D6E7E0;
}
.footer__middle { display: none !important; }

.footer__bottom { padding: 26px 0 30px; }
.footer__bottom .page-width {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}
.footer__bottom .copyright,
.footer__bottom .copyright span { color: #B9D2C9 !important; font-size: 12.5px; line-height: 1.7; }
.card-icons svg { border-radius: 5px; }
.card-icons path[fill='#fff'] { fill: rgba(255,255,255,.9); }
.footer a { color: #F3E6C4; }
.footer a:hover { color: var(--wm-gold-light); }

/* =========================================================================
   BREADCRUMB
   ========================================================================= */
.breadcrumb, .breadcrumb a { color: var(--wm-muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--wm-gold); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  .header__middle { gap: 10px 16px; }
  .header__middle__left { flex: 1 1 100%; order: 3; }
  .header__middle__right form { min-width: min(50vw, 320px); }
  .footer__bottom .page-width { grid-template-columns: 1fr; text-align: center; }
  .card-icons { justify-content: center !important; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .header__middle { padding: 10px 14px !important; }
  .header__middle__right { order: 3; width: 100%; justify-content: space-between; }
  .header__middle__right form { min-width: 100%; }
  .logo img { max-width: 190px !important; }
  .header__top::after { white-space: normal; font-size: 11.5px; line-height: 1.4; }
  .product__grid { gap: 14px !important; }
}

/* =========================================================================
   WISHLIST (storefront extension) — WM-005
   ========================================================================= */
.wmw-head { display: inline-flex; align-items: center; }
.wmw-head-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--wm-line); color: var(--wm-forest-900);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.wmw-head-btn:hover { background: var(--wm-forest-900); color: var(--wm-gold-light); border-color: var(--wm-forest-900); }
.wmw-count {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wm-crimson); color: #fff; font-size: 10.5px; font-weight: 800;
  border-radius: 999px; border: 2px solid #fff; line-height: 1;
}
.wmw-host { position: relative !important; }
.wmw-heart {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 36px; height: 36px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); color: var(--wm-forest-700);
  border: 1px solid var(--wm-line); box-shadow: 0 4px 12px rgba(4,31,24,.12);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, background .16s ease, color .16s ease;
}
.product__list__item:hover .wmw-heart, .wmw-heart.wmw-on { opacity: 1; transform: none; }
.wmw-heart:hover { background: var(--wm-forest-900); color: var(--wm-gold-light); border-color: var(--wm-forest-900); }
.wmw-heart.wmw-on { background: #fff; color: var(--wm-crimson); border-color: rgba(198,3,0,.35); }
.wmw-heart.wmw-on:hover { background: var(--wm-crimson); color: #fff; }
@media (hover: none) { .wmw-heart { opacity: 1; transform: none; } }

/* product page */
.wmw-pdp { margin: 10px 0 6px; }
.wmw-pdp-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: #fff; color: var(--wm-forest-900); border: 1.5px solid var(--wm-forest-900);
  transition: background .16s ease, color .16s ease;
}
.wmw-pdp-btn:hover { background: var(--wm-forest-900); color: var(--wm-gold-light); }
.wmw-pdp-btn.wmw-on { background: var(--wm-crimson); color: #fff; border-color: var(--wm-crimson); }

/* drawer */
body.wmw-lock { overflow: hidden; }
.wmw-drawer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.wmw-drawer .wmw-backdrop {
  position: absolute; inset: 0; background: rgba(4,31,24,.5);
  opacity: 0; transition: opacity .22s ease;
}
.wmw-drawer .wmw-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw;
  background: #fff; box-shadow: -14px 0 40px rgba(4,31,24,.2);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
}
.wmw-drawer.wmw-open { pointer-events: auto; }
.wmw-drawer.wmw-open .wmw-backdrop { opacity: 1; }
.wmw-drawer.wmw-open .wmw-panel { transform: none; }
.wmw-head2 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; background: var(--wm-forest-900); color: #fff;
}
.wmw-head2 h2 { margin: 0; font-family: var(--wm-font-head); font-size: 18px; font-weight: 700; color: #F3E6C4; }
.wmw-x { background: transparent; border: 0; color: #F3E6C4; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.wmw-x:hover { color: var(--wm-gold-light); }
.wmw-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.wmw-empty { padding: 48px 26px; text-align: center; color: var(--wm-mut); }
.wmw-empty svg { color: var(--wm-line); }
.wmw-empty p { margin: 14px 0 4px; font-weight: 700; color: var(--wm-forest-900); }
.wmw-empty span { font-size: 13px; }
.wmw-row { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--wm-line); }
.wmw-thumb img { width: 60px; height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--wm-line); border-radius: 10px; }
.wmw-meta { flex: 1; min-width: 0; }
.wmw-name {
  display: block; font-weight: 600; font-size: 13.5px; color: var(--wm-forest-900);
  text-decoration: none; line-height: 1.35; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wmw-name:hover { color: var(--wm-gold); }
.wmw-price { margin-top: 4px; font-weight: 800; font-size: 14px; color: var(--wm-crimson); }
.wmw-rm { background: transparent; border: 0; color: #B9C6C0; font-size: 22px; cursor: pointer; line-height: 1; }
.wmw-rm:hover { color: var(--wm-crimson); }
.wmw-foot { padding: 14px 18px; border-top: 1px solid var(--wm-line); }
.wmw-cta {
  display: block; text-align: center; padding: 13px; border-radius: 10px; font-weight: 700;
  background: var(--wm-forest-900); color: #F3E6C4; text-decoration: none; border: 1.5px solid var(--wm-gold-light);
}
.wmw-cta:hover { background: var(--wm-gold); color: #fff; }

/* toast */
#wmw-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 1300;
  background: var(--wm-forest-900); color: #F3E6C4; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; border: 1px solid var(--wm-gold-light);
  box-shadow: 0 10px 30px rgba(4,31,24,.32); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#wmw-toast.wmw-show { opacity: 1; transform: translate(-50%, 0); }

/* wishlist polish: hide CRM FAB while drawer open, badge nudge, toast above FAB */
body.wmw-lock #wmcf-fab,
body.wmw-lock #wmcf-panel,
body.wmw-lock .wmcf-fab { display: none !important; }
.wmw-head-btn { width: 42px; height: 42px; }
.wmw-count { top: -3px; right: -3px; box-shadow: 0 2px 6px rgba(198,3,0,.35); }
#wmw-toast { bottom: 84px; }
