/* =====================================================
   TR Shopping — Product Card Modal
   ===================================================== */

.tr-product-card-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.tr-product-card-modal.is-open {
  display: flex;
}

.tr-product-card-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.tr-product-card-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  height: min(700px, calc(100vh - 40px));
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.tr-product-card-modal__header {
  position: relative;
  flex: 0 0 auto;
  min-height: 64px;
  padding: 0 55px 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  background: #fff;
  box-sizing: border-box;
}

.tr-product-card-modal__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.tr-product-card-modal__close {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tr-danger);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr-product-card-modal__close::before {
  content: "Close";
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.tr-product-card-modal__close:hover {
  color: #ff6600;
}

.tr-product-card-modal__close:hover::before {
  color: #ff6600;
}

.tr-product-card-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 16px 16px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.tr-product-card-modal__product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tr-product-card-modal__product-image {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  background: #f7f7f7;
}

.tr-product-card-modal__product-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tr-product-card-modal__product-info {
  flex: 1;
  min-width: 0;
}

.tr-product-card-modal__product-name {
  margin: 0;
  color: #222;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.tr-product-card-modal__description-section {
  width: 100%;
  margin-top: 12px;
  padding-top: 6px;
  border-top: 1px solid #eee;
  box-sizing: border-box;
}

.tr-product-card-modal__product-description {
  margin: 0;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.tr-product-card-modal__product-description p {
  margin: 0 0 8px;
}

.tr-product-card-modal__product-description p:last-child {
  margin-bottom: 0;
}

.tr-product-card-modal__product-description ul,
.tr-product-card-modal__product-description ol {
  margin: 0 0 8px;
  padding-left: 20px;
}

.tr-product-card-modal__product-description li {
  margin-bottom: 4px;
}

.tr-product-card-modal__product-description br {
  line-height: 1.5;
}

.tr-product-card-modal__free-shipping-section {
  width: 100%;

  margin-top: 12px;
  padding: 10px;
  box-sizing: border-box;
  background: #eef5ff;
  border: 1px solid #dbe9ff;
}

.tr-product-card-modal__free-shipping-section[hidden] {
  display: none !important;
}

.tr-product-card-modal__free-shipping-title {
  color: var(--tr-ext-color-success, #008000);
  font-weight: 600;
  font-size: 14px;
}

.tr-product-card-modal__free-shipping-text {
  color: var(--tr-ext-color-success, #008000);
  font-size: 13px;
}

.tr-product-card-modal__variations-section {
  width: 100%;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  box-sizing: border-box;
}

.tr-product-card-modal__variation-group {
  margin-bottom: 15px;
}

.tr-product-card-modal__variation-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.tr-product-card-modal__variation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tr-product-card-modal__variation-option {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.tr-product-card-modal__variation-option:hover {
  border-color: var(--tr-primary);
  background: var(--tr-primary);
}

.tr-product-card-modal__variation-option.active {
  border: 2px solid var(--tr-primary);
  background: var(--tr-variation-button-active-bg);
}

.tr-product-card-modal__loading {
  color: var(--tr-primary);
  font-size: 14px;
}

.tr-product-card-modal__error {
  color: var(--tr-danger);
  font-size: 14px;
}


.tr-product-card-modal__price-section {
  width: 100%;
  margin-top: 16px;
}

.tr-product-card-modal__price ins {
  font-size: 18px;
  font-weight: 700;
  color: #ff6600;
  text-decoration: none;
}

.tr-product-card-modal__quantity-section {
  display: flex;
  align-items: center;
  width: max-content;
  margin-top: 4px;
}

.tr-product-card-modal__qty-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #ccc;
  background: #f5f5f5;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.tr-product-card-modal__qty-input {
  width: 48px;
  height: 36px;
  padding: 0;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 15px;
}


.tr-product-card-modal__qty-input::-webkit-inner-spin-button,
.tr-product-card-modal__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tr-product-card-modal__qty-input {
  -moz-appearance: textfield;
}

.tr-product-card-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.tr-product-card-modal__actions button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tr-product-card-modal__add-to-cart {
  background: var(--tr-primary, #ff6600);
}

.tr-product-card-modal__buy-now {
  background: var(--tr-secondary, #2196f3);
}

.tr-product-card-modal__actions button:hover {
  opacity: 0.9;
}


body.tr-product-card-modal-open {
  overflow: hidden;
}

.tr-product-card-modal__full-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #eeeeee;
}

.tr-product-card-modal__full-page-link {
  color: var(--tr-link);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.tr-product-card-modal__full-page-link:hover {
  color: var(--tr-link-hover);
  text-decoration: underline;
}

.tr-product-card-modal__stock-status {
  margin-top: 4px;

  font-size: 14px;
  font-weight: 500;
}

.tr-product-card-modal__stock-status.is-out-of-stock {
  color: #d63638;
}

.tr-product-card-modal__actions button.is-disabled,
.tr-product-card-modal__actions button:disabled {
  background: #ccc !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.75;
  pointer-events: none;
}

/* =====================================================
   MOBILE
   ===================================================== */
@media (max-width: 600px) {
  .tr-product-card-modal {
    padding: 10px;
  }

  .tr-product-card-modal__dialog {
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 8px;
  }

  .tr-product-card-modal__header {
    min-height: 60px;
    padding: 0 100px 0 20px;
  }

  .tr-product-card-modal__header h2 {
    font-size: 14px;
  }


}