/**
 * Flatsome Lite - Modern Product Layout (Hybrid CellphoneS & Dien May Xanh)
 * Phong cách hiện đại: Bo góc 12px, phẳng, tinh tế, tối ưu tỷ lệ chuyển đổi.
 */

:root {
  --fl-p-red: #d70018;
  --fl-p-red-hover: #c40016;
  --fl-p-red-light: #fef2f2;
  --fl-p-red-border: #fca5a5;
  --fl-p-blue: #0284c7;
  --fl-p-blue-hover: #0369a1;
  --fl-p-gray-bg: #f8fafc;
  --fl-p-gray-border: #e2e8f0;
  --fl-p-text-main: #1e293b;
  --fl-p-text-muted: #64748b;
  --fl-p-radius: 12px;
}

/* 0. Wrapper Layout chuẩn Container */
.modern-product-layout {
  padding-top: 12px;
  padding-bottom: 40px;
  box-sizing: border-box;
}

/* 0.1 Breadcrumb Trên Cùng */
.modern-breadcrumbs-wrapper {
  padding: 6px 0 14px 0;
}
.modern-breadcrumbs-wrapper .woocommerce-breadcrumb,
.modern-breadcrumbs-wrapper .breadcrumbs,
.modern-breadcrumbs-wrapper .rank-math-breadcrumb p {
  margin: 0;
  padding: 0;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.modern-breadcrumbs-wrapper a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}
.modern-breadcrumbs-wrapper a:hover {
  color: var(--fl-p-blue, #0284c7);
  text-decoration: underline;
}
.modern-breadcrumbs-wrapper .divider,
.modern-breadcrumbs-wrapper .separator {
  color: #94a3b8;
  font-size: 11px;
  margin: 0 2px;
  opacity: 0.75;
}
.modern-breadcrumbs-wrapper .breadcrumb-last,
.modern-breadcrumbs-wrapper .last {
  color: #1e293b;
  font-weight: 500;
}

/* 1. Header Bar trên cùng */
.modern-product-header {
  border-bottom: 1px solid var(--fl-p-gray-border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.modern-product-header .product-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fl-p-text-main);
  line-height: 1.35;
  margin: 0 0 8px 0;
}
@media (min-width: 768px) {
  .modern-product-header .product-title {
    font-size: 26px;
  }
}
.modern-product-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  font-size: 13.5px;
  color: var(--fl-p-text-muted);
}
.modern-product-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  font-weight: 600;
}
.modern-btn-quick-spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fl-p-blue);
  background: #f0f9ff;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.modern-btn-quick-spec:hover {
  background: #e0f2fe;
  color: var(--fl-p-blue-hover);
}

/* 2. Main Hero Layout (2 cột 56% - 44% bằng CSS Grid, an toàn không tràn) */
.modern-product-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 30px;
}
@media (min-width: 992px) {
  .modern-product-hero {
    display: grid;
    grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
    gap: 28px;
    align-items: start;
  }
  .modern-hero-left,
  .modern-hero-right {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

/* Cột Trái: Gallery Box */
.modern-gallery-wrapper {
  background: #ffffff;
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  overflow: hidden;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.modern-gallery-wrapper .woocommerce-product-gallery,
.modern-gallery-wrapper .product-gallery {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}
.modern-gallery-wrapper img {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Box Đặc điểm nổi bật (KSP - Key Selling Points) */
.modern-box-ksp {
  background: var(--fl-p-gray-bg);
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.modern-box-ksp h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fl-p-text-main);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modern-box-ksp ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modern-box-ksp li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}
.modern-box-ksp li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
}

/* Box Cam kết & Chính sách uy tín */
.modern-box-commit {
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  padding: 14px 16px;
  background: #ffffff;
  margin-bottom: 16px;
}
.modern-commit-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fl-p-text-main);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modern-commit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 576px) {
  .modern-commit-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.modern-commit-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}
.modern-commit-item .icon {
  font-size: 16px;
  line-height: 1;
}

/* Cột Phải: Price Box */
.modern-price-box {
  background: #ffffff;
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}
.modern-sale-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--fl-p-red);
  line-height: 1;
}
@media (min-width: 768px) {
  .modern-sale-price {
    font-size: 30px;
  }
}
.modern-regular-price {
  font-size: 15px;
  color: var(--fl-p-text-muted);
  text-decoration: line-through;
}
.modern-discount-badge {
  background: var(--fl-p-red-light);
  color: var(--fl-p-red);
  border: 1px solid var(--fl-p-red-border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
}

/* Box Khuyến Mãi (Promotion) */
.modern-box-promo {
  border: 1px solid var(--fl-p-red-border);
  background: var(--fl-p-red-light);
  border-radius: var(--fl-p-radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.modern-promo-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--fl-p-red);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modern-promo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modern-promo-list li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.45;
}
.modern-promo-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fl-p-red);
}

