/* ritual.css — стили для страницы ритуальных принадлежностей */

.ritual-main {
  margin-top: 80px;
  padding: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.page-title {
  color: white;
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 40px;
  letter-spacing: 1px;
}

.ritual-section {
  margin-bottom: 60px;
}

.section-title {
  color: white;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}

.section-title i {
  color: #007aff;
  font-size: 32px;
}

.placeholder-block {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  width: 100%;
  grid-column: 1 / -1;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .ritual-main {
    margin-top: 70px;
    padding: 15px;
  }

  .page-title {
    font-size: 26px;
    margin-bottom: 30px;
  }

  .section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .section-title i {
    font-size: 28px;
  }

  .placeholder-block {
    padding: 30px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 22px;
  }

  .section-title {
    font-size: 20px;
  }
}

/* Иконка корзины в шапке */
.header-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 15px;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  padding: 10px;
  color: white;
  font-size: 24px;
  transition: opacity 0.3s;
}

.cart-icon:hover {
  opacity: 0.8;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #007aff;
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Кнопка назад */
.back-button {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  margin-right: 15px;
  padding: 8px;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Сетка каталога — исправлено для 4 товаров в ряд */
.catalog-grid {
  display: grid;
  gap: 25px;
  margin: 30px 0;
}

/* Большие экраны: 4 колонки */
@media (min-width: 1200px) {
  .catalog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Средние экраны: 3 колонки */
@media (min-width: 768px) and (max-width: 1199px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Планшеты: 2 колонки */
@media (max-width: 767px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* Мобильные: 1 колонка */
@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.catalog-item {
  background: #1e1e1e;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.catalog-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.catalog-item-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.2;
  overflow: hidden;
  background: #2a2a2a;
}

.catalog-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.catalog-item:hover .catalog-item-image img {
  transform: scale(1.05);
}

.catalog-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  color: white;
  font-size: 2rem;
}

.catalog-item:hover .catalog-item-overlay {
  opacity: 1;
}

.catalog-item-info {
  padding: 20px 15px 15px;
  color: white;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.catalog-item-info h4 {
  font-size: 1.3rem;
  margin: 0 0 10px 0;
  font-weight: 600;
  line-height: 1.3;
}

.catalog-item-info p {
  font-size: 0.95rem;
  color: #ccc;
  margin: 0 0 15px 0;
  line-height: 1.5;
  flex: 1;
}

.catalog-item-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  margin: 10px 0 15px;
}

.add-to-cart-small {
  background: #007aff;
  border: none;
  color: white;
  padding: 12px 0;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-to-cart-small:hover {
  background: #005bb5;
}

/* Модальное окно детального просмотра */
.product-detail-modal .modal-content {
  max-width: 900px;
  width: 90%;
  background: #1e1e1e;
  border-radius: 20px;
  overflow: hidden;
}

.product-detail-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #2a2a2a;
  border-bottom: 1px solid #3a3a3a;
}

.product-detail-modal .modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 500;
}

.modal-back {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.modal-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.product-detail-body {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  gap: 30px;
}

.product-detail-image {
  flex: 1 1 300px;
  max-width: 400px;
  margin: 0 auto;
}

.product-detail-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.product-detail-info {
  flex: 1 1 300px;
  color: white;
}

.product-detail-info h4 {
  font-size: 1.8rem;
  margin: 0 0 15px 0;
  color: #fff;
}

.product-detail-description {
  font-size: 1rem;
  line-height: 1.5;
  color: #ccc;
  margin-bottom: 20px;
  white-space: pre-line;
}

.product-detail-price {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 25px;
}

#detailAddToCart {
  width: 100%;
  padding: 15px;
  font-size: 1.2rem;
  background: #007aff;
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

#detailAddToCart:hover {
  background: #005bb5;
}

/* Модальное окно предпросмотра изображения */
.image-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
}

.image-preview-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

/* Блок дополнительной информации (если нужен) */
.catalog-more-info {
  background: #000;
  border-radius: 0;
  padding: 30px 20px;
  margin: 40px auto 20px;
  max-width: 900px;
  text-align: center;
  color: #fff;
  box-shadow: none;
}

.catalog-more-info h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #007aff;
}

.catalog-more-info p {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 10px 0;
  color: #ddd;
}

.contact-info-block {
  margin-top: 25px;
  padding-top: 20px;
}

.contact-phone {
  margin: 15px 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.contact-phone i {
  margin-right: 10px;
  color: #007aff;
}

.contact-phone a {
  color: #fff;
  text-decoration: none;
}

.contact-phone a:hover {
  color: #007aff;
}

.contact-messengers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.contact-messengers span {
  color: #ccc;
  font-size: 1rem;
}

.contact-messengers a {
  color: #fff;
  font-size: 2rem;
  transition:
    color 0.3s,
    transform 0.2s;
  line-height: 1;
}

.contact-messengers a:hover {
  color: #007aff;
  transform: scale(1.1);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .header-right {
    margin-right: 10px;
  }
  .cart-icon {
    font-size: 20px;
  }
  .page-title {
    font-size: 26px;
    margin-bottom: 25px;
  }
  .back-button {
    font-size: 20px;
    margin-right: 5px;
  }
  .ritual-main {
    margin-top: 70px;
    padding: 15px;
  }
  .section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .section-title i {
    font-size: 28px;
  }
  .placeholder-block {
    padding: 30px;
    font-size: 16px;
  }
  .product-detail-body {
    flex-direction: column;
    gap: 20px;
  }
  .product-detail-image {
    max-width: 100%;
  }
  .product-detail-info h4 {
    font-size: 1.5rem;
  }
  .product-detail-price {
    font-size: 1.5rem;
  }
  .catalog-more-info {
    padding: 20px 15px;
    margin: 30px 10px 10px;
  }
  .catalog-more-info h3 {
    font-size: 1.5rem;
  }
  .catalog-more-info p {
    font-size: 1rem;
  }
  .contact-phone {
    font-size: 1.4rem;
  }
  .contact-messengers a {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 22px;
  }
  .section-title {
    font-size: 20px;
  }
  .product-detail-modal .modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .product-detail-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
  }
  .product-detail-image {
    max-width: 100%;
    margin-bottom: 15px;
  }
  .product-detail-info h4 {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }
  .product-detail-description {
    font-size: 0.95rem;
  }
  .product-detail-price {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }
  #detailAddToCart {
    padding: 16px;
    font-size: 1.2rem;
    border-radius: 30px;
  }
  .contact-messengers {
    gap: 10px;
  }
  .contact-messengers span {
    width: 100%;
    margin-bottom: 5px;
  }
}

.modal-back,
.modal-close,
#detailAddToCart,
.add-to-cart-small {
  touch-action: manipulation;
}
