/**
 * WooCommerce layout & styling for web-aim-store theme.
 */

/* ========== Общие элементы WooCommerce ========== */

.woocommerce-breadcrumb {
  margin: 1.5rem 0 1.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.woocommerce-breadcrumb a {
  color: #4b5563;
  text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
  color: #111827;
  text-decoration: underline;
}

/* Заголовок архива товаров */
.woocommerce-products-header__title.page-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.woocommerce-products-header .term-description {
  margin-top: 0.5rem;
  color: #4b5563;
}

/* ========== Каталог: сетка + сайдбар ========== */

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.shop-layout__sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: flex-start;
}

.shop-layout__main {
  min-width: 0;
}

/* На планшете и мобильном сайтбар уходит вниз */
@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-layout__sidebar {
    position: static;
    order: 2;
  }

  .shop-layout__main {
    order: 1;
  }
}

/* Виджеты в сайдбаре магазина */

.shop-widget {
  background-color: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
}

.shop-widget__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.shop-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shop-widget ul li {
  margin-bottom: 0.4rem;
}

.shop-widget a {
  color: #374151;
  text-decoration: none;
}

.shop-widget a:hover {
  color: #111827;
  text-decoration: underline;
}

/* Дерево категорий по умолчанию */
.product-categories .children {
  margin-left: 1rem;
  margin-top: 0.25rem;
}

/* Сетка товаров */
.woocommerce ul.products,
.woocommerce-page ul.products {
  gap: 1.5rem;
}

/* Карточка товара в каталоге */
.product-card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  border-color: #d1d5db;
}

.product-card a {
  text-decoration: none;
}

.product-card .woocommerce-LoopProduct-link {
  display: block;
  padding: 0.75rem 0.9rem 1rem;
}

/* Текст и цена внутри карточки */
.product-card .woocommerce-loop-product__title {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  color: #111827;
}

.product-card .price {
  font-weight: 600;
  color: #111827;
}

.product-card .star-rating {
  margin-top: 0.3rem;
}

/* Кнопка "В корзину" в каталоге */
.product-card .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  border-radius: 9999px;
  background-color: #111827;
  color: #ffffff;
  border: none;
  text-decoration: none;
}

.product-card .button:hover {
  background-color: #000000;
  color: #ffffff;
}

/* ========== Карточка товара (single product) ========== */

.product-page {
  margin-bottom: 3rem;
}

.product-page__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: flex-start;
}

/* Мобильная адаптация */
@media (max-width: 960px) {
  .product-page__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Галерея товара */
.product-page__gallery .woocommerce-product-gallery {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background-color: #ffffff;
}

/* Блок с заголовком, ценой, кнопкой "В корзину" и т.п. */
.product-page__summary .summary {
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.product-page__summary .product_title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-page__summary .price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  margin: 0.75rem 0 0.5rem;
}

/* Краткое описание */
.product-page__summary .woocommerce-product-details__short-description {
  margin-bottom: 1rem;
  color: #4b5563;
}

/* Кнопка "В корзину" */
.product-page__summary .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 9999px;
  padding: 0.65rem 1.35rem;
  background-color: #111827;
  color: #ffffff;
  border: none;
  text-decoration: none;
  font-weight: 500;
}

.product-page__summary .single_add_to_cart_button:hover {
  background-color: #000000;
  color: #ffffff;
}

/* Поле количества рядом с кнопкой */
.product-page__summary .quantity .qty {
  width: 4rem;
  text-align: center;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  margin-right: 0.5rem;
}

/* Метаданные: SKU, категории, теги */
.product-page__summary .product_meta {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Теги как "чипы" */
.product-page__summary .product_meta .tagged_as a {
  display: inline-block;
  margin: 0.15rem 0.35rem 0.15rem 0;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
}

.product-page__summary .product_meta .tagged_as a:hover {
  background-color: #e5e7eb;
  color: #111827;
}

/* Вкладки (описание, характеристики, отзывы) */
.woocommerce-tabs {
  margin-top: 2.5rem;
}

.woocommerce-tabs ul.tabs {
  border-bottom: 1px solid #e5e7eb;
  padding-left: 0;
}

/* ========== Блоки "Похожие товары" и "Сопутствующие" ========== */

.product-section {
  margin-top: 3rem;
}

.product-section__title,
.woocommerce .upsells > h2,
.woocommerce .related > h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Общая сетка для похожих и сопутствующих */
.product-section .products,
.woocommerce .upsells ul.products,
.woocommerce .related ul.products {
  gap: 1.5rem;
}

.upsells,
.related {
  margin-top: 3rem;
}

.product-section--similar {
  margin-top: 3rem;
}

.product-section--accessories {
  margin-top: 2.5rem;
}

/* ========== Корзина ========== */

.web-aim-cart-table {
  margin-bottom: 2rem;
}

.web-aim-cart-table th,
.web-aim-cart-table td {
  vertical-align: middle;
}

/* Старая/новая цена в корзине */
.web-aim-price-old {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: line-through;
}

.web-aim-price-new {
  display: block;
  font-weight: 600;
}

/* Coupon + actions */
.woocommerce-cart .cart .actions {
  text-align: right;
}

.woocommerce-cart .cart .coupon {
  float: left;
}

.woocommerce-cart .cart .coupon input.input-text {
  min-width: 180px;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.75rem;
}

/* Итоги корзины */
.web-aim-cart-totals {
  background-color: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid #e5e7eb;
}

.web-aim-cart-totals .cart-totals__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.web-aim-cart-totals table.shop_table {
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

.web-aim-cart-totals table.shop_table th {
  font-weight: 500;
}

.web-aim-cart-totals .order-total th,
.web-aim-cart-totals .order-total td {
  font-size: 1.1rem;
  font-weight: 600;
}

.web-aim-cart-totals .cart-totals__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ========== Чекаут ========== */

.web-aim-review-order__sku {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.web-aim-review-order tfoot th {
  font-weight: 500;
}

/* Чекаут формы */
.woocommerce-checkout form.checkout {
  margin-top: 1rem;
}

/* ========== One Page Checkout Layout ========== */

.onepage-checkout {
  margin-bottom: 3rem;
}

.onepage-checkout__header {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.onepage-checkout__title {
  font-size: 1.8rem;
  font-weight: 600;
}

.onepage-checkout__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
}

.onepage-checkout__section {
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.onepage-checkout__section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* На планшете / мобильном — одна колонка */
@media (max-width: 960px) {
  .onepage-checkout__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .onepage-checkout__column--cart {
    order: 1;
  }

  .onepage-checkout__column--checkout {
    order: 2;
  }
}

/* Немного косметики для таблиц на корзине/чекауте */

.woocommerce-cart table.shop_table,
.woocommerce-checkout table.shop_table {
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Общая кнопка "Оформить заказ" */
.woocommerce a.checkout-button,
.woocommerce button.checkout-button,
.woocommerce input.checkout-button {
  border-radius: 9999px;
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
}
