/**
 * TP Dịch Vụ Pricing Section
 * Pricing table styles for dịch vụ post type
 * 
 * @package Flatsome Child
 * @version 1.0.0
 */

/* Pricing Section */
.tp-sv-pricing {
  position: relative;
  background-color: #f9fafb;
  padding: 30px 0;
}

.tp-sv-pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .tp-sv-pricing-grid {
    grid-template-columns: 800px 1fr;
    align-items: start;
  }
}

/* --- Bố cục Grid chính --- */
.tp-sv-pricing-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
}

/* --- Cột bên trái --- */
.tp-sv-pricing-left {
  min-width: 0;
}

.tp-sv-pricing-title {
  font-size: var(--font-size-3xl);
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--tp-gray-900);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

/* --- Wrapper cho Table (tạo scroll) --- */
.tp-sv-pricing-wrapper {
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
}

/* --- Định dạng cho Table --- */

.tp-sv-pricing-table th,
.tp-sv-pricing-table td {
  padding: 12px 15px !important;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap; /* Ngăn text xuống dòng */
}

.tp-sv-pricing-table td:first-child,
.tp-sv-pricing-table th:first-child {
  text-align: left;
  font-weight: bold;
}

.tp-sv-pricing-table thead {
  background-color: #f8f8f8;
}

.tp-sv-pricing-table tbody tr:last-child td {
  border-bottom: none; /* Bỏ border dòng cuối */
}

/* --- Cột bên phải (Hình ảnh) --- */
.tp-sv-pricing-image img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- Responsive cho điện thoại --- */
@media (max-width: 768px) {
  .tp-sv-pricing-grid {
    grid-template-columns: 1fr;
  }
}

.tp-sv-pricing-wrapper::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 5px;
}

.tp-sv-pricing-wrapper::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 5px;
}

.tp-sv-pricing-wrapper::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.tp-sv-pricing-wrapper::-webkit-scrollbar-corner {
  background: #f3f4f6;
}

/* Table styles - 100% width of wrapper */
.tp-sv-pricing-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: auto;
  margin-bottom: 0px;
}

.tp-sv-pricing-table th,
.tp-sv-pricing-table td {
  min-width: 100px;
  width: 100px;
  height: 50px;
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-sv-pricing-table th:first-child,
.tp-sv-pricing-table td:first-child {
  min-width: 120px;
  width: 120px;
}

.tp-sv-pricing-table th:last-child,
.tp-sv-pricing-table td:last-child {
  border-right: none;
}

.tp-sv-pricing-table th {
  background: linear-gradient(
    90deg,
    rgba(238, 64, 42, 1) 0%,
    rgba(242, 77, 56, 1) 50%,
    rgba(247, 94, 74, 1) 100%
  );
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
  height: 50px;
}

.tp-sv-pricing-table th:first-child {
  background: #12874B;
  border-top-left-radius: 5px;
  position: sticky;
  left: 0;
  z-index: 11;
}

.tp-sv-pricing-table th:last-child {
  border-top-right-radius: 5px;
}

.tp-sv-pricing-table td:first-child {
  background: #f8fafc;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 5;
  border-right: 2px solid #e5e7eb;
}

.tp-sv-pricing-table tbody tr:hover {
  background: #f1f5f9;
  transition: background-color 0.2s ease;
}

.tp-sv-pricing-table tbody tr:hover td:first-child {
  background: #e2e8f0;
}

.tp-sv-pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.tp-sv-pricing-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 5px;
}

.tp-sv-pricing-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 5px;
}

/* Price styling */
.tp-sv-pricing-table td:not(:first-child) {
  font-weight: 600;
  color: #059669;
  position: relative;
}

.tp-sv-pricing-table td:not(:first-child):after {
  content: " VND";
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
}

/* Right Column - Image */
.tp-sv-pricing-right {
  height: 100%;
  transition: all ease 0.5s;
}

.tp-sv-pricing-image {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.tp-sv-pricing-image img {
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tp-sv-pricing-image:hover img {
  transform: scale(1.05);
}

/* Scroll hint */
.tp-sv-pricing-left .scroll-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
  display: none;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .tp-sv-pricing-title {
    font-size: var(--font-size-2xl);
    text-align: center;
  }

  .tp-sv-pricing-table th,
  .tp-sv-pricing-table td {
    padding: 12px 8px !important;
    font-size: 12px;
  }
  .tp-sv-pricing-left .scroll-hint {
    display: block;
  }
}