/**
 * Package Card Component
 * Node IDs: 100-65038, 100-65068, 100-65099, 100-65129
 *
 * Card dimensions: 342px width, auto height
 * Components: Header, Price, Speed Details, CTA Button
 */

.package-card {
  /* Layout */
  display: flex;
  flex-direction: column;
  width: 342px;
  max-width: 342px;
  /* Visual */
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);

  /* Transitions */
  transition: all 0.3s ease;

  /* Prevent shrinking in flex container */
  flex-shrink: 0;
}

/* Hover effect */
.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.15);
}

/* Featured card variant (center card) */
.package-card--featured {
  box-shadow: var(--shadow-featured);
  position: relative;
}

.package-card--featured::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-orange);
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0.1;
}

/* =============================================
 * CARD HEADER SECTION (Blue Gradient)
 * ============================================= */

.package-card__header {
  position: relative;
  width: 100%;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

/* Header with complex content (has content/badges/images children) */
.package-card__header:has(.package-card__header-content),
.package-card__header:has(.package-card__header-badges),
.package-card__header:has(.package-card__header-images) {
  /* Complex header with gradient background and padding */
  padding: 20px 16px;
  min-height: 276px;
}

/* Header with only image (no content/badges/images children) */
.package-card__header:not(:has(.package-card__header-content)):not(:has(.package-card__header-badges)):not(:has(.package-card__header-images)) {
  /* Simple image-only header */
  padding: 0;
  gap: 0;
  min-height: auto;
}

.package-card__header-img {
  width: 100%;
  height: 100%;
  max-height: 276px;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}

.package-card__header-content {
  text-align: center;
  z-index: 2;
  margin-bottom: 6px;
}

.package-card__name {
  font-family: var(--font-primary);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.5px;
  text-align: center;
}

.package-card__speed-highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-bottom: 0;
}

.package-card__speed-value-large {
  font-family: var(--font-primary);
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.package-card__speed-unit {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 400;
  color: #ffffff;
}

.package-card__speed-label-small {
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Header badges row */
.package-card__header-badges {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 6px;
}

/* Feature badge */
.package-card__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  background: #FF7B2E;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-align: center;
  line-height: 1.2;
}

.package-card__badge svg {
  width: 16px;
  height: 16px;
}

/* Badge subtitle */
.package-card__badge-subtitle {
  font-size: 10px;
  font-weight: 400;
  color: #ffffff;
  text-transform: none;
}

/* Header product images */
.package-card__header-images {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0;
  gap: 20px;
}

.package-card__product-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.package-card__product-label {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 400;
  color: #ffffff;
  text-transform: uppercase;
  background: transparent;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
  text-align: center;
}

.package-card__product-img {
  height: 80px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.package-card__product-img--center {
  height: 100px;
}

/* Product label row */
.package-card__product-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.package-card__product-label-plus {
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: 700;
  color: #ff0000;
}

/* Legacy support */
.package-card__product-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}

.package-card__product-img--small {
  height: 45px;
}

.package-card__product-img--large {
  height: 55px;
}

/* =============================================
 * CARD IMAGE SECTION (Legacy support)
 * ============================================= */

.package-card__image {
  width: 100%;
  height: 240px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  position: relative;
}

.package-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
 * CARD CONTENT SECTION
 * ============================================= */

.package-card__content {
  padding: 20px;
  flex-direction: column;
  gap: 20px;
  /* Prevent shadow clipping */
  overflow: visible;
}

/* =============================================
 * PRICE SECTION
 * ============================================= */

.package-card__price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.package-card__price-main {
  display: flex;
  align-items: baseline;
}

.package-card__price-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: none;
  /* Hidden */
}

.package-card__price-icon svg {
  width: 100%;
  height: 100%;
}

.package-card__price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.package-card__price-value {
  font-family: var(--font-primary);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: #212121;
}

.package-card__price-currency {
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 400;
  color: #212121;
}

.package-card__price-period {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: #212121;
}

.package-card__price-note {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #666666;
  margin-top: 0px;
  padding-bottom: 16px;
}

/* =============================================
 * SPEED SECTION - Horizontal layout with icon
 * ============================================= */

.package-card__speed {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  background: #F7F7F8;
  border: 1px solid #1018281F;
  border-radius: 10px;
  box-shadow: none;
}

