/* ============================================================
   Mái Che – Plugin Sản Phẩm CSS
   assets/css/san-pham.css
   ============================================================ */

:root {
  --sp-primary:      #333;
  --sp-primary-dk:   #333;
  --sp-accent:       #5cb21e;
  --sp-accent-lt:    #f5a623;
  --sp-white:        #ffffff;
  --sp-light:        #f5f7fa;
  --sp-gray:         #666666;
  --sp-gray-lt:      #eeeeee;
  --sp-border:       #dde3ec;
  --sp-text:         #222222;
  --sp-radius:       6px;
  --sp-radius-lg:    12px;
  --sp-shadow:       0 2px 10px rgba(26,58,108,.09);
  --sp-shadow-hv:    0 8px 28px rgba(26,58,108,.18);
  --sp-trans:        .26s ease;
  --sp-green:        #27ae60;
  --sp-orange:       #e67e22;
  --sp-red:          #e74c3c;
  --sp-blue:         #2980b9;
}

/* ── BREADCRUMB ── */
.maiche-sp-breadcrumb {
  background: var(--sp-light);
  border-bottom: 1px solid var(--sp-border);
  padding: 10px 0;
  font-size: 13px;
  color: var(--sp-gray);
}
.maiche-sp-breadcrumb a { color: var(--sp-primary); }
.maiche-sp-breadcrumb a:hover { color: var(--sp-accent); }

/* ── ARCHIVE HEADER ── */
.sp-archive-header { text-align: center; padding: 36px 0 24px; }
.sp-archive-title  { font-size: clamp(22px,3vw,34px); color: var(--sp-primary); font-weight: 800; margin: 0 0 8px; }
.sp-archive-title::after {
  content: ''; display: block; width: 50px; height: 4px;
  background: var(--sp-accent); border-radius: 2px; margin: 10px auto 0;
}
.sp-archive-desc { color: var(--sp-gray); font-size: 15px; max-width: 600px; margin: 0 auto; }

/* ── ARCHIVE TABS ── */
.sp-archive-tabs {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 32px;
}
.sp-tab {
  padding: 8px 20px; border: 2px solid var(--sp-primary);
  border-radius: var(--sp-radius); font-size: 13px; font-weight: 600;
  color: var(--sp-primary); background: transparent;
  transition: all var(--sp-trans); cursor: pointer; text-decoration: none;
}
.sp-tab:hover, .sp-tab.active {
  background: var(--sp-primary); color: var(--sp-white);
}

/* ── GRID ── */
.maiche-sp-grid { display: grid; gap: 22px; }
.maiche-sp-grid-2 { grid-template-columns: repeat(2,1fr); }
.maiche-sp-grid-3 { grid-template-columns: repeat(3,1fr); }
.maiche-sp-grid-4 { grid-template-columns: repeat(4,1fr); }

@media (max-width: 991px) {
  .maiche-sp-grid-3,
  .maiche-sp-grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .maiche-sp-grid-2,
  .maiche-sp-grid-3,
  .maiche-sp-grid-4 { grid-template-columns: 1fr; }
}

/* ── PRODUCT CARD ── */
.maiche-sp-card {
  background: var(--sp-white); border-radius: var(--sp-radius-lg);
  border: 1px solid var(--sp-border); box-shadow: var(--sp-shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--sp-trans), box-shadow var(--sp-trans);
}
.maiche-sp-card:hover { transform: translateY(-5px); box-shadow: var(--sp-shadow-hv); }

.maiche-sp-card-link { text-decoration: none; color: inherit; flex: 1; display: flex; flex-direction: column; }

.maiche-sp-card-thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 1; background: var(--sp-light);
}
.maiche-sp-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease; display: block;
}
.maiche-sp-card:hover .maiche-sp-card-thumb img { transform: scale(1.06); }

.maiche-sp-no-img {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  font-size: 52px; color: var(--sp-gray-lt);
  min-height: 180px;
}

/* Badge */
.maiche-sp-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 3px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.badge-het { background: var(--sp-red); }
.badge-dat { background: var(--sp-orange); }

