/* ======== Tabs ======== */
.pkg_tabs_wrap {
  position: relative;
  border-radius: 4px;
  background: #1D6070;
  margin-bottom: 32px;
  overflow: hidden;
}
.pkg_tabs {
  display: flex;
  align-items: stretch;
  min-height: 64px;
}
.pkg_tabs.pkg_tabs_scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pkg_tabs.pkg_tabs_scroll::-webkit-scrollbar {
  display: none;
}
.pkg_tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.pkg_tabs_scroll .pkg_tab {
  flex: none;
  width: calc(100% / 6);
}
.pkg_tab.on {
  background: #A7DEE8;
  color: #2B2B2B;
  font-weight: 600;
}
.pkg_tab:hover:not(.on) {
  background: rgba(167, 222, 232, 0.2);
}
/* Scroll nav arrows */
.pkg_tabs_arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  background-repeat: no-repeat;
  background-position: center;
  background-image: url(https://cdn.aosomcdn.com/upload/tem/new_ui/images/act-arrow-right-small.svg);
  user-select: none;
}
.pkg_tabs_arrow.hide {
  display: none;
}
.pkg_tabs_arrow_left {
  left: 8px;
  transform: translateY(-50%) scaleX(-1);
}
.pkg_tabs_arrow_right {
  right: 8px;
}

/* ======== Scene Image ======== */
.pkg_scene_wrap {
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  background: #EFF4FE;
  /* Aspect ratio placeholder to prevent CLS */
  position: relative;
  padding-bottom: 61.875%; /* 990/1600 = 0.61875 */
}
.pkg_scene_item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.pkg_scene_img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ======== Products Section ======== */
.pkg_products_wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.pkg_section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pkg_section_title {
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.act_package_promotion .pkg_section_title_text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: #2B2B2B !important;
  display: inline-block;
}
.act_package_promotion .pkg_section_title_text::first-letter {
  color: #DC2F2F !important;
}
.pkg_section_list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ======== Promotion Item ======== */
.pkg_promotion_item {
  padding: 20px;
  background: #F2F3F5;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.pkg_product_row_wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.pkg_product_row {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pkg_product_row::-webkit-scrollbar {
  display: none;
}
/* Scroll arrows - on the wrapper, fixed position relative to viewport of products */
.pkg_scroll_arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.10);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #2B2B2B;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  background-position: 50%;
  background-repeat: no-repeat;
  background-image: url(https://cdn.aosomcdn.com/upload/tem/new_ui/images/act-arrow-right-small.svg);
}
.pkg_scroll_arrow.show {
  display: flex;
}
.pkg_scroll_arrow_left {
  left: 8px;
  transform: translateY(-50%) scaleX(-1);
}
.pkg_scroll_arrow_right {
  right: 8px;
}

/* ======== Product Card ======== */
.pkg_product_card {
  flex-shrink: 0;
  width: 116px;
  padding: 8px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-sizing: border-box;
}
.pkg_product_card_cheaper {
  border: 0.5px solid transparent;
  transition: border-color 0.2s;
}
.pkg_product_card_cheaper.on {
  border-color: #8E9299;
}
.pkg_product_img_link {
  display: block;
  position: relative;
}
.pkg_product_img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.pkg_sold_out {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  text-align: center;
  font-size: 10px;
  padding: 2px 0;
  border-radius: 0 0 4px 4px;
}
.pkg_product_price_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pkg_product_price {
  font-size: 14px;
  font-weight: 700;
  color: #2B2B2B;
  line-height: 1.3;
}
.pkg_product_price .pkg_price_decimal {
  font-size: 12px;
}
.pkg_product_qty {
  font-size: 12px;
  font-weight: 600;
  color: #2B2B2B;
  background: #F2F3F5;
  border-radius: 4px;
  padding: 2px 4px;
}
.pkg_product_name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: #2B2B2B;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ======== Product Select Checkbox (cheaper only) ======== */
.pkg_product_select {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid #C9CDD4;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  z-index: 2;
}
.pkg_product_select.selected {
  background: #2B2B2B;
  border-color: #2B2B2B;
}
.pkg_product_select.selected::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ======== Plus Icon between cards ======== */
.pkg_icon_plus {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('https://cdn.aosomcdn.com/upload/tem/new_ui/images/pkg_add.png') center center no-repeat;
}
.pkg_icon_plus span {
  font-size: 15px;
  font-weight: 600;
  color: #2B2B2B;
  line-height: 1;
}

