/*
====================================================
ET Smart Add-ons – vzhľad
Version: 0.7.1
====================================================
*/

.et-smart-addons-status {
  display: none;
  margin: 12px 0;
  padding: 12px 15px;
  border: 1px solid #d8d8d8;
  border-radius: 3px;
  background: #f7f7f7;
  color: #333;
  font-size: 14px;
  line-height: 1.45;
}

.et-smart-addons-status.is-visible {
  display: block;
}

.et-smart-addons-status.is-processing {
  border-color: #b8d7ea;
  background: #eef8fd;
  color: #24566f;
}

.et-smart-addons-status.is-error {
  border-color: #d93636;
  background: #fff1f1;
  color: #a40000;
}

.et-smart-addons-status.is-success {
  border-color: #52a552;
  background: #f0faf0;
  color: #246b24;
}

.et-smart-addons-price-note {
  margin-left: 5px;
  white-space: nowrap;
  font-size: 0.92em;
  font-weight: 600;
}

.et-smart-addons-price-note::before {
  content: "(";
}

.et-smart-addons-price-note::after {
  content: ")";
}

.et-smart-addon-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.et-smart-addon-row {
  align-items: flex-start;
}

.et-smart-addon-picker {
  position: relative;
  width: 100%;
  max-width: 570px;
}

/* Všetky príplatkové voľby majú na pilotnom produkte rovnakú šírku. */
.et-smart-addons-active .detail-parameters tr.surcharge-list > td,
.et-smart-addons-active .detail-parameters tr.surcharge-list > td > .select-box,
.et-smart-addons-active
  .detail-parameters
  tr.surcharge-list
  > td
  > .select-box-container {
  width: 100%;
  max-width: 570px;
}

.et-smart-addon-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid #d7d7d7;
  background: #fff;
  color: #555;
  text-align: left;
  cursor: pointer;
}

.et-smart-addon-toggle-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-smart-addon-toggle-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-left: 12px;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s ease;
}

.et-smart-addon-picker.is-open .et-smart-addon-toggle-icon {
  transform: rotate(225deg) translate(-2px, -1px);
}

.et-smart-addon-panel {
  display: none;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 10px;
  max-height: 390px;
  padding: 0;
  overflow-y: auto;
  border: 1px solid #e1e1e1;
  border-top: 0;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.et-smart-addon-picker.is-open .et-smart-addon-panel {
  display: grid;
}

.et-smart-addon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  padding: 5px;
  border: 2px solid #eeeeee;
  border-radius: 0;
  background: #fff;
  color: #333;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.et-smart-addon-card:hover,
.et-smart-addon-card:focus-visible {
  border-color: #777;
  outline: none;
}

.et-smart-addon-card.is-selected {
  border-color: #309900;
  box-shadow: 0 0 0 1px #309900;
}

.et-smart-addon-card-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 40px;
  flex: 0 1 auto;
  margin: 0 0 6px;
  object-fit: contain;
  background: #fff;
}

.et-smart-addon-card-image:not([src]),
.et-smart-addon-card-image[src=""] {
  visibility: hidden;
}

.et-smart-addon-card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.et-smart-addon-card-name {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.et-smart-addon-card-price {
  color: #309900;
  font-size: 14px;
}

.et-smart-cart-guard {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #b8d7ea;
  border-radius: 3px;
  background: #eef8fd;
  color: #24566f;
  font-size: 14px;
  line-height: 1.45;
}

.et-smart-cart-guard.is-error {
  border-color: #d93636;
  background: #fff1f1;
  color: #a40000;
}

.et-smart-cart-guard ul {
  margin: 9px 0 0 20px;
  padding: 0;
}

.et-smart-cart-guard li + li {
  margin-top: 5px;
}

.et-smart-assemblies {
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid #d7d7d7;
  background: #fff;
  color: #333;
}

.et-smart-assemblies h3 {
  margin: 0;
  font-size: 20px;
}

.et-smart-assemblies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.et-smart-assemblies-help {
  margin: 0 0 14px;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
}

.et-smart-assembly {
  padding: 8px 10px;
  border-left: 4px solid #309900;
  background: #f7f7f7;
}

.et-smart-assembly + .et-smart-assembly {
  margin-top: 10px;
}

.et-smart-assembly-title {
  display: block;
  margin-bottom: 5px;
  color: #237500;
  font-size: 15px;
}

.et-smart-assembly-product {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 88px 72px 72px 24px;
  align-items: center;
  min-height: 54px;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid #ddd;
}

.et-smart-assembly-product-image {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.et-smart-assembly-product-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.et-smart-assembly-product-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-smart-assembly-product-info small {
  margin-top: 2px;
  color: #777;
}

.et-smart-assembly-product-quantity,
.et-smart-assembly-product-unit,
.et-smart-assembly-product-total {
  text-align: right;
  white-space: nowrap;
}

.et-smart-assembly-product-quantity {
  display: grid;
  grid-template-columns: 24px 38px 24px;
  align-items: stretch;
}

.et-smart-assembly-product-quantity button,
.et-smart-assembly-product-quantity input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.et-smart-assembly-product-quantity button {
  cursor: pointer;
}

.et-smart-assembly-product-quantity input {
  border-right: 0;
  border-left: 0;
  appearance: textfield;
}

.et-smart-assembly-product-quantity input::-webkit-inner-spin-button,
.et-smart-assembly-product-quantity input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.et-smart-assembly-product-remove {
  border: 0;
  background: transparent;
  color: #555;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.et-smart-assembly-product.is-updating {
  opacity: 0.55;
  pointer-events: none;
}

.et-smart-assembly-meta {
  padding: 4px 0 1px 56px;
  color: #666;
  font-size: 12px;
}

.et-smart-assembly-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 2px 56px;
  padding: 8px 10px;
  border: 1px solid #e3bd52;
  background: #fff8dc;
  color: #6d5300;
  font-size: 12px;
  line-height: 1.4;
}

.et-smart-assembly-change-link {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #947000;
  background: #fff;
  color: #6d5300;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

#product-detail-form.et-smart-addons-processing {
  position: relative;
}

#product-detail-form.et-smart-addons-processing button[type="submit"],
#product-detail-form.et-smart-addons-processing input[type="submit"] {
  cursor: wait;
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 767px) {
  .et-smart-addons-status {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .et-smart-addons-price-note {
    display: block;
    margin: 3px 0 0;
  }

  .et-smart-addon-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 310px;
  }

  .et-smart-assembly-product {
    grid-template-columns: 42px minmax(0, 1fr) 88px 62px 24px;
  }

  .et-smart-assembly-product-unit {
    display: none;
  }

  .et-smart-assembly-warning {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .et-smart-addon-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .et-smart-addon-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .et-smart-cart-guard,
  .et-smart-original-cart-row,
  .et-smart-assemblies-help {
    display: none !important;
  }

  .et-smart-assembly-change-link {
    display: none !important;
  }

  .et-smart-assemblies {
    margin: 0;
    padding: 8px;
    border: 0;
  }

  .et-smart-assembly {
    break-inside: avoid;
    padding: 5px 7px;
  }

  .et-smart-assembly-product {
    min-height: 42px;
    grid-template-columns: 38px minmax(0, 1fr) 88px 60px 60px 18px;
    padding: 2px 0;
    font-size: 11px;
  }

  .et-smart-assembly-product-image {
    width: 34px;
    height: 34px;
  }
}
