/* ========================================
   PRODUCT PRICE & VARIANTS STYLES
   Hiển thị giá, biến thể sản phẩm TGGD style
   ======================================== */

/* ========================================
   1. PRICE DISPLAY
   ======================================== */

.tggd-product-price {
  display: flex;
  align-items: center;
  gap: var(--tggd-spacing-md);
  margin-bottom: var(--tggd-spacing-lg);
  flex-wrap: wrap;
}

/* Original Price (Strikethrough) */
.tggd-price-original {
  font-size: var(--tggd-font-size-lg);
  color: var(--tggd-medium-gray);
  text-decoration: line-through;
  font-weight: 400;
}

/* Current Price (Red, Bold) */
.tggd-price-current {
  font-size: var(--tggd-font-size-3xl);
  font-weight: 700;
  color: #eb0707;
  line-height: 1;
}

/* Price Currency */
.tggd-price-currency {
  font-size: 0.6em;
  vertical-align: super;
}

/* Discount Badge */
.tggd-price-discount {
  background-color: #eb0707;
  color: var(--tggd-white);
  padding: var(--tggd-spacing-xs) var(--tggd-spacing-md);
  border-radius: var(--tggd-radius-md);
  font-weight: 700;
  font-size: var(--tggd-font-size-sm);
}

/* Price Range */
.tggd-price-range {
  font-size: var(--tggd-font-size-lg);
  color: #eb0707;
  font-weight: 600;
}

/* Price Info */
.tggd-price-info {
  display: flex;
  flex-direction: column;
  gap: var(--tggd-spacing-xs);
  font-size: var(--tggd-font-size-sm);
  color: var(--tggd-medium-gray);
}

.tggd-price-info-item {
  display: flex;
  align-items: center;
  gap: var(--tggd-spacing-sm);
}

.tggd-price-info-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   2. PRODUCT VARIANTS
   ======================================== */

.tggd-product-variants {
  margin-bottom: var(--tggd-spacing-xl);
}

.tggd-variant-group {
  margin-bottom: var(--tggd-spacing-lg);
}

.tggd-variant-label {
  display: block;
  font-weight: 600;
  font-size: var(--tggd-font-size-base);
  color: var(--tggd-dark-gray);
  margin-bottom: var(--tggd-spacing-md);
}

.tggd-variant-label-required::after {
  content: " *";
  color: var(--tggd-danger);
}

/* Variant Options Container */
.tggd-variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tggd-spacing-md);
}

/* Variant Option Button */
.tggd-variant-option {
  padding: var(--tggd-spacing-md) var(--tggd-spacing-lg);
  border: 2px solid var(--tggd-border-gray);
  background-color: var(--tggd-white);
  color: var(--tggd-dark-gray);
  border-radius: var(--tggd-radius-md);
  cursor: pointer;
  font-size: var(--tggd-font-size-base);
  font-weight: 500;
  transition: all var(--tggd-transition-fast);
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

.tggd-variant-option:hover {
  border-color: var(--tggd-primary);
  background-color: rgba(227, 6, 19, 0.05);
}

.tggd-variant-option.active {
  border-color: var(--tggd-primary);
  background-color: var(--tggd-primary);
  color: var(--tggd-white);
  box-shadow: var(--tggd-shadow-md);
}

.tggd-variant-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--tggd-light-gray);
  border-color: var(--tggd-border-gray);
}

.tggd-variant-option:disabled:hover {
  border-color: var(--tggd-border-gray);
  background-color: var(--tggd-light-gray);
}

/* Variant Option with Price */
.tggd-variant-option-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tggd-spacing-xs);
}

.tggd-variant-option-name {
  font-weight: 600;
}

.tggd-variant-option-price-value {
  font-size: var(--tggd-font-size-sm);
  color: #eb0707;
}

/* Color Swatch */
.tggd-variant-color {
  width: 40px;
  height: 40px;
  border-radius: var(--tggd-radius-md);
  border: 2px solid var(--tggd-border-gray);
  cursor: pointer;
  transition: all var(--tggd-transition-fast);
  position: relative;
  overflow: hidden;
}

.tggd-variant-color:hover {
  border-color: var(--tggd-primary);
  transform: scale(1.05);
}

.tggd-variant-color.active {
  border-color: var(--tggd-primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.2);
}

.tggd-variant-color.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--tggd-white);
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Variant Dropdown */
.tggd-variant-select {
  width: 100%;
  padding: var(--tggd-spacing-md);
  border: 2px solid var(--tggd-border-gray);
  border-radius: var(--tggd-radius-md);
  font-size: var(--tggd-font-size-base);
  color: var(--tggd-dark-gray);
  background-color: var(--tggd-white);
  cursor: pointer;
  transition: all var(--tggd-transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--tggd-spacing-md) center;
  padding-right: calc(var(--tggd-spacing-lg) * 2);
}

.tggd-variant-select:hover {
  border-color: var(--tggd-primary);
}

.tggd-variant-select:focus {
  outline: none;
  border-color: var(--tggd-primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

/* ========================================
   3. QUANTITY SELECTOR
   ======================================== */

.tggd-quantity-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--tggd-border-gray);
  border-radius: var(--tggd-radius-md);
  width: fit-content;
  background-color: var(--tggd-white);
}