.package-card__speed-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.package-card__speed-label {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: #333333;
}

.package-card__speed-values {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.package-card__speed-item {
  display: flex;
  align-items: center;
  gap: 0;
}

.package-card__speed-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.package-card__speed-value {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  color: #212121;
}

.package-card__speed-odo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  object-fit: contain;
}

/* Speedometer needle animation */
.package-card__speed-odo path:last-child {
  transform-origin: 50% 100%;
  animation: speedometer-sweep 2s ease-in-out forwards;
}

@keyframes speedometer-sweep {
  0% {
    transform: rotate(-90deg);
    /* Start at 0% (left) */
  }

  60% {
    transform: rotate(90deg);
    /* Sweep to 100% (right) */
  }

  100% {
    transform: rotate(45deg);
    /* Settle at 75% */
  }
}

/* =============================================
 * CTA BUTTON
 * Normal: btn--outline style (transparent bg, orange border)
 * Hover: header__cta style (gradient bg with glow ring)
 * ============================================= */

.package-card__cta {
  margin-top: 16px;
  padding-top: 16px;
}

.package-card__button {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  padding: 13px 24px;

  /* Typography */
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;

  /* Visual - OUTLINE STYLE (default state) */
  background-color: transparent;
  border: 1px solid var(--color-primary, #F56011);
  color: var(--color-primary, #F56011);
  border-radius: 25px;

  /* Interaction */
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.package-card__button:hover {
  /* Transform to header__cta style with glow ring */
  background: linear-gradient(to bottom, #ff8f4b 0%, #ff5c00 100%);
  color: #FFFFFF;
  border: none;
  padding: 14px 25px;
  /* Compensate for removed 1px border (13px + 1px) */
  box-shadow:
    0 0 0 5px rgba(220, 38, 38, 0.1),
    /* Glow ring */
    0 6px 16px rgba(255, 107, 0, 0.35);
  /* Shadow */
  transform: scale(1.02);
}

.package-card__button:active {
  transform: scale(0.98);
  box-shadow:
    0 0 0 5px rgba(220, 38, 38, 0.1),
    0 4px 12px rgba(255, 107, 0, 0.3);
}

/* Standard card button (outline style) */
.package-card__button--outline {
  color: #FF7B2E;
  background: transparent;
  border: 2px solid #FF7B2E;
  box-shadow: none;
}

.package-card__button--outline:hover {
  background: #FF7B2E;
  color: #ffffff;
  box-shadow: 0px 4px 8px rgba(255, 123, 46, 0.3);
}

/* Featured card button (gradient style) */
.package-card__button--gradient {
  color: #ffffff;
  background: #FF7B2E;
  box-shadow: 0px 4px 8px rgba(255, 123, 46, 0.3);
}

.package-card__button--gradient:hover {
  background: #FF8A3D;
  box-shadow: 0px 6px 12px rgba(255, 123, 46, 0.4);
  transform: translateY(-2px);
}

/* =============================================
 * RESPONSIVE DESIGN
 * ============================================= */

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .package-card {
    width: 100%;
    max-width: 280px;
    min-height: auto;
  }

  .package-card__header {
    height: 205px;
  }

  .package-card__header-img {
    max-height: 205px;
  }

  .package-card__image {
    height: 200px;
  }

  .package-card__content {
    padding: 16px;
    gap: 12px;
  }

  .package-card__price-value {
    font-size: 24px;
  }

  .package-card__price-currency {
    font-size: 16px;
  }

  .package-card__speed {
    padding: 10px 12px;
  }

  .package-card__speed-label {
    font-size: 10px;
  }

  .package-card__speed-value {
    font-size: 12px;
  }

  .package-card__speed-icon {
    width: 16px;
    height: 16px;
  }

  .package-card__button {
    height: 44px;
    font-size: 14px;
  }

  .package-card__speed-odo {
    width: 45px;
    height: 45px;
  }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .package-card {
    width: 280px;
  }

  .package-card__image {
    height: 220px;
  }

  .package-card__content {
    padding: 16px;
  }
}

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
  .package-card {
    width: 342px;
    /* 4 cards in 1440px: (1440 - 3*24) / 4 */
  }

  .package-card__image {
    height: 240px;
  }
}