.maiche-sp-card-body { padding: 14px 16px; flex: 1; }

.maiche-sp-cat {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--sp-accent);
  display: block; margin-bottom: 6px;
}

.maiche-sp-card-title {
  font-size: 14px; font-weight: 700; color: var(--sp-primary);
  line-height: 1.4; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.maiche-sp-chat-lieu { font-size: 12px; color: var(--sp-gray); margin: 0 0 6px; }

.maiche-sp-gia { margin-top: auto; padding-top: 8px; }
.gia-value    { font-size: 15px; font-weight: 800; color: var(--sp-accent); }
.gia-lien-he  { font-size: 14px; font-weight: 700; color: var(--sp-primary); font-style: italic; }

.maiche-sp-card-footer {
  display: flex; gap: 8px; padding: 10px 14px 14px;
  border-top: 1px solid var(--sp-gray-lt);
}
.maiche-sp-btn-call,
.maiche-sp-btn-detail {
  flex: 1; text-align: center; padding: 8px 4px;
  border-radius: var(--sp-radius); font-size: 12px;
  font-weight: 700; text-decoration: none; transition: all var(--sp-trans);
}
.maiche-sp-btn-call {
  background: var(--sp-accent); color: #fff !important;
}
.maiche-sp-btn-call:hover { background: #c94d00; }
.maiche-sp-btn-detail {
  background: transparent; color: var(--sp-primary) !important;
  border: 1.5px solid var(--sp-primary);
}
.maiche-sp-btn-detail:hover { background: var(--sp-primary); color: #fff !important; }

/* ── SINGLE PRODUCT ── */
.maiche-sp-single { padding: 0 0 60px; }

.sp-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 32px 0 40px;
  align-items: start;
}
@media (max-width: 767px) { .sp-top-row { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════
   GALLERY — Clone đúng layout maichehoaphat.vn

   Cấu trúc:
   ┌─────────────────────────────────────┐
   │  [th1] [th2] [th3] [th4]  ← thumbnails nhỏ (trên)
   ├─────────────────────────────────────┤
   │                                     │
   │        ẢNH LỚN ĐANG ACTIVE         │  ← 480×480
   │                                     │
   └─────────────────────────────────────┘
══════════════════════════════════════════════════════ */

/* Cột gallery chiếm đúng 1 nửa */
.sp-gallery-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── ROW 1: Thumbnails nhỏ nằm ngang ── */
.sp-gallery-thumbs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-gthumb {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: var(--sp-radius);
  overflow: hidden;
  border: 2px solid var(--sp-border);
  cursor: pointer;
  transition: border-color var(--sp-trans), box-shadow var(--sp-trans);
  flex-shrink: 0;
  text-decoration: none;
}

.sp-gthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.sp-gthumb:hover img  { transform: scale(1.08); }
.sp-gthumb.active     { border-color: var(--sp-accent); box-shadow: 0 0 0 1px var(--sp-accent); }
.sp-gthumb:hover      { border-color: var(--sp-accent); }

/* ── ROW 2: Ảnh lớn ── */
.sp-gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;          /* vuông giống site gốc 480×480 */
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
  border: 1px solid var(--sp-border);
  background: var(--sp-light);
  box-shadow: var(--sp-shadow);
}

/* Link bao ảnh lớn */
.sp-main-lightbox {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

/* Ảnh lớn */
#sp-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .2s ease;
}

/* Hiệu ứng fade khi đổi ảnh */
#sp-main-img.sp-img-loading {
  opacity: .5;
  transform: scale(.98);
}

/* Icon zoom góc phải dưới */
.sp-zoom-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: rgba(0,0,0,.45);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0;
  transition: opacity var(--sp-trans);
  pointer-events: none;
}

.sp-gallery-main:hover .sp-zoom-icon { opacity: 1; }
.sp-gallery-main:hover #sp-main-img  { transform: scale(1.03); }

/* Không có ảnh */
.sp-no-gallery {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--sp-radius-lg);
  border: 2px dashed var(--sp-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--sp-gray-lt);
  background: var(--sp-light);
  gap: 8px;
}
.sp-no-gallery small { font-size: 13px; color: var(--sp-gray); }

