/*
Theme Name: Bretel
Theme URI: https://bretelie.ru
Author: Alex Kovalev
Author URI: https://akovalev.pro
Description: Тема интернет-магазина Бретэлье — перенос с OpenCart на WordPress/WooCommerce
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bretel
Tags: e-commerce, woocommerce
*/

/* =============================================
   WooCommerce → OpenCart class bridge
   ============================================= */

/* Single product — main thumbnail */
.thumbnails > li:first-child {
	float: none;
	margin-left: 0;
	margin-bottom: 20px;
}

.thumbnails > li:first-child a.thumbnail {
	display: block;
}

.thumbnails > li:first-child a.thumbnail img {
	width: 100%;
	height: auto;
}

/* Product card — единая высота превью (квадрат + object-fit) */
.product-thumb .image {
	position: relative !important;
	display: block !important;
	overflow: hidden !important;
	aspect-ratio: 1 / 1;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.product-thumb .image img,
.product-thumb .image img.bretel-product-loop-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Мини-корзина: квадратное превью (woocommerce_gallery_thumbnail) */
.woocommerce-mini-cart-item img.bretel-mini-cart-thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	display: inline-block;
	vertical-align: middle;
	border-radius: 2px;
}

.product-thumb .discaunt_marker,
.product-thumb .product-badge.new-badge {
	position: absolute !important;
	top: 10px !important;
	z-index: 999 !important;
	font-size: 11px !important;
	padding: 4px 8px !important;
	border-radius: 3px !important;
	font-weight: bold !important;
	text-transform: uppercase !important;
	color: #fff !important;
	display: inline-block !important;
	line-height: 1.2 !important;
	min-width: auto !important;
	height: auto !important;
}

.product-thumb .discaunt_marker {
	left: 10px !important;
	background: linear-gradient(135deg, #991ab8 0%, #7a1595 100%) !important;
	box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.product-thumb .product-badge.new-badge {
	right: 10px !important;
	background: linear-gradient(135deg, #f066ff 0%, #e64de6 100%) !important;
	box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Homepage banner */
.bretel-homepage-banner {
	width: 100%;
	height: auto;
	display: block;
	margin-bottom: 20px;
}

/* Remove default WC product border */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	border: 0;
	margin: 0;
	padding: 0;
	float: none;
	width: auto;
}

/* Product grid — keep OC sizing */
.product-layout.product-grid {
	margin-bottom: 31px;
}

/* Price overrides */
.price-old-2 {
	font-family: "Ubuntu", sans-serif;
	font-size: 18px;
	color: #999;
	text-decoration: line-through;
	margin-left: 10px;
}

/* Зачёркнутая старая цена — серая; в разметке WC это <del>…woocommerce-Price-amount… */
.woocommerce del .woocommerce-Price-amount {
	color: #999;
}

.attr-label {
	color: #e2499e;
	font-weight: 500;
}

/* Single product gallery — like OC */
#content .thumbnails .thumbnail {
	position: relative;
}

/* Single product — бейджи как в каталоге (переопределяем круглый .discaunt_marker из stylesheet.css) */
#content .thumbnails .discaunt_marker,
#content .thumbnails .product-badge.new-badge {
	position: absolute !important;
	top: 10px !important;
	z-index: 999 !important;
	font-size: 11px !important;
	padding: 4px 8px !important;
	border-radius: 3px !important;
	font-weight: bold !important;
	text-transform: uppercase !important;
	color: #fff !important;
	display: inline-block !important;
	line-height: 1.2 !important;
	min-width: auto !important;
	width: auto !important;
	height: auto !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

#content .thumbnails .discaunt_marker {
	left: 10px !important;
	right: auto !important;
	background: linear-gradient(135deg, #991ab8 0%, #7a1595 100%) !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

#content .thumbnails .product-badge.new-badge {
	right: 10px !important;
	left: auto !important;
	background: linear-gradient(135deg, #f066ff 0%, #e64de6 100%) !important;
}

/* WooCommerce notices */
.woocommerce-message,
.woocommerce-info {
	border-top-color: #e2499e;
}

.woocommerce-message::before {
	color: #e2499e;
}

/* Checkout panels */
.woocommerce-checkout .panel {
	margin-bottom: 20px;
}

.woocommerce-checkout .panel-heading {
	background: #f7f7f7;
	border-bottom: 1px solid #ddd;
}

.woocommerce-checkout .panel-title {
	font-family: "Ubuntu", sans-serif;
	font-weight: 300;
	font-size: 18px;
	color: #666;
}

/* Account navigation */
.woocommerce-MyAccount-navigation {
	float: left;
	width: 25%;
}

.woocommerce-MyAccount-navigation ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.woocommerce-MyAccount-navigation ul li {
	border-bottom: 1px dotted #ddd;
	padding: 10px 0;
}

.woocommerce-MyAccount-navigation ul li a {
	color: #e2499e;
	text-decoration: none;
	text-transform: uppercase;
	font-family: "Ubuntu", sans-serif;
	font-weight: 300;
}

.woocommerce-MyAccount-navigation ul li.is-active a {
	font-weight: 700;
}

.woocommerce-MyAccount-content {
	float: right;
	width: 72%;
}

/* WooCommerce buttons — match OC style */
.woocommerce .btn-style-default,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button {
	background: #e2499e;
	border-bottom: 2px solid #922d65;
	font-size: 14px;
	color: #fff;
	text-transform: uppercase;
	border-radius: 0;
	font-family: "Ubuntu", sans-serif;
	font-weight: 300;
}

.woocommerce .btn-style-default:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover {
	background: #f50c8e;
	color: #fff;
}

/* WC breadcrumbs */
.woocommerce .woocommerce-breadcrumb {
	padding: 8px 0;
	background: none;
	margin-bottom: 10px;
}

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

.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content {
	margin-top: 30px;
	margin-left: 10px;
	margin-right: 10px;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	color: #e2499e;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	background: #e2499e;
	color: #fff;
}

/* Нижняя панель каталога: пагинация слева, «Отображение …» справа */
.bretel-catalog-toolbar {
	margin-top: 15px;
	margin-bottom: 15px;
}

.bretel-catalog-toolbar__pagination nav.woocommerce-pagination {
	text-align: left;
}

.bretel-catalog-toolbar__count {
	text-align: right;
}

/* WooCommerce layout: счётчик по умолчанию с float:left */
.bretel-catalog-toolbar__count .woocommerce-result-count {
	float: none;
	display: block;
	margin: 0;
}

@media (max-width: 767px) {
	.bretel-catalog-toolbar__count {
		margin-top: 10px;
		text-align: right;
	}
}

/* Category sidebar tree */
.category-submenu.active_tree li a:not(.active) {
	display: none;
}

/* =============================================
   Sidebar category widget — yo-am style (OC)
   ============================================= */

#column-left .widget {
	margin-bottom: 20px;
}

#column-left .panel-heading {
	display: none;
}

#column-left .panel-default {
	border: 0;
	box-shadow: none;
	background: transparent;
}

