/* ===================================================
   TERRA COMPUTER — ПРОДАЖ
   Оформлення у стилі оригінального сайту
   =================================================== */

.terra-sale-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto 30px;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #303030;
}

/* Основне меню */

.terra-sale-tabs {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    background: #146333;
    padding: 7px 12px 6px;
    min-height: 39px;
}

.terra-sale-tab {
    width: 125px;
    min-height: 30px;
    padding: 7px 12px;
    border: 1px solid #a7a7a7;
    border-radius: 12px 12px 0 0;
    background: #b6b6b6;
    color: #666;
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
    transition: background .15s;
}

.terra-sale-tab:hover {
    background: #d6eadb;
}

.terra-sale-tab.is-active {
    background: #91e8ae;
    color: #28663a;
    border-color: #6bbd85;
}

/* Робоча область */

.terra-sale-content {
    min-height: 410px;
    padding: 10px 12px 22px;
    background-color: #f0f0f0;
    background-image:
        repeating-linear-gradient(
            135deg,
            rgba(0,0,0,.012) 0px,
            rgba(0,0,0,.012) 1px,
            transparent 1px,
            transparent 3px
        );
}

/* Діючі / Архів */

.terra-sale-subtabs {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 3px;
    margin: 0 0 12px;
    padding: 0 0 5px;
    border-bottom: 1px solid #a8a8a8;
}

.terra-sale-subtab {
    min-height: 27px;
    padding: 6px 15px;
    border: 1px solid #aaa;
    border-radius: 9px 9px 0 0;
    background: #b8b8b8;
    color: #656565;
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
}

.terra-sale-subtab.is-active,
.terra-sale-subtab:hover {
    background: #9be7b2;
    color: #266a39;
    border-color: #7ccf95;
}

/* Картки акцій */

.terra-sale-promotion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.terra-sale-promotion-card {
    min-width: 0;
    min-height: 350px;
    padding: 18px 14px;
    background: #fff;
    border: none;
    border-radius: 11px;
    box-shadow: none;
    cursor: pointer;
    transition: box-shadow .2s;
}

.terra-sale-promotion-card:hover,
.terra-sale-promotion-card:focus {
    box-shadow: 0 3px 13px rgba(0,0,0,.14);
    outline-color: #229c45;
}

.terra-sale-card-title {
    margin: 8px 0 14px;
    color: #222;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.35;
}

.terra-sale-date {
    margin: 5px 0 12px;
    font-size: 12px;
    color: #279b48;
}

.terra-sale-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 290px;
    object-fit: contain;
    margin: 14px auto 20px;
}

.terra-sale-preview {
    border-top: 1px solid #d7d7d7;
    padding-top: 13px;
    color: #333;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Номери сторінок */

.terra-sale-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 0 5px;
}

.terra-sale-page-number {
    width: 27px;
    height: 27px;
    border: 1px solid #299b46;
    border-radius: 50%;
    background: #c6c6c6;
    color: #278c43;
    font-size: 12px;
    cursor: pointer;
}

.terra-sale-page-number:hover,
.terra-sale-page-number.is-active {
    background: #239b41;
    color: #fff;
}

/* Детальна сторінка акції */

.terra-sale-back {
    margin: 0 0 8px;
    padding: 7px 22px;
    border: none;
    border-radius: 0 0 20px 0;
    background: #239c40;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.terra-sale-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
}

.terra-sale-detail {
    min-width: 0;
    min-height: 650px;
    padding: 24px;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.terra-sale-detail h2 {
    margin: 10px 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d6d6d6;
    color: #222;
    font-size: 18px;
}

.terra-sale-detail .terra-sale-image {
    max-height: 380px;
    margin: 24px auto;
}

.terra-sale-nearby {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.terra-sale-compact {
    flex: 1;
    min-height: 260px;
    padding: 15px;
}

.terra-sale-compact .terra-sale-image {
    max-height: 160px;
}

/* Тексти з 1С */

.terra-sale-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    line-height: 1.5;
    font-size: 13px;
    color: #303030;
}

/* Кредитування */

.terra-sale-credit-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
}

.terra-sale-credit-card {
    display: grid;
    grid-template-columns: minmax(160px, 32%) minmax(0, 1fr);
    column-gap: 22px;
    align-items: start;
    padding: 23px 15px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #d7d7d7;
    border-radius: 0;
    box-shadow: none;
}

.terra-sale-credit-card:last-child {
    border-bottom: none;
}

.terra-sale-credit-card .terra-sale-card-title {
    grid-column: 1;
    grid-row: 1;
    color: #27964a;
    text-align: center;
    font-size: 14px;
}

.terra-sale-credit-card .terra-sale-image {
    grid-column: 1;
    max-width: 180px;
    max-height: 140px;
    margin: 8px auto;
}

