/* =====================================================================
   rb-grid-inline.css
   Rosbotanic rb_grid_inline v1 (2026-07-26)
   Inline-баннеры в grid товаров + popup с галереей и CTA.
   Правило №0.2 (mobile-first) + Правило №0.3 (SVG-иконки, без эмодзи).
   ===================================================================== */

/* ---------- Плитка баннера в grid ---------- */
.rb-banner-slot {
  background: transparent;
  border: none;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.rb-banner-slot__link {
  display: flex;
  flex-direction: column;
  color: var(--rb-almost-black, #2E2A24);
  text-decoration: none !important;
  height: 100%;
}

.rb-banner-slot__link:hover,
.rb-banner-slot__link:focus {
  color: var(--rb-almost-black, #2E2A24);
  text-decoration: none !important;
}

.rb-banner-slot__image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #F8F6F1;
  position: relative;
  margin-bottom: 14px;
  border-radius: 2px;
}

.rb-banner-slot__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease-out;
}

.rb-banner-slot__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #F8F6F1 0%, #EFE8DB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rb-banner-slot__placeholder::after {
  content: '';
  width: 40%;
  height: 40%;
  background-color: rgba(46, 42, 36, 0.15);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2 L14 8 L20 8 L15 12 L17 18 L12 14 L7 18 L9 12 L4 8 L10 8 Z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2 L14 8 L20 8 L15 12 L17 18 L12 14 L7 18 L9 12 L4 8 L10 8 Z'/></svg>") center/contain no-repeat;
}

.rb-banner-slot:hover .rb-banner-slot__image img {
  transform: scale(1.03);
}

.rb-banner-slot__title {
  font-family: 'Lora', 'Georgia', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--rb-almost-black, #2E2A24);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.rb-banner-slot__subtitle {
  font-size: 12px;
  color: var(--rb-warm-brown, #6B6155);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.rb-banner-slot__cta-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--rb-almost-black, #2E2A24);
  font-weight: 500;
  margin-top: auto;
}

.rb-banner-slot__cta-hint svg {
  transition: transform 0.2s ease;
}

.rb-banner-slot:hover .rb-banner-slot__cta-hint svg {
  transform: translateX(4px);
}

/* Wide 2x1 — только на desktop (>= 768px) */
@media (min-width: 768px) {
  .rb-banner-slot--wide .rb-banner-slot__image {
    aspect-ratio: 2 / 1;
  }
}

/* Убрать любой rb-thumb стандартный фон, если случайно применится */
.rb-banner-slot.rb-thumb {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ---------- Modal (Bootstrap 3) ---------- */
.rb-banner-modal .modal-dialog {
  max-width: 720px;
  margin: 30px auto;
}

.rb-banner-modal .modal-content {
  border-radius: 4px;
  border: none;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(46,42,36,0.25);
}

.rb-banner-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rb-almost-black, #2E2A24);
  cursor: pointer;
  z-index: 10;
  opacity: 1;
  transition: background 0.2s;
  padding: 0;
}

.rb-banner-modal__close:hover,
.rb-banner-modal__close:focus {
  background: #fff;
  opacity: 1;
  outline: none;
}

.rb-banner-modal__body {
  padding: 0;
}

.rb-banner-modal__loader {
  padding: 60px 20px;
  text-align: center;
  color: var(--rb-warm-brown, #6B6155);
  font-size: 14px;
}

/* Галерея Swiper */
.rb-banner-modal__gallery {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #F8F6F1;
  position: relative;
  overflow: hidden;
}

.rb-banner-modal__gallery .swiper-wrapper,
.rb-banner-modal__gallery .swiper-slide {
  height: 100%;
}

.rb-banner-modal__gallery .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rb-banner-modal__nav-prev,
.rb-banner-modal__nav-next {
  width: 44px !important;
  height: 44px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--rb-almost-black, #2E2A24) !important;
  top: 50% !important;
  margin-top: -22px !important;
  background-image: none !important;
  transition: background 0.2s;
}

.rb-banner-modal__nav-prev { left: 12px !important; }
.rb-banner-modal__nav-next { right: 12px !important; }

.rb-banner-modal__nav-prev:hover,
.rb-banner-modal__nav-next:hover {
  background: #fff !important;
}

/* Стрелка через ::after (Swiper 3-style) */
.rb-banner-modal__nav-prev::after,
.rb-banner-modal__nav-next::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  display: block;
}

.rb-banner-modal__nav-prev::after { transform: rotate(135deg); margin-left: 4px; }
.rb-banner-modal__nav-next::after { transform: rotate(-45deg); margin-right: 4px; }

.rb-banner-modal__pagination {
  bottom: 12px !important;
  position: absolute;
  z-index: 5;
  text-align: center;
  width: 100%;
}

.rb-banner-modal__pagination .swiper-pagination-bullet {
  background: rgba(255,255,255,0.7);
  opacity: 1;
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
}

.rb-banner-modal__pagination .swiper-pagination-bullet-active {
  background: var(--rb-almost-black, #2E2A24);
}

.rb-banner-modal__title {
  font-family: 'Lora', 'Georgia', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--rb-almost-black, #2E2A24);
  margin: 24px 24px 12px;
  line-height: 1.25;
}

.rb-banner-modal__html {
  padding: 0 24px;
  color: var(--rb-almost-black, #2E2A24);
  font-size: 15px;
  line-height: 1.6;
}

.rb-banner-modal__html p { margin: 0 0 12px 0; }
.rb-banner-modal__html h3 {
  font-family: 'Lora', 'Georgia', serif;
  font-size: 17px;
  font-weight: 500;
  margin: 16px 0 8px;
}
.rb-banner-modal__html ul,
.rb-banner-modal__html ol { margin: 0 0 12px 20px; padding: 0; }
.rb-banner-modal__html a {
  color: var(--rb-olive, #6E7C4A);
  text-decoration: underline;
}

.rb-banner-modal__cta {
  padding: 20px 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rb-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border: 1px solid var(--rb-almost-black, #2E2A24);
  background: transparent;
  color: var(--rb-almost-black, #2E2A24);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  border-radius: 2px;
}

.rb-cta-btn:hover,
.rb-cta-btn:focus {
  background: var(--rb-almost-black, #2E2A24);
  color: #fff;
  text-decoration: none !important;
  outline: none;
}

.rb-cta-btn svg {
  flex-shrink: 0;
}

/* Mobile — плитка */
@media (max-width: 767px) {
  .rb-banner-slot__title { font-size: 16px; }
  .rb-banner-slot__subtitle { font-size: 12px; }

  /* Wide на mobile становится обычной 1x1 (для минимальной ширины экрана) */
  .rb-banner-slot--wide .rb-banner-slot__image {
    aspect-ratio: 1 / 1;
  }
}

/* Mobile — modal */
@media (max-width: 767px) {
  .rb-banner-modal .modal-dialog {
    margin: 12px;
    max-width: calc(100vw - 24px);
  }
  .rb-banner-modal__title {
    font-size: 20px;
    margin: 16px 16px 8px;
    padding-right: 40px; /* чтобы не наезжало на крестик */
  }
  .rb-banner-modal__html { padding: 0 16px; font-size: 14px; }
  .rb-banner-modal__cta { padding: 16px; flex-direction: column; }
  .rb-cta-btn { flex: 1 1 100%; justify-content: center; width: 100%; }
  .rb-banner-modal__nav-prev,
  .rb-banner-modal__nav-next {
    width: 36px !important;
    height: 36px !important;
    margin-top: -18px !important;
  }
  .rb-banner-modal__close {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
  }
}