.tggd-quantity-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  color: var(--tggd-dark-gray);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tggd-transition-fast);
}

.tggd-quantity-btn:hover {
  background-color: var(--tggd-light-gray);
  color: var(--tggd-primary);
}

.tggd-quantity-btn:active {
  background-color: var(--tggd-border-gray);
}

.tggd-quantity-input {
  width: 50px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--tggd-border-gray);
  border-right: 1px solid var(--tggd-border-gray);
  text-align: center;
  font-size: var(--tggd-font-size-base);
  font-weight: 600;
  color: var(--tggd-dark-gray);
  background-color: transparent;
}

.tggd-quantity-input:focus {
  outline: none;
}

/* Remove spinner from number input */
.tggd-quantity-input::-webkit-outer-spin-button,
.tggd-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tggd-quantity-input[type=number] {
  -moz-appearance: textfield;
}

/* ========================================
   4. VARIANT SUMMARY
   ======================================== */

.tggd-variant-summary {
  background-color: var(--tggd-light-gray);
  padding: var(--tggd-spacing-lg);
  border-radius: var(--tggd-radius-md);
  margin-bottom: var(--tggd-spacing-lg);
}

.tggd-variant-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--tggd-spacing-md);
  font-size: var(--tggd-font-size-base);
}

.tggd-variant-summary-item:last-child {
  margin-bottom: 0;
  padding-top: var(--tggd-spacing-md);
  border-top: 1px solid var(--tggd-border-gray);
  font-weight: 600;
  font-size: var(--tggd-font-size-lg);
}

/* ========================================
   5. SINGLE PRODUCT DMX-LIKE LAYOUT
   ======================================== */

.single-product .product-main .product-title {
  color: #0d2848;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.single-product .price-wrapper .price,
.single-product .price-wrapper .woocommerce-Price-amount {
  color: #eb0707;
  font-weight: 800;
}

.single-product form.variations_form {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid #dbe8f5;
  border-radius: 12px;
  padding: 14px;
}

.single-product form.variations_form table.variations {
  margin-bottom: 12px;
}

.single-product form.variations_form table.variations td,
.single-product form.variations_form table.variations th,
.single-product form.variations_form table.variations tr {
  display: block;
  width: 100%;
}

.single-product form.variations_form table.variations label {
  color: #0d2848;
  font-weight: 700;
  margin-bottom: 6px;
}

.single-product form.variations_form table.variations select {
  border: 1px solid #bcd0e5;
  border-radius: 8px;
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
}

.single-product form.variations_form .single_variation_wrap {
  margin-top: 8px;
}

.single-product .single_variation_wrap .woocommerce-variation-add-to-cart {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.single-product .quantity.buttons_added {
  border: 1px solid #d3e1ef;
  border-radius: 8px;
  overflow: hidden;
}

.single-product .quantity.buttons_added input.qty {
  min-height: 42px;
  min-width: 52px;
  font-weight: 700;
  color: #0d2848;
}

.single-product .quantity.buttons_added .plus,
.single-product .quantity.buttons_added .minus {
  min-height: 42px;
  min-width: 34px;
  color: #0d2848;
}

.single-product .single_add_to_cart_button {
  background: linear-gradient(135deg, #0d2848 0%, #1a4f87 100%) !important;
  border: 1px solid #0d2848 !important;
  border-radius: 8px !important;
  min-height: 42px;
  padding: 0 20px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px;
}

.single-product .single_add_to_cart_button:hover {
  filter: brightness(1.06);
}

@media (max-width: 768px) {
  .single-product .single_variation_wrap .woocommerce-variation-add-to-cart {
    gap: 8px;
  }

  .single-product .single_add_to_cart_button {
    width: 100%;
    order: 2;
  }

  .single-product .quantity.buttons_added {
    order: 1;
  }
}

.tggd-variant-summary-label {
  color: var(--tggd-medium-gray);
}

.tggd-variant-summary-value {
  color: var(--tggd-dark-gray);
  font-weight: 600;
}

/* ========================================
   5. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .tggd-product-price {
    flex-direction: column;
    gap: var(--tggd-spacing-sm);
  }
  
  .tggd-price-current {
    font-size: var(--tggd-font-size-2xl);
  }
  
  .tggd-variant-options {
    gap: var(--tggd-spacing-sm);
  }
  
  .tggd-variant-option {
    flex: 1;
    min-width: 70px;
    padding: var(--tggd-spacing-sm) var(--tggd-spacing-md);
    font-size: var(--tggd-font-size-sm);
  }
  
  .tggd-variant-color {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .tggd-price-current {
    font-size: var(--tggd-font-size-xl);
  }
  
  .tggd-variant-options {
    gap: var(--tggd-spacing-xs);
  }
  
  .tggd-variant-option {
    flex: 0 0 calc(50% - var(--tggd-spacing-xs));
    padding: var(--tggd-spacing-sm);
    font-size: 12px;
  }
  
  .tggd-quantity-selector {
    width: 100%;
  }
  
  .tggd-quantity-btn {
    flex: 1;
  }
  
  .tggd-quantity-input {
    flex: 1;
  }
}