#column-left .menu-body {
	border: 1px solid #ddd;
	background: #fff;
}

#column-left .yo-wrapper {
	background: #fff;
}

#column-left ul.yo-am,
#column-left ul.yo-am ul {
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

#column-left ul.yo-am li {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
}

#column-left ul.yo-am > li + li,
#column-left ul.yo-am ul > li + li {
	border-top: 1px solid #e7e7e7;
}

/* OpenCart yo-am: табличная строка, компактные иконки, + / − вместо стрелок */
#column-left ul.yo-am li .item-wrapper {
	position: relative;
	display: table;
	table-layout: fixed;
	width: 100%;
	margin: 0;
	padding: 0;
	min-height: 0;
	font-size: 13px;
	font-weight: 400;
	text-decoration: none;
	color: #595959;
	background-color: transparent;
	cursor: pointer;
	border: none;
	outline: none;
	transition: color 0.2s, background-color 0.2s;
}

#column-left ul.yo-am li .item-wrapper:hover {
	color: #333;
	background-color: rgba(0, 0, 0, 0.02);
	text-shadow: 0 1px 0 #fff;
}

#column-left ul.yo-am li .item-wrapper.active,
#column-left ul.yo-am li.is-open > .item-wrapper {
	color: #333;
	background-color: rgba(0, 0, 0, 0.02);
}

/* Верхний уровень: узкая колонка под иконку (как в yo-am.css) */
#column-left ul.yo-am > li > .item-wrapper .item-icon {
	display: table-cell;
	width: 4.3em;
	line-height: 1;
	text-align: center;
	vertical-align: middle;
	padding: 0.7em 0.35em 0.7em 0.35em;
}

#column-left ul.yo-am > li > .item-wrapper .item-icon img {
	display: block;
	max-width: 1.5em;
	width: auto;
	height: auto;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
	vertical-align: middle;
	border: 0;
}

