/* =====================================================
   MEI BEDDING — components.css
   Floating contacts (Zalo/FB/IG), search overlay, modal generic, toast.
   Extracted from hifi-v2.css sections 19, 20, 21, 22.
   ===================================================== */

/* ---------- 19. Floating contacts (Zalo / FB / IG) ---------- */
.floating-contacts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--z-zalo);
}
.float-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  text-decoration: none;
}
.float-btn:hover {
  transform: translateY(-2px);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.float-btn svg { display: block; }

/* Brand variants — full brand color bg, white icons inside */
.float-btn--zalo { background: #0068ff; }
.float-btn--fb {
  background: linear-gradient(180deg, #00B2FF 0%, #006AFF 100%);
}
.float-btn--ig {
  background: linear-gradient(45deg, #F58529 0%, #DD2A7B 50%, #8134AF 100%);
}

@media (max-width: 767px) {
  .floating-contacts { bottom: 80px; right: 14px; gap: 8px; }
  .float-btn { width: 46px; height: 46px; }
}
/* Legacy class kept for back-compat (will hide if .floating-contacts present) */
.zalo-float { display: none; }
.scroll-top {
  position: fixed;
  bottom: 210px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-zalo);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base) var(--ease);
}
.scroll-top.show { opacity: 1; visibility: visible; }
@media (max-width: 767px) {
  .scroll-top { bottom: 248px; right: 14px; width: 40px; height: 40px; }
}

/* ---------- 20. Search overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: var(--z-search-overlay);
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 20vh;
}
.search-overlay.open { display: flex; }
.search-overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 24px;
  color: var(--ink);
}
.search-overlay form {
  width: min(90%, 600px);
  display: flex;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--ink);
  padding-bottom: var(--sp-3);
}
.search-overlay input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 24px;
  padding: 8px 0;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
}
.search-overlay input:focus { outline: none; }
.search-overlay button[type=submit] {
  font-size: 24px;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity var(--t-fast) var(--ease);
}
.search-overlay button[type=submit]:hover { opacity: 0.6; }
.search-overlay button[type=submit]:focus { outline: none; }


/* ---------- 21. Modal generic ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 8px));
  background: var(--white);
  border-radius: var(--radius);
  z-index: calc(var(--z-modal) + 1);
  max-width: 92vw;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base) var(--ease);
}
.modal.open {
  transform: translate(-50%, -50%);
  opacity: 1;
  visibility: visible;
}
.modal-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: var(--sp-5); }
.modal-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}

/* ---------- 22. Toast ---------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: toastIn 0.3s var(--ease-out);
}
.toast--success { background: var(--success); }
.toast--error { background: var(--sale); }
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- 45. 404 (ported from hifi-v2.css §45) ---------- */
.error-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
}
.error-illustration {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--sp-4);
  color: var(--ink-soft);
  opacity: 0.7;
}
.error-code {
  font-family: var(--font-serif);
  font-size: 84px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: var(--sp-3);
}
@media (min-width: 768px) { .error-code { font-size: 120px; } }
.error-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: var(--sp-3);
}
.error-text { color: var(--ink-soft); margin-bottom: var(--sp-5); max-width: 480px; margin-left: auto; margin-right: auto; }
.error-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ---------- Product card (shared shop + product related carousel) ---------- */
/* Moved from shop.css để product page (is_product, không load shop.css) cũng có card styles. */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  position: relative;
  transition: transform var(--t-base) var(--ease);
}
.product-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bone-soft);
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.product-card:hover .product-card-img img { transform: scale(1.04); }

.product-card-badge {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  background: var(--sale);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  z-index: 2;
}
.product-card-badge + .product-card-badge { top: calc(var(--sp-2) + 26px); }
.product-card-badge + .product-card-badge + .product-card-badge { top: calc(var(--sp-2) + 52px); }
.product-card-badge--new { background: var(--ink); }
.product-card-badge--hot { background: #b8732a; }
.product-card-badge--sale { background: var(--sale); }

.product-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  z-index: 2;
}
@media (hover: hover) { .product-card:hover .product-card-overlay { opacity: 1; } }
.product-card-overlay .btn {
  background: var(--white);
  color: var(--ink);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
}
.product-card-overlay .btn:hover { background: var(--ink); color: var(--white); }

.product-card-info {
  padding: var(--sp-3) 0 var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.product-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.product-card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--cta-red);
}
.product-card-price--normal { color: var(--cta-red); }
.price-unit {
  font-size: 0.7em;
  font-weight: 400 !important;
  margin-left: 2px;
  text-transform: lowercase;
  letter-spacing: 0;
}
.product-card-price-old {
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 400;
}
.product-card-colors {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.product-card-colors .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

