/* =========================
   SIMPLE MENU — THEME (Full CSS)
   Base: dark theme (phiên bản đúng trước đó)
   + chỉnh sửa: bỏ border ở ảnh/banner, bỏ gap giữa cột, modal: Bewertungen lớn + sao vàng
========================= */

/* ---------- Global ---------- */
body {
  font-family: "Inter", "Roboto", sans-serif;
  background: #0f0f0f;
  color: #eee;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- Layout: main + sidebar + content ---------- */
.sfm-main-wrap {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 20px;
}

/* Sidebar (left) */
.category_product { flex: 0 0 240px; }
.category_product ul.sfm-category-list {
  list-style: none;
  margin: 0;
  padding: 14px;
  position: sticky;
  top: 100px;
  background: rgba(24,24,24,0.95);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.category_product ul.sfm-category-list li { margin-bottom: 10px; }
.category_product ul.sfm-category-list li a {
  display: block;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: #eaeaea;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}
.category_product ul.sfm-category-list li a:hover {
  transform: translateX(6px);
  background: linear-gradient(135deg,#2a2a2a,#1b1b1b);
  color: #fff;
}
.category_product ul.sfm-category-list li a.active {
  background: linear-gradient(135deg,#e63946,#ff5f6d);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 26px rgba(230,57,70,0.35);
}

/* ---------- Content area / list-wrap ---------- */
.sfm-list-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
}
.sfm-category-wrap { width: 100%; }

/* ---------- Category banner (full width of content) ---------- */
.sfm-category-banner {
 position: relative;
  display: flex;                /* thêm flex để căn giữa nội dung */
  justify-content: center;      /* căn ngang */
  align-items: center;          /* căn dọc */
  height: 240px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: none;
  border: none;
  margin-bottom: 10px;
}
.sfm-category-banner::before {
 content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.6));
  z-index: 1;
}
.sfm-category-banner * { position: relative; z-index: 2; }
.sfm-category-banner .sfm-category-title {
  position: relative;      /* bỏ absolute cũ */
  z-index: 2;
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  text-shadow: 0 6px 20px rgba(0,0,0,0.7);
  padding: 8px 20px;
}

/* ---------- Grid of items ---------- */
/* Desktop = 3 columns, GAP removed per request */
.sfm-category-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;   /* ép card cao bằng nhau */
}

/* Individual item card (giữ style base từ version đúng trước đó) */
.sfm-item {
  background: linear-gradient(180deg,#171717,#1e1e1e);
  border: 1px solid rgba(255,255,255,0.03); /* subtle border to define card (kept) */
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 0 10px 0; /* remove margins to align tightly without gap */
  height: 100%;
}

.sfm-item:hover .sfm-body{background: #262626;}
/* Thumb area: large image full width */
/* BỎ border/shadow ở ảnh theo yêu cầu (override) */
.sfm-thumb {
  width: 100%;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
}
.sfm-thumb:hover{cursor: pointer;}
.sfm-thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  box-shadow: none !important;  /* ensure no shadow */
  border: none !important;      /* ensure no border */
  transition: transform .45s ease;
}

/* Body area inside card */
.sfm-body {
  flex: 1; /* chiếm hết chiều cao còn lại */
  display: grid;
  grid-template-rows: auto 1fr auto; /* title - desc - price */
  gap: 10px;
  padding: 15px;
}
.sfm-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.sfm-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #bfbfbf;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;       /* số dòng hiển thị fix */
  -webkit-box-orient: vertical;
  padding-bottom: 10px;
}

/* Price ở cuối */
.sfm-price {
  color: #ffd34d;
  font-size: 18px;
  font-weight: 800;
}
.sfm-excerpt {
  color: #bfbfbf;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
}

/* Buttons row */
.sfm-open-btn {
  align-self: flex-start;
  padding: 10px 16px;
  background: linear-gradient(135deg,#e63946,#ff5f6d);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(230,57,70,0.25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.sfm-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
}

/* ---------- Modal overrides (giữ full dark modal from correct version) ---------- */
/* Keep .sfm-modal hidden so JS toggles it as before */
.sfm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120000;
  font-family: "Inter", sans-serif;
  -webkit-overflow-scrolling: touch;
}

/* overlay */
.sfm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 1;
}

/* inner modal */
.sfm-modal-inner {
  position: relative;
  max-width: 1100px;
  margin: 5vh auto;
  background: #171717;
  color: #eee;
  border-radius: 14px;
  z-index: 2;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 6vh);    /* leaves small margin top/bottom */
  -webkit-overflow-scrolling: touch; /* momentum scrolling on iOS */
  overscroll-behavior: contain;      /* prevent 'scroll chaining' to body */
  animation: fadeUp .36s cubic-bezier(.2,.8,.2,1);
  border: 1px solid rgba(255,255,255,0.03);
  min-width: 320px;
}

