/* === Product Variation Table Styles (Norul Amin Custom v1.8) === */
.variation-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.5); /* transparent Blocksy style */
  backdrop-filter: blur(6px);
  border-radius: 10px;
  border: 1px solid var(--ct-border-color, #e5e5e5);
}

/* === Table Header === */
.variation-table th {
  background: var(--ct-table-head-bg, rgba(240, 240, 240, 0.6));
  color: var(--ct-color-heading, #333);
  font-weight: 600;
  text-align: center;
  padding: 2px 2px;
  border-bottom: 1px solid var(--ct-border-color, #e5e5e5);
}

/* === Table Cells === */
.variation-table td {
  padding: 2px 2px;
  text-align: center;
  border-bottom: 1px solid var(--ct-border-color, #ececec);
  color: var(--ct-color-base, #333);
  background: transparent;
}

/* Hover Row */
.variation-table tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* === Checkbox Column === */
.variation-table td:first-child {
  width: 40px;
  text-align: center;
  padding: 2px 0;
}

/* === Image Column === */
.variation-table td:nth-child(2) img {
  width: 60px;
  height: 60px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}
.variation-table td:nth-child(2) img:hover {
  transform: scale(1.05);
}

/* === Variation / SKU Column === */
.variation-table td:nth-child(3) {
  text-align: left;
  word-break: break-word;
  white-space: normal;
}

/* === Price Column === */
.variation-table td:nth-child(4),
.variation-table th:nth-child(4) {
  width: 40px;
  min-width: 30px;
}

/* === Qty Column (Updated v1.8) === */
.variation-table td:nth-child(5),
.variation-table th:nth-child(5) {
  width: 100px;
  min-width: 80px;
  text-align: center;
  padding: 1px !important; /* remove padding */
}

/* Qty Controls Wrapper */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

/* Remove number input arrows */
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-control input[type="number"] {
  -moz-appearance: textfield;
}

/* ✅ Clean Qty Input (No Border, Auto Fit for Long Numbers) */
.qty-control input {
  width: auto;
  min-width: 20px; /* fits 5 digits comfortably */
  max-width: 60px;
  text-align: center;
  border: none !important;
  border-radius: 0 !important;
  height: 28px;
  font-size: 14px;
  padding: 0 !important;
  background: transparent;
  color: var(--ct-color-base, #333);
  outline: none !important;
}

/* Qty Buttons (+, -) */
.qty-control button {
  border: 1px solid var(--ct-border-color, #ccc);
  background: transparent;
  width: 28px;
  height: 28px;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 16px;
  cursor: pointer;
  color: var(--ct-color-heading, #333);
  transition: background 0.2s ease-in-out, color 0.2s;
}
.qty-control button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ct-color-primary, #2b7cff);
}

/* === Responsive for iPhone 12 Pro (~390px) === */
@media (max-width: 420px) {
  .variation-table th {
    font-size: 13px;
    padding: 6px;
  }
  .variation-table td {
    padding: 2px;
  }
  .variation-table td:nth-child(2) img {
    width: 60px;
    height: 60px;
  }
  .variation-table td:nth-child(3) {
    font-size: 13px;
    max-width: 140px;
  }
  .variation-table td:nth-child(4),
  .variation-table th:nth-child(4) {
    width: 50px;
    min-width: 50px;
  }
  .variation-table td:nth-child(5),
  .variation-table th:nth-child(5) {
    width: 100px;
    min-width: 80px;
  }
  .qty-control input {
    min-width: 30px;
    max-width: 50px;
  }
  .qty-control button {
    width: 20px;
    height: 20px;
  }
}

/* === Total Row === */
.variation-total-row {
  text-align: right;
  font-weight: 600;
  padding: 4px 0;
  font-size: 15px;
  border-top: 2px solid var(--ct-border-color, #ddd);
  color: var(--ct-color-heading, #333);
}

/* === Add to Cart Button === */
.variation-add-to-cart {
  background: var(--ct-color-primary, #2b7cff);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s ease-in-out;
}
.variation-add-to-cart:hover {
  background: var(--ct-color-primary-hover, #1f63d1);
}

/* === Hide Default WooCommerce Form === */
form.variations_form,
.single_add_to_cart_button {
  display: none !important;
}