/* ======== Equal Icon ======== */
.pkg_icon_equal {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('https://cdn.aosomcdn.com/upload/tem/new_ui/images/pkg_pause.png') center center no-repeat;
}
.pkg_icon_equal span {
  font-size: 15px;
  font-weight: 600;
  color: #2B2B2B;
  line-height: 1;
}

/* ======== Settlement ======== */
.pkg_settlement {
  flex-shrink: 0;
  width: 250px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  align-self: stretch;
}
.pkg_settlement_left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pkg_settlement.pkg_main_only .pkg_origin_price,
.pkg_settlement.pkg_main_only .pkg_save_text {
  display: none;
}
.pkg_total_price {
  font-size: 24px;
  font-weight: 700;
  color: #DC2F2F;
  line-height: 1.3;
}
.pkg_total_price .pkg_price_decimal {
  font-size: 12px;
}
.pkg_origin_price {
  font-size: 14px;
  color: #8E9299;
  text-decoration: line-through;
}
.pkg_save_text {
  font-size: 14px;
  color: #2B2B2B;
}
.pkg_settlement_right {
  width: 100%;
}
.pkg_add_cart,
.pkg_add_disable {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.pkg_add_cart {
  background: #181818;
  color: #fff;
}
.pkg_add_cart:hover {
  opacity: 0.85;
}
.pkg_add_disable {
  background: #E5E6EB;
  color: #8E9299;
  cursor: not-allowed;
}

/* ======== PC (>=768px) ======== */
@media (min-width: 768px) {
  .pkg_tabs {
    min-height: 64px;
  }
  .pkg_tab {
    font-size: 18px;
    padding: 0 32px;
  }
  .pkg_product_card {
    width: 226px;
    padding: 16px;
    gap: 12px;
  }
  .pkg_promotion_item {
    padding: 20px;
    border-radius: 8px;
  }
  .pkg_product_price {
    font-size: 24px;
  }
  .pkg_product_price .pkg_price_decimal {
    font-size: 16px;
  }
  .pkg_total_price {
    font-size: 24px;
  }
  .pkg_total_price .pkg_price_decimal {
    font-size: 14px;
  }
  .pkg_settlement {
    padding: 16px;
  }
  .act_package_promotion .pkg_section_title_text {
    font-size: 24px;
  }
  .pkg_scene_wrap {
    margin-bottom: 20px;
  }
}

/* ======== Mobile (<=767px) ======== */
@media (max-width: 767px) {
  .pkg_tabs_wrap {
    margin-bottom: 12px;
  }
  .pkg_tabs {
    min-height: 40px;
  }
  .pkg_tab {
    font-size: 12px;
    font-weight: 600;
    padding: 0 16px;
    letter-spacing: 0.01em;
    width: auto !important;
    flex: none !important;
  }
  .pkg_tabs_arrow {
    display: none !important;
  }
  .pkg_tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pkg_tabs::-webkit-scrollbar {
    display: none;
  }
  .pkg_promotion_item {
    padding: 12px;
    border-radius: 4px;
    flex-direction: column;
    gap: 12px;
  }
  .pkg_product_row_wrap {
    width: 100%;
    overflow: visible;
  }
  .pkg_product_card {
    width: 116px;
    padding: 8px;
    gap: 8px;
  }
  .pkg_icon_equal {
    display: none;
  }
  .pkg_tabs_arrow {
    display: none !important;
  }
  .pkg_scroll_arrow {
    display: none !important;
  }
  .pkg_settlement {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    align-self: auto;
  }
  .pkg_settlement_left {
    align-items: flex-start;
  }
  .pkg_settlement_right {
    width: auto;
  }
  .pkg_total_price {
    font-size: 20px;
  }
  .pkg_section {
    gap: 12px;
  }
  .pkg_section_title {
    justify-content: flex-start;
  }
  .pkg_section_list {
    gap: 12px;
  }
  .pkg_products_wrap {
    gap: 20px;
  }
  .act_package_promotion .pkg_section_title_text {
    font-size: 18px;
  }
}

/* ======== Builder Nav (only in /builder/ environment) ======== */
.pkg_builder_nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0;
}
.pkg_builder_prev,
.pkg_builder_next {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1890ff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.pkg_builder_prev:hover,
.pkg_builder_next:hover {
  background: #1079e0;
}
.pkg_builder_index {
  font-size: 16px;
  font-weight: 600;
  color: #2B2B2B;
}