/* Responsive: mobile → gallery toàn width */
@media (max-width: 767px) {
  .sp-gallery-thumbs { gap: 6px; }
  .sp-gthumb         { width: 60px; height: 60px; }
}

/* Info col */
.sp-cat-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--sp-accent); letter-spacing: .5px;
  text-decoration: none; display: inline-block; margin-bottom: 8px;
}
.sp-title {
  font-size: clamp(20px,2.5vw,30px); color: var(--sp-primary);
  font-weight: 700; margin: 0 0 12px; line-height: 1.3;
}

/* Rating */
.sp-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sp-stars   { color: var(--sp-accent-lt); font-size: 20px; letter-spacing: 2px; }
.sp-rating-text { font-size: 13px; color: var(--sp-gray); }

/* Price */
.sp-price-wrap   { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.sp-price        { font-size: 24px; font-weight: 800; color: var(--sp-accent); }
.sp-price-lh     { font-size: 20px; color: var(--sp-primary); }
.sp-price-goc    { font-size: 15px; color: var(--sp-gray); text-decoration: line-through; }
.sp-tinh-trang   {
  padding: 3px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.tt-con { background: var(--sp-green); }
.tt-dat { background: var(--sp-orange); }
.tt-lh  { background: var(--sp-blue); }
.tt-het { background: var(--sp-red); }

.sp-mo-ta-ngan {
  font-size: 14px; color: var(--sp-gray);
  border-left: 3px solid var(--sp-accent); padding-left: 12px;
  margin: 0 0 14px; line-height: 1.7;
}

/* Nổi bật */
.sp-noi-bat { list-style: none; padding: 0; margin: 0 0 16px; }
.sp-noi-bat li {
  padding: 5px 0; font-size: 14px; color: var(--sp-text);
  padding-left: 20px; position: relative;
}
.sp-noi-bat li::before {
  content: '✔'; position: absolute; left: 0;
  color: var(--sp-green); font-size: 13px;
}

/* Thông số */
.sp-thong-so { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 13.5px; }
.sp-thong-so th,
.sp-thong-so td { padding: 7px 10px; border-bottom: 1px solid var(--sp-gray-lt); text-align: left; }
.sp-thong-so th { width: 38%; color: var(--sp-gray); font-weight: 600; }
.sp-thong-so td { color: var(--sp-text); font-weight: 500; }
.sp-thong-so tr:last-child th,
.sp-thong-so tr:last-child td { border: none; }

/* CTA buttons */
.sp-cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: var(--sp-radius);
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: all var(--sp-trans); cursor: pointer;
}
.sp-btn-call  { background: var(--sp-accent); color: #fff !important; flex: 1; }
.sp-btn-call:hover { background: #c94d00; }
.sp-btn-zalo  { background: #0068ff; color: #fff !important; }
.sp-btn-zalo:hover { background: #0050cc; }

/* Share */
.sp-share { font-size: 13px; color: var(--sp-gray); display: flex; align-items: center; gap: 10px; }
.sp-share a {
  padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600; text-decoration: none; color: #fff;
  transition: opacity var(--sp-trans);
}
.sp-share a:hover { opacity: .85; }
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }

/* Content row */
.sp-content-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) { .sp-content-row { grid-template-columns: 1fr; } }

/* Video */
.sp-video-wrap {
  margin-bottom: 28px; border-radius: var(--sp-radius-lg);
  overflow: hidden; background: #000;
}
.sp-video-wrap video { width: 100%; display: block; max-height: 420px; }
.sp-video-yt, .sp-video-embed { position: relative; padding-bottom: 56.25%; height: 0; }
.sp-video-yt iframe,
.sp-video-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}

/* Entry content */
.sp-entry-content h2 {
  font-size: 20px; color: var(--sp-primary); font-weight: 800;
  border-left: 4px solid var(--sp-accent); padding-left: 14px; margin: 28px 0 12px;
}
.sp-entry-content h3 { font-size: 17px; color: var(--sp-primary); margin: 22px 0 10px; }
.sp-entry-content p  { font-size: 14.5px; line-height: 1.8; margin-bottom: 16px; }
.sp-entry-content ul li,
.sp-entry-content ol li { font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.sp-entry-content img { max-width: 100%; border-radius: var(--sp-radius); display: block; margin: 16px 0; }

/* Bảng giá */
.maiche-bang-gia-wrap {
  background: var(--sp-light); border-radius: var(--sp-radius-lg);
  border: 1px solid var(--sp-border); overflow: hidden; margin: 28px 0;
}
.maiche-bang-gia-tieu-de {
  background: var(--sp-primary); color: #fff;
  font-weight: 800; font-size: 15px; padding: 12px 18px;
  text-align: center; text-transform: uppercase; letter-spacing: .5px;
}
.maiche-bang-gia-table { width: 100%; border-collapse: collapse; }
.maiche-bang-gia-table th {
  background: rgba(26,58,108,.08); color: var(--sp-primary);
  padding: 10px 16px; text-align: left; font-size: 13px;
  border-bottom: 2px solid var(--sp-border);
}
.maiche-bang-gia-table td { padding: 10px 16px; border-bottom: 1px solid var(--sp-border); font-size: 14px; }
.maiche-bang-gia-table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.maiche-bang-gia-table .gia-col { color: var(--sp-accent); font-weight: 700; }
.maiche-bang-gia-ghi-chu { padding: 12px 18px; font-size: 13px; color: var(--sp-gray); }
.maiche-bang-gia-ghi-chu strong { color: var(--sp-primary); }
.maiche-bang-gia-ghi-chu ul { padding-left: 20px; margin: 6px 0 0; }
.maiche-bang-gia-ghi-chu li { margin-bottom: 4px; line-height: 1.6; }

/* Sidebar */
.sp-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sp-widget {
  background: var(--sp-white); border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg); padding: 18px; box-shadow: var(--sp-shadow);
}
.sp-widget-title {
  font-size: 14px; font-weight: 800; color: var(--sp-primary);
  border-bottom: 3px solid var(--sp-accent); padding-bottom: 8px; margin: 0 0 14px;
}
.sp-widget-cat-list { list-style: none; padding: 0; margin: 0; }
.sp-widget-cat-list li {
  border-bottom: 1px dashed var(--sp-gray-lt);
  padding: 7px 0;
}
.sp-widget-cat-list li.active a { color: var(--sp-accent); font-weight: 700; }
.sp-widget-cat-list li a {
  font-size: 13px; color: var(--sp-text); text-decoration: none;
  display: flex; justify-content: space-between; align-items: center;
  transition: color var(--sp-trans);
}
.sp-widget-cat-list li a:hover { color: var(--sp-accent); padding-left: 4px; }
.sp-widget-cat-list .count { color: var(--sp-gray); font-size: 11px; }
.sp-widget-hotline { text-align: center; }
.sp-widget-hotline p { font-size: 13px; color: var(--sp-gray); margin: 0 0 10px; }
.sp-widget-hotline-btn, .sp-widget-zalo-btn {
  display: block; padding: 11px; border-radius: var(--sp-radius);
  font-weight: 800; font-size: 16px; text-decoration: none;
  margin-bottom: 8px; transition: opacity var(--sp-trans);
}
.sp-widget-hotline-btn { background: var(--sp-accent); color: #fff; }
.sp-widget-zalo-btn    { background: #0068ff; color: #fff; font-size: 14px; }
.sp-widget-hotline-btn:hover,
.sp-widget-zalo-btn:hover { opacity: .87; }
.sp-entry-footer{
    padding-top: 10px;
    border-top: solid 1px gray;
}
/* Related products */
.maiche-sp-lien-quan { margin-top: 10px; padding-top: 32px; border-top: 1px solid gray; }
.sp-lq-title {
  font-size: 22px; font-weight: 800; color: var(--sp-primary);
  margin: 0 0 24px; position: relative; display: inline-block;
}
.sp-lq-title::after {
  content: ''; display: block; width: 40px; height: 3px;
  background: var(--sp-accent); border-radius: 2px; margin-top: 8px;
}

/* sp-moi list (sidebar widget) */
.maiche-sp-moi-list { list-style: none; padding: 0; margin: 0; }
.maiche-sp-moi-item { border-bottom: 1px solid var(--sp-gray-lt); padding: 8px 0; }
.sp-moi-link { display: flex; gap: 10px; text-decoration: none; align-items: center; }
.sp-moi-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.sp-moi-info  { flex: 1; min-width: 0; }
.sp-moi-title { display: block; font-size: 13px; color: var(--sp-primary); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.sp-moi-gia   { font-size: 12px; color: var(--sp-accent); font-weight: 700; }

/* CTA box shortcode */
.maiche-sp-cta-box {
  background: linear-gradient(135deg, var(--sp-primary) 0%, #254e96 100%);
  border-radius: var(--sp-radius-lg); padding: 28px 24px; text-align: center;
  margin: 24px 0;
}
.maiche-sp-cta-box .cta-text { color: rgba(255,255,255,.85); margin: 0 0 16px; font-size: 15px; }
.maiche-sp-cta-box .cta-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  padding: 12px 24px; border-radius: var(--sp-radius);
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: opacity var(--sp-trans);
}
.cta-btn:hover { opacity: .88; }
.cta-btn-call { background: var(--sp-accent); color: #fff; }
.cta-btn-zalo { background: #0068ff; color: #fff; }

/* Section title shortcode */
.maiche-sp-section-title {
  font-size: 24px; color: var(--sp-primary); font-weight: 800;
  position: relative; margin: 0 0 24px; display: inline-block;
}
.maiche-sp-section-title::after {
  content: ''; display: block; width: 40px; height: 3px;
  background: var(--sp-accent); border-radius: 2px; margin-top: 8px;
}

/* Taxonomy */
.sp-tax-header {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 28px 0 20px; border-bottom: 1px solid var(--sp-border); margin-bottom: 24px;
}
.sp-tax-img img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--sp-radius); }
.sp-term-count  { font-size: 13px; color: var(--sp-gray); }
.sp-sub-cats    { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.sp-sub-cat-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--sp-white);
  border: 1.5px solid var(--sp-border); border-radius: var(--sp-radius);
  text-decoration: none; transition: all var(--sp-trans);
}
.sp-sub-cat-card:hover { border-color: var(--sp-accent); color: var(--sp-accent); }
.sub-cat-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.sp-sub-cat-card span { font-weight: 600; color: var(--sp-primary); font-size: 14px; }
.sp-sub-cat-card small { color: var(--sp-gray); font-size: 11px; }

/* Pagination */
.sp-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.sp-pagination .page-numbers {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--sp-radius);
  border: 1.5px solid var(--sp-border); font-size: 14px;
  font-weight: 600; color: var(--sp-primary); text-decoration: none;
  transition: all var(--sp-trans);
}
.sp-pagination .page-numbers:hover,
.sp-pagination .current {
  background: var(--sp-accent); border-color: var(--sp-accent); color: #fff;
}

/* Danh mục grid shortcode */
.maiche-danh-muc-grid { display: grid; gap: 20px; }
.maiche-danh-muc-card {
  display: flex; flex-direction: column; text-decoration: none;
  border: 1px solid var(--sp-border); border-radius: var(--sp-radius-lg);
  overflow: hidden; transition: all var(--sp-trans); background: var(--sp-white);
}
.maiche-danh-muc-card:hover { transform: translateY(-4px); box-shadow: var(--sp-shadow-hv); }
.dm-thumb { aspect-ratio: 3/2; overflow: hidden; }
.dm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dm-no-img { width: 100%; aspect-ratio: 3/2; background: var(--sp-light); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.dm-info { padding: 14px 16px; }
.dm-info h3 { font-size: 15px; color: var(--sp-primary); margin: 0 0 4px; font-weight: 700; }
.dm-info span { font-size: 12px; color: var(--sp-gray); }

.sp-not-found { text-align: center; color: var(--sp-gray); padding: 48px 0; font-size: 16px; }

/* ============================================================
   GALLERY LAYOUT ĐÚNG THEO MAICHEHOAPHAT.VN
   Cấu trúc:
     [thumb1] [thumb2] [thumb3] [thumb4]   ← hàng trên
     [       ảnh lớn active              ]  ← hàng dưới
   ============================================================ */

/* Cột gallery chiếm toàn bộ chiều rộng cột trái */
.sp-gallery-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── HÀNG TRÊN: thumbnails nhỏ nằm ngang ── */
.sp-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    order: 1;                   /* thumbnails TRÊN */
}

.sp-gthumb {
    display: block;
    width: calc(25% - 6px);    /* 4 ảnh / hàng, trừ gap */
    aspect-ratio: 1;
    border-radius: var(--sp-radius);
    overflow: hidden;
    border: 2px solid var(--sp-border);
    cursor: pointer;
    transition: border-color var(--sp-trans), transform var(--sp-trans);
    text-decoration: none;
    flex-shrink: 0;
}

/* Nếu ít hơn 4 ảnh, mỗi thumb rộng hơn */
.sp-gallery-thumbs:has(.sp-gthumb:nth-child(1):last-child) .sp-gthumb { width: 100%; }
.sp-gallery-thumbs:has(.sp-gthumb:nth-child(2):last-child) .sp-gthumb { width: calc(50% - 4px); }
.sp-gallery-thumbs:has(.sp-gthumb:nth-child(3):last-child) .sp-gthumb { width: calc(33.33% - 6px); }

.sp-gthumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sp-gthumb:hover {
    border-color: var(--sp-accent);
    transform: translateY(-2px);
}

.sp-gthumb:hover img { transform: scale(1.08); }

.sp-gthumb.active {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 2px var(--sp-primary);
}

/* ── HÀNG DƯỚI: ảnh lớn active ── */
.sp-gallery-main {
    order: 2;                   /* ảnh lớn DƯỚI */
    position: relative;
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    border: 1px solid var(--sp-border);
    background: var(--sp-light);
    cursor: zoom-in;
}

.sp-main-lightbox {
    display: block;
    position: relative;
}

#sp-main-img {
    width: 100%;
    aspect-ratio: 1;            /* vuông như site gốc */
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, opacity 0.2s ease;
}

/* Icon zoom hover */
.sp-zoom-icon {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 20px;
    opacity: 0;
    transition: opacity var(--sp-trans);
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}

.sp-gallery-main:hover .sp-zoom-icon { opacity: 1; }

/* Không có ảnh */
.sp-no-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: var(--sp-light);
    border-radius: var(--sp-radius-lg);
    font-size: 48px;
    color: var(--sp-gray-lt);
    border: 2px dashed var(--sp-border);
}

/* ── Hotline nổi bật dưới tiêu đề (đúng site gốc) ── */
.sp-hotline-top {
    font-size: 15px;
    color: var(--sp-gray);
    margin-bottom: 14px;
    font-weight: 500;
}

.sp-hotline-number {
    font-size: 18px;
    font-weight: 800;
    color: var(--sp-accent);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sp-hotline-number:hover { color: var(--sp-primary); }

/* ── Quick specs (Chất liệu, Xuất xứ, Giá thành) ── */
.sp-quick-specs {
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.sp-spec-row {
    display: flex;
    align-items: baseline;
    padding: 8px 14px;
    border-bottom: 1px solid var(--sp-border);
    gap: 10px;
    font-size: 14px;
}

.sp-spec-row:last-child { border-bottom: none; }

.sp-spec-label {
    min-width: 90px;
    color: var(--sp-gray);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sp-spec-value {
    color: var(--sp-text);
    font-weight: 500;
    line-height: 1.5;
}

.sp-spec-gia {
    color: var(--sp-accent) !important;
    font-weight: 800;
    font-size: 15px;
}

.sp-spec-gia del {
    color: var(--sp-gray);
    font-weight: 400;
    font-size: 13px;
    margin-left: 8px;
}

.sp-spec-cat { border: none; padding: 4px 0 10px; }
.sp-cat-link { color: var(--sp-primary); }
.sp-cat-link:hover { color: var(--sp-accent); }

/* ── Bottom meta: tình trạng + rating ── */
.sp-bottom-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 0 6px;
    border-top: 1px dashed var(--sp-border);
    margin-top: 10px;
}

/* ── Share buttons ── */
.sp-share {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 13px;
}

.sp-share-label { color: var(--sp-gray); font-weight: 600; }

.share-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #fff !important;
    transition: opacity var(--sp-trans);
}

.share-btn:hover { opacity: .82; }
.share-fb  { background: #1877f2; }
.share-wa  { background: #25d366; }
.share-tw  { background: #1da1f2; }
.share-pin { background: #e60023; }

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
    /* Trên mobile: thumbnails 2 ảnh / hàng */
    .sp-gthumb {
        width: calc(50% - 4px);
    }

    #sp-main-img {
        aspect-ratio: 4/3;
    }

    .sp-info-col {
        position: static !important;
    }
}

@media (max-width: 480px) {
    .sp-gthumb {
        width: calc(33.33% - 6px);
    }
}

/* ══════════════════════════════════════════════════════
   SP ENTRY FOOTER — Ngày đăng + Share icons + Đánh giá
   (Clone layout maichehoaphat.vn)
══════════════════════════════════════════════════════ */
.sp-entry-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--sp-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mỗi hàng */
.sp-footer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Hàng 1: meta + share cùng 1 hàng, space-between */
.sp-footer-top {
  justify-content: space-between;
}

/* Label xám nhạt */
.sp-footer-label {
  font-size: 13.5px;
  color: var(--sp-gray);
}

/* Ngày đăng — màu xanh link giống site gốc */
.sp-footer-date {
  font-size: 13.5px;
  font-weight: 600;
  color: #27ae60;
  text-decoration: none;
}
.sp-footer-date:hover { text-decoration: underline; }

/* Tên tác giả */
.sp-footer-author {
  font-size: 13.5px;
  font-weight: 600;
  color: #27ae60;
  text-decoration: none;
}
.sp-footer-author:hover { text-decoration: underline; }

/* ── Share icons — 5 nút tròn ── */
.sp-footer-share {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sp-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--sp-border);
  color: var(--sp-gray);
  text-decoration: none;
  transition: all var(--sp-trans);
  flex-shrink: 0;
}

/* Hover mỗi icon đúng màu thương hiệu */
.sp-share-icon-fb:hover    { background: #1877f2; border-color: #1877f2; color: #fff; }
.sp-share-icon-tw:hover    { background: #1da1f2; border-color: #1da1f2; color: #fff; }
.sp-share-icon-email:hover { background: #ea4335; border-color: #ea4335; color: #fff; }
.sp-share-icon-pin:hover   { background: #e60023; border-color: #e60023; color: #fff; }
.sp-share-icon-li:hover    { background: #0077b5; border-color: #0077b5; color: #fff; }

/* ── Hàng 2: Đánh giá ── */
.sp-footer-rating {
  gap: 6px;
}

.sp-footer-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.sp-footer-rating-text {
  font-size: 13.5px;
  color: var(--sp-text);
  font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .sp-footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Hidden lightbox links (dùng cho GLightbox, ẩn khỏi giao diện) */
.sp-lightbox-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Gallery */
.sp-main-img-wrap {
  border-radius: var(--sp-radius-lg); overflow: hidden;
  border: 1px solid var(--sp-border);
}
.sp-main-img { width: 100%; display: block; object-fit: cover; }
.sp-thumbs   { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sp-thumb-item{
  width: 72px; height: 72px; border-radius: var(--sp-radius);
  overflow: hidden; border: 2px solid var(--sp-border);
  cursor: pointer; transition: border-color var(--sp-trans);
}
.sp-thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.sp-thumb-item.active,
.sp-thumb-item:hover { border-color: var(--sp-accent); }