/* close */
.sfm-modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  background: transparent;
  border: 0;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  transition: color .18s ease, transform .18s ease;
  z-index: 3;
}
.sfm-modal-close:hover { color: #fff; transform: rotate(90deg); }
@media (max-width: 768px) {
  .sfm-modal-inner {
    margin: 4vh 12px;
    max-height: calc(100vh - 8vh);
    border-radius: 12px;
  }
  .sfm-modal-top { padding: 14px; }
  .sfm-modal-image img { width: 100%; height: auto; max-height: 320px; }
}
/* modal top */
.sfm-modal-top {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(180deg,#141414,#1b1b1b);
  align-items: flex-start;
}

/* modal image: remove image border/shadow (as requested) */
.sfm-modal-image img {
  width: 340px;
  height: 240px;
  object-fit: cover;
  border-radius: 0;   /* remove rounding on modal image to match sample */
  box-shadow: none !important;
  border: none !important;
  display: block;
}
.sfm-modal-info { flex: 1 1 auto; min-width: 0; }
.sfm-modal-title {
 position: relative;
  display: flex;
  justify-content: flex-start; /* title vẫn bên trái */
  align-items: center;
  min-height: 40px;
}
.sfm-modal-price {
  color: #ffd34d;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 12px;
}
.sfm-modal-desc { color: #dcdcdc; line-height: 1.7; }

/* Tabs */
.sfm-modal-tabs-wrap { background: #151414; border-top: 1px solid rgba(255,255,255,0.03); }
.sfm-tabs {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  align-items: center;
}
.sfm-tab-btn {
  padding: 10px 14px;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255,95,109,0.85);
  color: #ff8b9a;
  border-radius: 8px;
  font-weight: 600;
  transition: all .18s ease;
}
.sfm-tab-btn:hover { background: rgba(255,95,109,0.06); color: #fff; border-color: rgba(255,95,109,1); }
.sfm-tab-btn.sfm-active {
  background: linear-gradient(135deg,#e63946,#ff5f6d);
  color: #fff;
  border: none;
  box-shadow: 0 8px 28px rgba(230,57,70,0.28);
}
.sfm-tab-content-area { padding: 22px; background: #0f0f0f; color: #ddd; }
.sfm-tab-pane { display: none; }
.sfm-tab-pane.sfm-active { display: block; }


/* Khi thêm class fixed */
.category_product ul.sfm-category-list.fixed {
  position: fixed;
  top: 100px;          /* cách từ trên xuống */         /* giữ ở mép trái container */
  width: 240px;        /* giữ nguyên chiều rộng sidebar */
  z-index: 99;
}


/* Reviews */
.sfm-review { padding: 14px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); color: #e8e8e8; }
.sfm-review:last-child { border-bottom: none; }
.sfm-review-head { color: #fff; margin-bottom: 6px; font-weight:700; }
.sfm-review-date { color: #aaa; font-size: 13px; margin-left: 6px; }

/* ---------- Requested: Bewertungen lớn hơn + sao vàng ---------- */
/* sfm-reviews-count (nơi hiển thị "Bewertungen (2) ★★") */
.sfm-reviews-count {
  font-size: 30px !important;  /* to hơn như yêu cầu */
  font-weight: 900 !important;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* stars màu vàng */
.sfm-star,
.sfm-review-rating .sfm-star,
.sfm-reviews-count .sfm-star,
.sfm-modal-rating .sfm-star {
  color: #ffd34d !important;  /* vàng */
  font-size: 20px;
  line-height: 1;
}

.sfm-modal-title .sfm-spinner {
  position: absolute;
  left: 50%;                /* căn giữa */
  top: 50%;
  transform: translate(-50%, -50%); /* giữa cả ngang + dọc */
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #ffd34d;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---------- Responsive ---------- */
/* Tablet and small desktop: keep 3 columns by default (as requested only mobile->2) */
@media (max-width: 1024px) {
  .sfm-thumb img { height: 200px; }
}

/* Mobile: 2 columns, content-first, adjust sizes */
@media (max-width: 768px) {
  .sfm-category-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }
  .sfm-thumb img { height: 160px; }
  .sfm-body { padding: 12px; }
  .sfm-main-wrap { flex-direction: column-reverse; }
  .category_product { width: 100%; flex: 0 0 auto; margin-bottom: 16px; position: relative; top: 0; }
  .category_product ul.sfm-category-list { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; }
  .category_product ul.sfm-category-list li a { padding: 8px 10px; font-size: 14px; }
  .sfm-modal-top { padding: 14px; flex-direction: column; gap: 12px; }
  .sfm-modal-image img { width: 100%; height: auto; max-height: 320px; }
  .sfm-modal-inner { margin: 4vh 12px; }
  .sfm-modal-title .sfm-spinner {
    position: fixed;               /* overlay toàn màn hình */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;                 /* đảm bảo nổi trên nội dung */
  }
  .category_product ul.sfm-category-list.fixed {
    position: fixed;
    top: 0;                   /* ghim lên đầu */
    left: 0;
    width: 100% !important;   /* chiếm toàn bộ chiều ngang */
    flex-wrap: wrap;
    justify-content: center;  /* căn giữa các menu item */
    background: rgba(24,24,24,0.95);
    border-radius: 0;
    padding: 10px;
    z-index: 1000;
  }
  .sfm-reviews-count {
    display: block; /* đổi flex thành block để tách dòng */
  }

  .sfm-stars {
    display: inline-flex;  /* vẫn ngang hàng các sao */
    gap: 4px;
    margin-top: 4px;       /* cách chữ một chút */
  }
  .sfm-stars .sfm-star{font-size: 30px;}
}

/* Utilities to avoid overflow issues */
.sfm-list-wrap, .sfm-category-items, .sfm-item, .sfm-modal-inner { box-sizing: border-box; }

/* Final protective specificity to ensure modal text readable */
.sfm-modal .sfm-modal-inner, .sfm-modal .sfm-modal-top, .sfm-modal .sfm-modal-info { color: #eee !important; }
