/* Inatech Gift Products - Front Office */

:root {
  --inatechgift-primary: #1d92eb;
  --inatechgift-primary-soft: #dbeafe;
  --inatechgift-border: #d7e2ee;
  --inatechgift-text: #101828;
  --inatechgift-muted: #4b5563;
  --inatechgift-bg: #ffffff;
  --inatechgift-icon-size: 42px;
  --inatechgift-gap: 12px;
  --inatechgift-left-shift: 54px;
}

/* Reset module radius */
.inatechgift-product-box,
.inatechgift-product-box *,
.inatechgift-cart-box,
.inatechgift-cart-box * {
  border-radius: 0;
  box-sizing: border-box;
}

/* Main boxes */
.inatechgift-product-box,
.inatechgift-cart-box {
  background: var(--inatechgift-bg);
  border: 1px solid var(--inatechgift-primary);
  box-shadow: none;
  margin: 12px 0 16px;
  padding: 10px 10px;
}

/* Product gift box */
.inatechgift-product-box {
  display: flex;
  align-items: flex-start;
  gap: var(--inatechgift-gap);
  box-shadow: 0 8px 24px rgba(13, 38, 76, .06);
}

/* Cart page: neutral borders, keep action color blue */
.inatechgift-cart-box {
  border-color: #d9d9d9;
}

.inatechgift-cart-box .inatechgift-item,
.inatechgift-cart-box .inatechgift-selected-item {
  border-color: #d9d9d9;
}

.inatechgift-cart-icon .inatechgift-svg-icon {
  width: 46px;
  height: 46px;
}

/* Icons */
.inatechgift-box-icon,
.inatechgift-cart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
  color: var(--inatechgift-primary);
  font-size: 0;
  line-height: 1;
}

.inatechgift-box-icon {
  width: var(--inatechgift-icon-size);
  height: var(--inatechgift-icon-size);
}

.inatechgift-cart-icon {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.inatechgift-svg-icon {
  display: block;
  width: 40px;
  height: 40px;
}

/* Content */
.inatechgift-box-body,
.inatechgift-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Rule separation */
.inatechgift-rule + .inatechgift-rule,
.inatechgift-cart-rule + .inatechgift-cart-rule,
.inatechgift-applied-rule + .inatechgift-cart-rule,
.inatechgift-cart-rule + .inatechgift-applied-rule {
  border-top: 1px solid var(--inatechgift-primary-soft);
  margin-top: 12px;
  padding-top: 12px;
}

/* Titles */
.inatechgift-heading {
  display: block;
  margin: 0 0 4px;
}

.inatechgift-title,
.inatechgift-cart-head strong {
  display: block;
  color: var(--inatechgift-text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

/* Messages */
.inatechgift-message,
.inatechgift-submessage {
  margin: 0 0 10px;
  color: #162033;
  font-size: 14px;
  line-height: 1.3;
}

.inatechgift-submessage {
  color: var(--inatechgift-muted);
  font-size: 13px;
}

/* Product page message on one line */
.inatechgift-product-box .inatechgift-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide old bottom note with * on product page */
.inatechgift-product-box .inatechgift-note {
  display: none;
}

/* Gift items grid */
.inatechgift-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

/* On product page, gift cards start from the left edge of the icon */
.inatechgift-product-box .inatechgift-items {
  margin-left: calc(-1 * var(--inatechgift-left-shift));
  width: calc(100% + var(--inatechgift-left-shift));
}

/* Gift cards */
.inatechgift-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 72px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--inatechgift-border);
  box-shadow: none;
  text-align: left;
}

.inatechgift-applied-item {
  background: #ffffff;
  border-color: var(--inatechgift-border);
}

/* Gift images */
.inatechgift-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 58px;
  width: 58px;
  height: 54px;
  min-height: 54px;
  margin: 0;
}

.inatechgift-item img {
  display: block;
  max-width: 58px;
  max-height: 54px;
  object-fit: contain;
}

.inatechgift-no-image {
  color: var(--inatechgift-primary);
  font-size: 28px;
  line-height: 1;
}

/* Gift product name */
.inatechgift-item-name {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  max-height: 48px;
  overflow: hidden;
  color: var(--inatechgift-text);
  font-size: 13px;
  line-height: 1.25;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.inatechgift-item-name a {
  color: inherit;
  text-decoration: none;
}

.inatechgift-item-name a:hover {
  color: var(--inatechgift-primary);
  text-decoration: underline;
}

/* Cart box header */
.inatechgift-cart-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.inatechgift-cart-head p {
  margin: 3px 0 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.3;
}


/* Keep the amount inside the cart message on the same line. */
.inatechgift-cart-head p strong {
  display: inline;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 800;
}

.inatechgift-cart-head .inatechgift-submessage {
  margin: 4px 0 0;
}

/* Progress bar */
.inatechgift-progress-line {
  margin: 10px 0 12px;
}

.inatechgift-product-threshold-rule .inatechgift-progress-line {
  margin-top: 9px;
}

.inatechgift-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: #374151;
  font-size: 12px;
}

.inatechgift-progress {
  height: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

.inatechgift-progress span {
  display: block;
  height: 100%;
  background: var(--inatechgift-primary);
}

/* References and cart badges */
.inatechgift-reference {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.25;
}

.inatechgift-cart-gift-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  margin-left: 8px;
  padding: 4px 8px;
  background: var(--inatechgift-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.inatechgift-cart-gift-help {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.3;
}

.inatechgift-cart-gift-row .inatechgift-cart-gift-badge {
  display: inline-block;
  vertical-align: middle;
}

/* Hide theme product info box when gift module is active */
.inatechgift-product-info-hidden {
  display: none !important;
}

/* Tablet */
@media (max-width: 991px) {
  .inatechgift-items {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --inatechgift-left-shift: 0px;
  }

  .inatechgift-product-box,
  .inatechgift-cart-box {
    padding: 13px;
  }

  .inatechgift-product-box {
    display: block;
  }

  .inatechgift-box-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
  }

  .inatechgift-svg-icon {
    width: 36px;
    height: 36px;
  }

  .inatechgift-product-box .inatechgift-message {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .inatechgift-items,
  .inatechgift-product-box .inatechgift-items {
    grid-template-columns: 1fr;
    margin-left: 0;
    width: 100%;
  }

  .inatechgift-item {
    min-height: 68px;
  }

  .inatechgift-cart-head {
    align-items: flex-start;
  }
}

.inatechgift-product-box .inatechgift-note {
  display: none;
}



.inatechgift-choice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--inatechgift-primary);
  background: var(--inatechgift-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.inatechgift-choice-button:hover {
  background: #ffffff;
  color: var(--inatechgift-primary);
}

.inatechgift-choice-button:disabled {
  cursor: wait;
  opacity: .65;
}

.inatechgift-choice-selected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--inatechgift-primary);
  background: #ffffff;
  color: var(--inatechgift-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.inatechgift-selected-item {
  border-color: var(--inatechgift-primary);
}

@media (max-width: 767px) {
  .inatechgift-choice-button,
  .inatechgift-choice-selected {
    width: 100%;
    margin-left: 0;
  }

  .inatechgift-cart-items .inatechgift-item {
    flex-wrap: wrap;
  }
}