/*
 * Package Card T2 — horizontal row layout (Figma 240:6352).
 * Used inside [pdh_grid_v2_t2] / [pdh_grid_t2]. Each row = full-width
 * service product card: header strip + 4 cols (image / speed / features / price).
 */

/* Reset Flatsome bleed inside card scope.
   Flatsome có `.col-inner ul li { margin-left: 1.3em }` (0,1,2) và load
   thứ tự CSS chưa chắc đứng sau ours → match specificity không đủ.
   Bump (0,2,1): double-class `.pdh-card-t2 .pdh-card-t2__features` etc.
   thắng tuyệt đối. */
.pdh-card-t2 .pdh-card-t2__features,
.pdh-card-t2 .pdh-card-t2__features li,
.pdh-card-t2 .pdh-card-t2__features-block,
.pdh-card-t2 .pdh-card-t2__name,
.pdh-card-t2 .pdh-card-t2__features-block h4,
.pdh-card-t2 .pdh-card-t2__pricing p {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdh-card-t2 {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 16px;
  /* visible để tooltip note tràn ra ngoài card. Image col tự clip qua overflow riêng. */
  overflow: hidden;
  font-family: inherit;
  color: #3d3d3d;
  width: 100%;
  box-sizing: border-box;
  /* Shadow giống card t3 + hover đậm hơn. */
  box-shadow: 0 2px 32px -4px rgba(16, 24, 40, 0.04), 0 4px 16px 10px rgba(16, 24, 40, 0.02), 0 4px 4px -8px rgba(0, 0, 0, 0.03);
  transition: box-shadow .2s ease;
}
.pdh-card-t2:hover {
  box-shadow: 0 12px 32px 8px rgba(10, 13, 18, 0.15), 0 8px 8px -4px rgba(10, 13, 18, 0.03), 0 0 3px -1.5px rgba(10, 13, 18, 0.08);
}

/* Header strip ẩn — name đã chuyển sang cột pricing. */
.pdh-card-t2__header { display: none; }

.pdh-card-t2__name {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: #3d3d3d;
  text-align: center;
}

/* Body — 4-column row */
.pdh-card-t2__body {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.pdh-card-t2__col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 32px;
  border-right: 1.5px solid #e7e7e7;
  box-sizing: border-box;
}

.pdh-card-t2__col--pricing {
  border-right: 0;
}

/* Col 1 — image fixed 307×248 (Figma row "Gói Sky"). Padding=0 để ảnh
   chạm sát viền card; height cố định ép row body luôn ≥ 248. */
.pdh-card-t2__col--image {
  position: relative;
  width: 307px;
  height: 248px;
  flex-shrink: 0;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.pdh-card-t2__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badge — top-left của image col, mirror T1 (sparkles + text + bottom-right
   pill radius). Inline color override từ portal tags[0]. */
.pdh-card-t2__badge {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 15px 2px 10px;
  border-bottom-right-radius: 999px;
  background: #4564ed;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 700;
  z-index: 1;
}

.pdh-card-t2__badge--blue   { background: #4564ed; }
.pdh-card-t2__badge--red    { background: #ff2156; }
.pdh-card-t2__badge--green  { background: #02972c; }
.pdh-card-t2__badge--orange { background: #f24808; }

.pdh-card-t2__badge-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Col 2 — speed odo */
.pdh-card-t2__col--speed {
  width: 250px;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
}

.pdh-card-t2__speed-gauge {
  width: 92px;
  height: 56px;
}

.pdh-card-t2__speed-gauge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pdh-card-t2__speed-label {
  font-size: 16px;
  line-height: 24px;
  color: #3d3d3d;
  text-align: center;
  margin: 0;
}

.pdh-card-t2__speed-values {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pdh-card-t2__speed-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pdh-card-t2__speed-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pdh-card-t2__speed-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: #3d3d3d;
  white-space: nowrap;
}

/* Col 3 — features (Figma 240:8052: gap-24 outer / gap-12 inner / top-align)
   Anchor min-height = 248px (Figma h=200 + padding 24*2) để mọi card cùng
   chiều cao bất kể số dòng features. ul scroll trong khi title + "Xem thêm"
   neo cố định — pattern giống T1. */
.pdh-card-t2__col--features {
  flex: 1 0 0;
  min-width: 0;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 24px;
  /* Cố định cứng (không min-height) để ul force scroll khi vượt — image col
     fixed 248 không bị gap layout phía dưới khi features dài. */
  height: 248px;
}

.pdh-card-t2__features-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.pdh-card-t2__features-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.09px;
  color: #3d3d3d;
  width: 100%;
  flex-shrink: 0;
}

.pdh-card-t2__features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8c8c8 transparent;
}

.pdh-card-t2 .pdh-card-t2__features::-webkit-scrollbar { width: 4px; }
.pdh-card-t2 .pdh-card-t2__features::-webkit-scrollbar-thumb {
  background: #c8c8c8;
  border-radius: 2px;
}
.pdh-card-t2 .pdh-card-t2__features::-webkit-scrollbar-track { background: transparent; }

.pdh-card-t2__feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  line-height: 22px;
  color: #3d3d3d;
  margin: 0;
}

.pdh-card-t2__feature-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.pdh-card-t2__feature-text {
  flex: 1 0 0;
  min-width: 0;
}

.pdh-card-t2__detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px;
  font-size: 14px;
  font-weight: 510;
  line-height: 20px;
  color: var(--iw-accent);
  align-self: flex-start;
}

.pdh-card-t2__detail svg {
  width: 18px;
  height: 18px;
}

/* Col 4 — pricing */
.pdh-card-t2__col--pricing {
  width: 323px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.pdh-card-t2__pricing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pdh-card-t2__price-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pdh-card-t2__price-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #888;
  margin-right: 4px;
}

.pdh-card-t2__price-info {
  width: 18px;
  height: 18px;
  display: block;
  color: #888;
}

/* Tooltip wrap — icon đứng sau giá tiền, ngang baseline /tháng (period). */
.pdh-card-t2__price-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  margin-left: 4px;
  margin-bottom: 4px;
  cursor: help;
  outline: none;
  color: #888;
  transition: color 0.15s ease;
}

.pdh-card-t2__price-info-wrap:hover,
.pdh-card-t2__price-info-wrap:focus-visible {
  color: #3d3d3d;
}

/* Singleton tooltip share với T1 — định nghĩa ở t1/card.css (.iw-card-tooltip). */

.pdh-card-t2__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pdh-card-t2__price-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 44px;
  color: var(--iw-accent);
  white-space: nowrap;
}