/* Cụm Nút Mua Hàng Siêu Nổi Bật (CTA Hiện Đại & Sang Trọng) */
.modern-cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Nút Chính: Yêu Cầu Báo Giá Nhanh */
.modern-btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #d70018 0%, #b30014 100%);
  color: #ffffff !important;
  border-radius: 10px;
  padding: 13px 20px;
  text-align: center;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(215, 0, 24, 0.32);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.modern-btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(215, 0, 24, 0.42);
  background: linear-gradient(135deg, #e6001a 0%, #c40016 100%);
  color: #ffffff !important;
}
.modern-btn-main:active {
  transform: translateY(0);
}
.modern-btn-main .btn-icon {
  font-size: 24px;
  line-height: 1;
}
.modern-btn-main .btn-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.modern-btn-main .btn-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.25;
  text-transform: uppercase;
  color: #ffffff;
}
.modern-btn-main .btn-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #fef08a; /* Vàng kim sang trọng */
  margin-top: 2px;
  line-height: 1.2;
}

/* Cụm 2 Nút Phụ Bên Dưới (Hotline & Zalo) */
.modern-cta-subgroup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modern-btn-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.modern-btn-sub .sub-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.modern-btn-sub .sub-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}
.modern-btn-sub .sub-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.modern-btn-sub .sub-val {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nút Hotline: Trắng Viền Đỏ Sang Trọng */
.modern-btn-hotline {
  background: #fff;
  border: 1.5px solid #fecdd3;
  color: #b91c1c !important;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.05);
}
.modern-btn-hotline:hover {
  background: #fef2f2;
  border-color: #f87171;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.12);
  color: #991b1b !important;
}
.modern-btn-hotline .sub-label {
  color: #991b1b;
}
.modern-btn-hotline .sub-val {
  color: #b91c1c;
}

/* Nút Zalo: Gradient Xanh Zalo Chính Hãng */
.modern-btn-zalo {
  background: linear-gradient(135deg, #0084ff 0%, #0068ff 100%);
  border: 1.5px solid #0068ff;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 104, 255, 0.22);
}
.modern-btn-zalo:hover {
  background: linear-gradient(135deg, #0077e6 0%, #0056d6 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.35);
  color: #ffffff !important;
}
.modern-btn-zalo .sub-label {
  color: #e0f2fe;
}
.modern-btn-zalo .sub-val {
  color: #ffffff;
}

/* 3. Phần Thân Dưới (2 Cột: 65% / 35%) */
.modern-product-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}
@media (min-width: 992px) {
  .modern-product-body {
    flex-direction: row;
    align-items: flex-start;
  }
  .modern-body-left {
    flex: 0 0 64%;
    max-width: 64%;
  }
  .modern-body-right {
    flex: 0 0 36%;
    max-width: 36%;
    position: sticky;
    top: 90px;
  }
}
/* Khi không có cột specs (adaptive) */
.modern-body-left.is-fullwidth {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* Cột Trái Thân Dưới: Bài viết mô tả */
.modern-content-box {
  background: #ffffff;
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.modern-content-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fl-p-text-main);
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fl-p-red);
  display: inline-block;
}
.modern-article-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.modern-article-wrapper.is-collapsed {
  max-height: 600px;
}
.modern-article-wrapper.is-collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
  pointer-events: none;
}
.modern-btn-readmore {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 16px auto 0 auto;
  padding: 9px 16px;
  background: #ffffff;
  border: 1px solid var(--fl-p-red);
  color: var(--fl-p-red);
  border-radius: 20px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.modern-btn-readmore:hover {
  background: var(--fl-p-red);
  color: #ffffff;
}

/* Cột Phải Thân Dưới: Bảng Thông Số Kỹ Thuật */
.modern-specs-box {
  background: #ffffff;
  border: 1px solid var(--fl-p-gray-border);
  border-radius: var(--fl-p-radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.modern-specs-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fl-p-text-main);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modern-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-bottom: 12px;
  table-layout: fixed;
  word-wrap: break-word;
}
.modern-specs-table tr {
  border-bottom: 1px solid #f1f5f9;
}
.modern-specs-table tr:nth-child(odd) {
  background: #f8fafc;
}
.modern-specs-table th,
.modern-specs-table td {
  padding: 10px 12px;
  text-align: left;
  line-height: 1.45;
}
.modern-specs-table th {
  font-weight: 600;
  color: #475569;
  width: 42%;
}
.modern-specs-table td {
  color: #1e293b;
  font-weight: 500;
}
.modern-btn-full-specs {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px dashed #10b981;
  color: #047857;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.modern-btn-full-specs:hover {
  background: #10b981;
  color: #ffffff;
}

/* 4. POPUP MODAL BÁO GIÁ NHANH */
.modern-quote-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modernFadeIn 0.25s ease-out;
}
@keyframes modernFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modern-quote-modal-box {
  background: #ffffff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 24px 28px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modernScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modernScaleIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modern-quote-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.modern-quote-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.modern-quote-modal-header {
  text-align: center;
  margin-bottom: 18px;
}
.modern-quote-modal-header .modal-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.modern-quote-modal-header .modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.modern-quote-modal-header .modal-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.quote-product-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #334155;
  margin-bottom: 14px;
}
.quote-product-badge strong {
  color: var(--fl-p-red);
}
.quote-form-group {
  margin-bottom: 14px;
}
.quote-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}
.quote-form-group input,
.quote-form-group textarea {
  width: 100% !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.quote-form-group input:focus,
.quote-form-group textarea:focus {
  border-color: var(--fl-p-red) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(215, 0, 24, 0.12) !important;
}
.quote-form-message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
}
.quote-form-message.is-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.quote-form-message.is-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