#column-left ul.yo-am li .item-title {
	position: relative;
	display: table-cell;
	width: 100%;
	vertical-align: middle;
	padding: 0.7em 0.5em 0.7em 0.35em;
	line-height: 1.618em;
	word-wrap: break-word;
}

/* С иконкой — текст вплотную к колонке; без иконки — обычный отступ слева */
#column-left ul.yo-am li.yo-level-0 > .item-wrapper .item-title {
	padding-left: 0.7em;
}
#column-left ul.yo-am > li > .item-wrapper .item-icon ~ .item-title {
	padding-left: 0;
}

#column-left ul.yo-am li .item-title-root {
	font-size: 14px;
	text-transform: none;
}

#column-left ul.yo-am li.yo-level-1 .item-wrapper,
#column-left ul.yo-am li.yo-level-2 .item-wrapper {
	display: table;
}

#column-left ul.yo-am li.yo-level-1 .item-wrapper .item-title,
#column-left ul.yo-am li.yo-level-2 .item-wrapper .item-title {
	padding-left: 1.5em;
}

#column-left ul.yo-am li.yo-level-2 .item-wrapper .item-title {
	padding-left: 2.5em;
}

#column-left ul.yo-am li.yo-level-1 .item-wrapper,
#column-left ul.yo-am li.yo-level-2 .item-wrapper,
#column-left ul.yo-am li.yo-level-1.is-open > .item-wrapper,
#column-left ul.yo-am li.yo-level-2.is-open > .item-wrapper {
	background-color: transparent;
}

#column-left ul.yo-am li.yo-level-1 .item-title::before,
#column-left ul.yo-am li.yo-level-2 .item-title::before {
	content: "•";
	display: inline-block;
	margin-right: 6px;
	color: rgba(0, 0, 0, 0.35);
	font-weight: normal;
}

/* Аккордеон: плюс закрыто, минус открыто (как в оригинале, не стрелки FA) */
#column-left ul.yo-am li .btn-toggle {
	display: table-cell;
	width: 2.7em;
	vertical-align: middle;
	text-align: center;
	padding: 0;
	margin: 0;
	cursor: pointer;
	border-left: 1px solid transparent;
	box-shadow: none;
}

#column-left ul.yo-am li .item-wrapper:hover .btn-toggle {
	border-left: 1px solid rgba(0, 0, 0, 0.085);
}

#column-left ul.yo-am li .btn-toggle span {
	position: relative;
	display: block;
	width: 2em;
	height: 2em;
	line-height: 2em;
	margin: 0 auto;
}

#column-left ul.yo-am li .btn-toggle span::before {
	font-family: "Ubuntu", "Open Sans", sans-serif;
	font-size: 1.15em;
	font-weight: 600;
	line-height: 2em;
	content: "+";
	color: #888;
	opacity: 0.85;
}

#column-left ul.yo-am li.is-open > .item-wrapper .btn-toggle span::before {
	content: "\2212";
	font-size: 1.1em;
}

#column-left ul.yo-am ul {
	display: none;
	background: #fff;
}

#column-left ul.yo-am li.is-open > ul {
	display: block;
}

/* ============================================
   Variable product options — match OC style
   ============================================ */

/* WooCommerce default: form.cart { margin-bottom: 2em; } — не нужен */
.woocommerce div.product form.cart {
	margin-bottom: 0;
}

.woocommerce div.product form.cart .variations {
	width: 100%;
	margin-bottom: 15px;
	border: 0;
	border-collapse: collapse;
}

/* Все строки вариаций видны (раньше скрывались tr:not(:first-child) — ломало выбор цвета+размера) */
.woocommerce div.product form.cart .variations tr td,
.woocommerce div.product form.cart .variations tr th {
	display: block;
	width: 100%;
	border: 0;
	padding: 0;
	vertical-align: middle;
}

.woocommerce div.product form.cart .variations tr + tr {
	margin-top: 10px;
}

.woocommerce div.product form.cart .variations td.label,
.woocommerce div.product form.cart .variations th.label {
	display: block !important;
	padding-right: 0;
	padding-bottom: 10px;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	white-space: normal;
	text-align: left;
	background: none;
	border-radius: 0;
	line-height: normal;
}

.woocommerce div.product form.cart .variations td.label label,
.woocommerce div.product form.cart .variations th.label label {
	font-family: "Ubuntu", sans-serif;
	font-size: 16px;
	font-weight: 300;
	color: #e2499e;
	margin-bottom: 0;
}