.pdh-card-t2__price-period {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #888;
}

.pdh-card-t2__vat-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: #f3f3f3;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 510;
  line-height: 20px;
  color: #3d3d3d;
}

.pdh-card-t2__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 24px;
  background: var(--iw-cta-bg);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
  margin-top: 16px;
}

.pdh-card-t2__cta:hover,
.pdh-card-t2__cta:focus-visible {
  background: var(--iw-cta-bg-hover);
  color: #fff;
}

/* Skeleton shimmer */
.pdh-card-t2--skeleton .pdh-card-t2__col--features,
.pdh-card-t2--skeleton .pdh-card-t2__col--speed,
.pdh-card-t2--skeleton .pdh-card-t2__col--image,
.pdh-card-t2--skeleton .pdh-card-t2__col--pricing {
  gap: 12px;
}

.pdh-card-t2__sk {
  background: linear-gradient(90deg, #f0f0f0 25%, #e7e7e7 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: pdh-card-t2-shimmer 1.4s ease-in-out infinite;
}

.pdh-card-t2__sk--name     { width: 200px; height: 32px; }
.pdh-card-t2__sk--img      { width: 160px; height: 160px; border-radius: 12px; }
.pdh-card-t2__sk--speed    { width: 116px; height: 60px; border-radius: 60px 60px 0 0; }
.pdh-card-t2__sk--feature  { width: 100%; height: 22px; }
.pdh-card-t2__sk--feature-short { width: 60%; }
.pdh-card-t2__sk--price    { width: 160px; height: 44px; }
.pdh-card-t2__sk--cta      { width: 100%; height: 48px; border-radius: 999px; }

@keyframes pdh-card-t2-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive — ≤1199: stack dọc full-width (flex column).
   Layout:
     ┌─────────────┐
     │   image     │
     ├─────────────┤
     │   speed     │
     ├─────────────┤
     │  features   │
     ├─────────────┤
     │  pricing    │
     └─────────────┘
*/
@media (max-width: 1199px) {
  .pdh-card-t2__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: 1 1 auto;
  }

  .pdh-card-t2__col {
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    padding: 16px;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
    position: relative;
  }
  .pdh-card-t2__col + .pdh-card-t2__col::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #e7e7e7;
  }
  /* Speed col đã có gauge SVG ở vị trí top — bỏ divider để khỏi đè. */
  .pdh-card-t2__col--speed::before {
    display: none;
  }

  /* Image: full-width, tỉ lệ banner giống T1 v1/v2 (342:276) */
  .pdh-card-t2__col--image {
    width: 100%;
    height: auto;
    aspect-ratio: 342 / 276;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .pdh-card-t2__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Speed: gauge bên trái, bên phải label trên / speed values dưới */
  .pdh-card-t2__col--speed {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: 12px;
    row-gap: 4px;
  }
  .pdh-card-t2__speed-gauge {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .pdh-card-t2__speed-label {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
  }
  .pdh-card-t2__speed-values {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
  }
  .pdh-card-t2__speed-gauge { width: 60px; height: 36px; }
  .pdh-card-t2__speed-label { font-size: 13px; line-height: 18px; }
  .pdh-card-t2__speed-icon { width: 16px; height: 16px; }
  .pdh-card-t2__speed-value { font-size: 14px; line-height: 20px; }
  .pdh-card-t2__speed-values { gap: 12px; }

  /* Row 2: features full-width — cap 5 lines, scroll khi vượt.
     5 line × 22 + 4 gap × 12 = 158px ul. Title 24 + gap 16 + ul 158
     + gap 16 + detail 20 = 234. + padding 16*2 = 266px col fixed.
     Card height đồng nhất giữa các slide trong carousel. */
  /* Equal height giữa các card trong carousel: col-features fix height
     (padding 16*2 + title 24 + gap 12 + ul 70 + gap 12 + detail 20 = 170). */
  .pdh-card-t2__col--features {
    flex: 0 0 auto;
    height: 170px;
    align-items: stretch;
    gap: 12px;
  }
  .pdh-card-t2__features-block {
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
  }
  .pdh-card-t2__features {
    flex: 1 1 auto;
    height: 70px;
    max-height: 70px;
    overflow-y: auto;
  }
  .pdh-card-t2__feature { font-size: 14px; line-height: 22px; }
  .pdh-card-t2__features-title { font-size: 16px; line-height: 24px; }
  .pdh-card-t2__detail { align-self: center; }

  /* Row 3: pricing full-width, stack pricing-block + CTA full-width */
  .pdh-card-t2__col--pricing {
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    border-bottom: 0;
    margin-top: auto;
  }
  .pdh-card-t2__pricing { gap: 4px; }
  .pdh-card-t2__cta { width: 100%; margin-top: 8px; }

  .pdh-card-t2__name { font-size: 20px; line-height: 28px; }
  .pdh-card-t2__price-value { font-size: 28px; line-height: 36px; }
}

/* Link tên gói + ảnh → trang chi tiết. */
.pdh-card-t2__image-link { display: block; width: 100%; height: 100%; line-height: 0; }
.pdh-card-t2__name a { color: inherit; text-decoration: none; transition: color .15s; }
.pdh-card-t2__name a:hover { color: var(--iw-accent, #ff2881); }

/* đ glue vào số — cùng size/màu giá (đồng bộ t1/t3). */
.pdh-card-t2__price-currency { font-size: inherit; color: inherit; }
