/* Catalog from CSV — responsive grid, modal, toolbar */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gf-catalog-section {
  scroll-margin-top: 100px;
  position: relative;
  z-index: 2;
  background: #fff;
}

.gf-catalog-section .cs_section_heading_title,
.gf-catalog-section .cs_product_title,
.gf-catalog-section .cs_product_category,
.gf-catalog-section .cs_product_price,
.gf-catalog-section .gf-catalog-count,
.gf-catalog-section .form-control {
  font-family: var(--gf-font-body, "Prompt", sans-serif);
}

.gf-catalog-section .cs_section_heading_title {
  font-weight: 600;
}

.gf-catalog-toolbar .form-control,
.gf-catalog-toolbar .custom-select {
  border-radius: 8px;
  min-height: 48px;
}

.gf-catalog-count {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-size: 0.95rem;
  color: var(--ternary-color, #666);
}

.gf-catalog-grid .cs_grid_col {
  display: flex;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.gf-catalog-grid .cs_product_card {
  height: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.gf-catalog-grid .gf-catalog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #efeff3;
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.gf-catalog-grid .gf-catalog-card:hover {
  border-color: #e6e6ec;
  box-shadow: 0 10px 28px rgba(20, 20, 30, 0.08);
  transform: translateY(-2px);
}

.gf-catalog-grid .gf-catalog-card .cs_product_card_in {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  overflow: visible;
}

.gf-catalog-grid .gf-catalog-card .cs_product_thumb {
  height: 220px;
  flex: 0 0 220px;
  background: #fafafb;
}

.gf-catalog-grid .cs_product_thumb img {
  max-height: 200px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.gf-catalog-grid .gf-catalog-card .cs_product_info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 14px 16px 16px;
}

.gf-catalog-grid .gf-catalog-card .cs_product_info_in {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  position: static;
  overflow: visible;
}

.gf-catalog-grid .gf-catalog-card .cs_product_category {
  display: block;
  margin-bottom: 6px;
  min-height: 1.25em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gf-catalog-grid .gf-catalog-card .cs_product_title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  margin: 0 0 8px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gf-catalog-grid .gf-catalog-card .gf-catalog-rating {
  margin-bottom: 8px;
  min-height: 20px;
}

.gf-catalog-grid .gf-catalog-card__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.gf-catalog-grid .gf-catalog-card .cs_product_price {
  margin: 0;
  opacity: 1 !important;
  min-height: 1.35em;
}

/* Не ховати ціну / рейтинг під кнопкою на ховері */
.gf-catalog-grid .gf-catalog-card:hover .cs_product_price,
.gf-catalog-grid .gf-catalog-card:hover .cs_product_ratings,
.gf-catalog-grid .gf-catalog-card:hover .gf-catalog-rating {
  opacity: 1 !important;
}

.gf-catalog-grid .gf-catalog-card .cs_products_btns {
  position: static !important;
  bottom: auto !important;
  left: auto;
  width: 100%;
  opacity: 1;
  gap: 8px;
  z-index: 4;
}

.gf-catalog-grid .gf-catalog-card .gf-add-cart,
.gf-catalog-grid .gf-catalog-card .cs_btn.cs_style_1 {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  min-width: 0 !important;
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0 !important;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  border-radius: 10px;
  box-sizing: border-box;
}

.gf-catalog-grid .gf-catalog-card .cs_btn.cs_style_1 img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gf-catalog-grid .gf-catalog-card:hover .cs_product_title {
  text-decoration: none;
}

.gf-catalog-grid .gf-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.gf-catalog-grid .gf-stock-badge--in {
  background-color: var(--accent, #e61f7f);
  color: #fff;
}

.gf-catalog-grid .gf-stock-badge--out {
  background-color: #f3f3f5;
  color: #5a5a64;
  border: 1px solid #e2e2e8;
  box-shadow: none;
}

.gf-catalog-empty,
.gf-catalog-error {
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.gf-catalog-error {
  background: #fff3f3;
  color: #8a1f1f;
}

/* Modal */
.gf-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gf-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.gf-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(2px);
}

.gf-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.gf-modal.is-open .gf-modal__dialog {
  transform: translateY(0);
}

.gf-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gf-modal__title {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0;
  padding-right: 0.5rem;
}

.gf-modal__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.15s ease;
}

.gf-modal__close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.gf-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.75rem;
  -webkit-overflow-scrolling: touch;
}

.gf-modal__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .gf-modal__layout {
    grid-template-columns: minmax(200px, 280px) 1fr;
    align-items: start;
  }
}

.gf-modal__img-wrap {
  background: #f8f8f9;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.gf-modal__img-wrap img {
  max-width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}

.gf-modal__meta {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.75rem;
}

.gf-modal__meta strong {
  color: #222;
}

.gf-modal__price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color, #c45c48);
  margin-bottom: 1rem;
}

.gf-modal__desc {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
}

.gf-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.gf-pagination button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gf-pagination button:hover:not(:disabled) {
  border-color: var(--accent-color, #c45c48);
  color: var(--accent-color, #c45c48);
}

.gf-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gf-pagination button.is-active {
  background: var(--accent-color, #c45c48);
  border-color: var(--accent-color, #c45c48);
  color: #fff;
}

body.gf-modal-open {
  overflow: hidden;
}

/* Сторінка одного товару (product-details.html) */
.gf-pd-description {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.gf-pd-rating-row,
.gf-catalog-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gf-catalog-rating .cs_rating {
  width: 88px;
}