.woocommerce div.product form.cart .variations td.label label::before,
.woocommerce div.product form.cart .variations th.label label::before {
	content: "* ";
	color: #e2499e;
}

.woocommerce div.product form.cart .variations td.value {
	padding-top: 0;
}

.woocommerce div.product form.cart .variations td.value select {
	width: 100%;
	max-width: 100%;
	height: 36px;
	border: 1px solid #777;
	border-radius: 4px;
	font-family: "Ubuntu", sans-serif;
	font-size: 14px;
	font-weight: 300;
	padding: 4px 8px;
	padding-right: 28px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	color: #333;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.woocommerce div.product form.cart .variations .reset_variations {
	display: none !important;
}

.woocommerce div.product form.cart .single_variation_wrap .woocommerce-variation-price {
	display: none;
}

.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
	display: none;
}

/* ============================================
   Related products — button-group (OC style)
   ============================================ */

.product-thumb .button-group {
	display: flex;
	overflow: hidden;
	border-top: 1px solid #ddd;
}

.product-thumb .button-group > * {
	flex: 1;
	text-align: center;
	min-width: 0;
}

.product-thumb .button-group > *:first-child {
	border-right: 1px solid #ddd;
}

.product-thumb .button-group .yith-add-to-wishlist-button-block {
	margin: 0 !important;
	padding: 0 !important;
}

.product-thumb .button-group .yith-wcwl-add-to-wishlist-button,
.product-thumb .button-group .compare-button a.compare {
	display: block;
	width: 100%;
	padding: 8px 0;
	background: #eee;
	color: #888;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s;
	text-transform: none;
	font-size: 0;
	line-height: 20px;
}

.product-thumb .button-group .yith-wcwl-add-to-wishlist-button:hover,
.product-thumb .button-group .compare-button a.compare:hover {
	background: #ddd;
	color: #444;
}

.product-thumb .button-group .yith-wcwl-add-to-wishlist-button__label {
	display: none;
}

.product-thumb .button-group .yith-wcwl-add-to-wishlist-button::before {
	font-family: "FontAwesome";
	font-size: 14px;
	content: "\f004";
	color: #888;
}

.product-thumb .button-group .yith-wcwl-add-to-wishlist-button:hover::before {
	color: #444;
}

.product-thumb .button-group .compare-button .label {
	display: none;
}

.product-thumb .button-group .compare-button a.compare::before {
	font-family: "FontAwesome";
	font-size: 14px;
	content: "\f0ec";
	color: #888;
}

.product-thumb .button-group .compare-button a.compare:hover::before {
	color: #444;
}

/* Product container — clear floats without clearfix div */
.woocommerce div.product {
	overflow: hidden;
}

/* ============================================
   Search button — align with input field
   ============================================ */

#search .input-group-btn .btn {
	margin-top: 0;
	height: 40px;
}

/* ============================================
   Hide WC default add-to-cart in variation form
   ============================================ */

.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button {
	display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
	.woocommerce-MyAccount-navigation,
	.woocommerce-MyAccount-content {
		float: none;
		width: 100%;
	}

	.product-thumb .discaunt_marker,
	.product-thumb .product-badge.new-badge {
		font-size: 10px !important;
		padding: 3px 6px !important;
	}
}

@media (max-width: 480px) {
	.bottom-cart .cart-wrapp {
		flex-direction: column;
		gap: 20px;
	}

	.bottom-cart #button-cart {
		margin-left: inherit;
	}
}

.bretel-field-error {
	border-color: #e74c3c !important;
	box-shadow: 0 0 4px rgba(231, 76, 60, .35) !important;
}

/**
 * Корзина: кнопки ± и поле количества в одну линию (без .input-group).
 */
.woocommerce-cart .checkout-cart form.cart .bretel-cart-qty,
.checkout-cart .woocommerce-cart-form .bretel-cart-qty {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	flex-wrap: nowrap !important;
	width: auto !important;
}

.checkout-cart .bretel-cart-qty .quantity input.qty {
	float: none !important;
}

/* Information pages — contact blocks */
.contactBlock {
	overflow: hidden;
	margin-bottom: 40px;
}

.contactMap {
	float: left;
	margin-right: 20px;
	margin-bottom: 10px;
}

/* Footer-line: body offset so content is not hidden behind fixed bar */
body.has-footer-line {
	padding-bottom: 50px;
}

@media (max-width: 768px) {
	body.has-footer-line {
		padding-bottom: 0;
	}
}