.terra-sale-credit-card .terra-sale-text {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 130px;
    padding-left: 20px;
    border-left: 1px solid #d9d9d9;
}

/* Загальний текст кредитування */

.terra-sale-credit-card:first-child:has(
    .terra-sale-card-title
) {
    min-height: 100px;
}

/* Повідомлення про відсутність акцій */

.terra-sale-empty {
    min-height: 80px;
    padding: 22px 15px;
    background: #f6f6f6;
    border: none;
    border-radius: 7px;
    text-align: left;
    font-size: 13px;
    color: #303030;
}

/* Прайс-лист: підлаштовуємо стандартну картку */

.terra-sale-content .p-card {
    max-width: none !important;
    margin: 0 !important;
    border-radius: 11px;
    box-shadow: none;
}

.terra-sale-content .p-card .p-card-content {
    font-size: 13px;
    line-height: 1.6;
}

/* Мобільна версія */

@media (max-width: 760px) {
    .terra-sale-tab {
        flex: 1;
        width: auto;
        padding: 8px 5px;
        font-size: 11px;
    }

    .terra-sale-content {
        padding: 9px;
    }

    .terra-sale-promotion-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .terra-sale-promotion-card {
        min-height: auto;
    }

    .terra-sale-detail-layout {
        grid-template-columns: 1fr;
    }

    .terra-sale-detail {
        min-height: auto;
    }

    .terra-sale-credit-card {
        grid-template-columns: 1fr;
    }

    .terra-sale-credit-card .terra-sale-card-title,
    .terra-sale-credit-card .terra-sale-image,
    .terra-sale-credit-card .terra-sale-text {
        grid-column: 1;
        grid-row: auto;
    }

    .terra-sale-credit-card .terra-sale-text {
        padding: 15px 0 0;
        border-left: 0;
        border-top: 1px solid #ddd;
    }
}


/* Захищене завантаження прайс-листів */
.terra-price-download {
  margin: 16px auto 10px;
  padding: 20px;
  background: #fff;
  border-radius: 11px;
  border: 1px solid #e2e2e2;
  font-family: Arial, sans-serif;
}
.terra-price-download h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #238641;
}
.terra-price-category {
  margin: 0 0 16px;
  font-size: 13px;
}
.terra-price-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.terra-price-button {
  border: 0;
  border-radius: 5px;
  background: #239b42;
  padding: 11px 20px;
  color: white;
  cursor: pointer;
  font-size: 13px;
}
.terra-price-button:hover {
  background: #197b32;
}
.terra-price-button:disabled {
  opacity: .55;
  cursor: wait;
}
.terra-price-error {
  margin-top: 12px;
  color: #a32323;
  font-size: 13px;
}


/* TERRA PROMOTIONS V2 */
.terra-promo2 {
  width: 100%;
}

.terra-promo2-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #cfcfcf;
}

.terra-promo2-tab {
  padding: 8px 18px;
  border: 1px solid #999;
  border-radius: 8px 8px 0 0;
  background: #bdbdbd;
  color: #444;
  cursor: pointer;
}

.terra-promo2-tab.is-active {
  background: #b8efb8;
  color: #187b35;
}

.terra-promo2-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.terra-promo2-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #ddd;
  border-radius: 15px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.terra-promo2-clickable {
  cursor: pointer;
}

.terra-promo2-clickable:hover {
  box-shadow: 0 0 0 1px #69b973 inset;
}

.terra-promo2-date-caption {
  color: #777;
  font-size: 12px;
}

.terra-promo2-date {
  margin: 4px 0 12px;
  color: #369a50;
  font-size: 14px;
}

.terra-promo2-title {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.3;
  font-weight: bold;
}

.terra-promo2-divider {
  border-top: 1px solid #ddd;
  margin: 12px 0;
}

.terra-promo2-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  padding: 12px 0;
}

.terra-promo2-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.terra-promo2-description {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.terra-promo2-pages {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.terra-promo2-page {
  width: 34px;
  height: 34px;
  border: 1px solid #69b973;
  border-radius: 50%;
  background: white;
  color: #238b3c;
  cursor: pointer;
}

.terra-promo2-page.is-active {
  background: #238b3c;
  color: white;
}

.terra-promo2-back {
  margin-bottom: 14px;
  padding: 9px 19px;
  border: 0;
  border-radius: 5px;
  color: white;
  background: #329e45;
  cursor: pointer;
}

.terra-promo2-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 18px;
  align-items: start;
}

.terra-promo2-nearby {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.terra-promo2-large .terra-promo2-image {
  max-height: 450px;
}

.terra-promo2-empty {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: white;
}

@media (max-width: 950px) {
  .terra-promo2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terra-promo2-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .terra-promo2-grid {
    grid-template-columns: 1fr;
  }

  .terra-promo2-tabs {
    flex-wrap: wrap;
  }
}
