/**
 * Lista želja (YITH WooCommerce Wishlist).
 *
 * Zaseban CSS jer se učitava samo na stranici sa shortcodeom
 * [yith_wcwl_wishlist], pa ne opterećuje ostatak weba.
 *
 * VAŽNO — plugin ispisuje DVA različita markupa, ne jedan responzivan:
 *
 *   desktop   <table class="wishlist_table traditional">  s thead i td-ovima
 *             .product-remove .product-thumbnail .product-name
 *             .product-price .product-stock-status .product-add-to-cart
 *
 *   mobitel   <ul class="wishlist_table responsive mobile">, svaki proizvod
 *             je <li> s .item-wrapper (slika + .item-details) i
 *             .additional-info-wrapper (gumb + brisanje)
 *
 * Zato su niže dva odvojena bloka, a ne jedan s prilagodbama.
 */

.wishlist_table {
	--lz-border: #e6e6e6;
	--lz-muted: #767676;
	--lz-primary: #FA9C18;
	--lz-dark: #12131C;
}

/* Naslov iznad liste — plugin ga ispisuje i kad je prazan. */
.wishlist-title-container:empty {
	display: none;
}

/* ==========================================================================
   DESKTOP — tablica
   ========================================================================== */

table.wishlist_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--lz-border);
	margin-bottom: 32px;
	font-size: 15px;
}

table.wishlist_table thead th {
	background: #fafafa;
	border-bottom: 1px solid var(--lz-border);
	padding: 13px 18px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
	color: var(--lz-muted);
	text-align: left;
}

table.wishlist_table tbody td {
	padding: 16px 18px;
	border-bottom: 1px solid var(--lz-border);
	vertical-align: middle;
	background: #fff;
}

table.wishlist_table tbody tr:last-child td {
	border-bottom: 0;
}

/* --- brisanje --- */

table.wishlist_table th.product-remove,
table.wishlist_table td.product-remove {
	width: 54px;
	text-align: center;
	padding-left: 12px;
	padding-right: 12px;
}

/*
 * WooCommerce drži `.woocommerce a.remove { color: var(--wc-red) !important }`,
 * pa se bez `!important` boja ne da promijeniti — specifičnost tu ne pomaže.
 * Isto vrijedi za hover, gdje WooCommerce podloži crveno.
 */
table.wishlist_table td.product-remove a,
table.wishlist_table td.product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: #b3b3b3 !important;
	background: none !important;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	border-radius: 0;
	text-decoration: none;
	transition: color 150ms;
}

table.wishlist_table td.product-remove a:hover,
table.wishlist_table td.product-remove a.remove:hover {
	color: var(--lz-dark) !important;
	background: none !important;
}

/* --- slika --- */

table.wishlist_table th.product-thumbnail,
table.wishlist_table td.product-thumbnail {
	width: 104px;
}

table.wishlist_table td.product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	display: block;
}

/* --- naziv --- */

table.wishlist_table td.product-name a {
	font-size: 16px;
	font-weight: 600;
	color: var(--lz-dark);
	text-decoration: none;
	line-height: 1.3;
	transition: color 150ms;
}

table.wishlist_table td.product-name a:hover {
	color: var(--lz-primary);
}

/* --- cijena --- */

table.wishlist_table td.product-price {
	font-size: 17px;
	font-weight: 700;
	color: var(--lz-dark);
	white-space: nowrap;
}

table.wishlist_table td.product-price del {
	font-size: 14px;
	font-weight: 400;
	color: var(--lz-muted);
	margin-left: 6px;
}

/* --- stanje --- */

table.wishlist_table td.product-stock-status {
	white-space: nowrap;
}

table.wishlist_table td.product-stock-status .wishlist-in-stock,
table.wishlist_table td.product-stock-status .wishlist-out-of-stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	color: var(--lz-dark);
}

table.wishlist_table td.product-stock-status .wishlist-in-stock:before,
table.wishlist_table td.product-stock-status .wishlist-out-of-stock:before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: 0 0 auto;
}

table.wishlist_table td.product-stock-status .wishlist-in-stock:before {
	background: #16a34a;
}

table.wishlist_table td.product-stock-status .wishlist-out-of-stock:before {
	background: #d63638;
}

/* --- gumb --- */

table.wishlist_table td.product-add-to-cart {
	text-align: right;
	white-space: nowrap;
}

/* ==========================================================================
   GUMB — zajednički za oba prikaza
   ========================================================================== */

.wishlist_table .product-add-to-cart a,
ul.wishlist_table .product-add-to-cart a {
	display: inline-block;
	background: var(--lz-primary);
	color: #fff;
	border: 0;
	border-radius: 0;
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
	text-align: center;
	text-decoration: none;
	transition: filter 150ms;
}

.wishlist_table .product-add-to-cart a:hover,
ul.wishlist_table .product-add-to-cart a:hover {
	background: var(--lz-primary);
	color: #fff;
	filter: brightness(.93);
}

/* Stanje nakon dodavanja — plugin doda `added` i poveznicu na košaricu. */
.wishlist_table .product-add-to-cart a.added_to_cart {
	display: inline-block;
	margin-top: 8px;
	background: none;
	color: var(--lz-muted);
	padding: 0;
	font-size: 13px;
	text-transform: none;
	text-decoration: underline;
}

.wishlist_table .product-add-to-cart a.added_to_cart:hover {
	background: none;
	color: var(--lz-primary);
}

/* ==========================================================================
   MOBITEL — lista kartica
   ========================================================================== */

ul.wishlist_table {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	border: 0;
	display: grid;
	gap: 12px;
}

ul.wishlist_table li {
	position: relative;
	border: 1px solid var(--lz-border);
	background: #fff;
	padding: 16px 16px 18px;
	margin: 0;
}

ul.wishlist_table li .item-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

ul.wishlist_table li .product-thumbnail {
	flex: 0 0 84px;
	width: 84px;
}

ul.wishlist_table li .product-thumbnail img {
	width: 84px;
	height: 84px;
	object-fit: contain;
	display: block;
}

ul.wishlist_table li .item-details {
	flex: 1 1 auto;
	min-width: 0;
	/* mjesto za gumb brisanja u gornjem desnom kutu */
	padding-right: 32px;
}

ul.wishlist_table li .product-name {
	margin: 0 0 6px;
}

ul.wishlist_table li .product-name a {
	font-size: 16px;
	font-weight: 600;
	color: var(--lz-dark);
	text-decoration: none;
	line-height: 1.3;
	display: block;
}

ul.wishlist_table li .product-name a:hover {
	color: var(--lz-primary);
}

/*
 * Tablica cijene i stanja unutar kartice.
 *
 * Ćelije `.label` nose engleske nizove ("Price:", "Stock:") koje plugin
 * ispisuje kao običan tekst, pa se ne mogu prevesti preko CSS-a. Uz ovakav
 * raspored su ionako suvišne — cijena i oznaka zalihe govore same za sebe.
 */
ul.wishlist_table li table.item-details-table,
ul.wishlist_table li table.item-details-table tbody,
ul.wishlist_table li table.item-details-table tr,
ul.wishlist_table li table.additional-info,
ul.wishlist_table li table.additional-info tbody,
ul.wishlist_table li table.additional-info tr {
	display: block;
	width: 100%;
	border: 0;
	margin: 0;
}

ul.wishlist_table li table.item-details-table td,
ul.wishlist_table li table.additional-info td {
	display: block;
	border: 0;
	padding: 0;
	background: none;
	/*
	 * Plugin poravnava vrijednosti udesno pravilom
	 * `.wishlist_table.modern_grid li .item-details table.item-details-table …`,
	 * koje je specifičnije od ovoga. Nadmetati se duljinom selektora ovdje
	 * nema smisla, pa ide `!important`.
	 */
	text-align: left !important;
}

ul.wishlist_table li table.item-details-table td.label,
ul.wishlist_table li table.additional-info td.label {
	display: none;
}

/* cijena — u tablici uz naziv */
ul.wishlist_table li table.item-details-table td.value {
	font-size: 18px;
	font-weight: 700;
	color: var(--lz-dark);
}

/* stanje — u zasebnoj tablici ispod, iznad gumba */
ul.wishlist_table li table.additional-info td.value {
	font-size: 14px;
	color: var(--lz-dark);
	margin-bottom: 12px;
}

ul.wishlist_table li .wishlist-in-stock,
ul.wishlist_table li .wishlist-out-of-stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

ul.wishlist_table li .wishlist-in-stock:before,
ul.wishlist_table li .wishlist-out-of-stock:before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: 0 0 auto;
}

ul.wishlist_table li .wishlist-in-stock:before {
	background: #16a34a;
}

ul.wishlist_table li .wishlist-out-of-stock:before {
	background: #d63638;
}

/* --- donji dio kartice --- */

ul.wishlist_table li .additional-info-wrapper {
	margin-top: 14px;
}

ul.wishlist_table li table.additional-info:empty {
	display: none;
}

ul.wishlist_table li .product-add-to-cart {
	display: block;
}

ul.wishlist_table li .product-add-to-cart a {
	display: block;
	width: 100%;
}

/* Brisanje ide u kut kartice, da ne visi ispod gumba. */
ul.wishlist_table li .product-remove {
	position: absolute;
	top: 10px;
	right: 10px;
	margin: 0;
}

/* `!important` iz istog razloga kao gore. */
ul.wishlist_table li .product-remove a,
ul.wishlist_table li .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: #b3b3b3 !important;
	background: none !important;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	border-radius: 0;
	text-decoration: none;
	transition: color 150ms;
}

ul.wishlist_table li .product-remove a:hover,
ul.wishlist_table li .product-remove a.remove:hover {
	color: var(--lz-dark) !important;
	background: none !important;
}

ul.wishlist_table li .product-remove a img,
ul.wishlist_table li .product-remove a svg {
	width: 17px;
	height: 17px;
}

/* ==========================================================================
   PRAZNA LISTA I PODNOŽJE
   ========================================================================== */

.wishlist-empty {
	border: 1px solid var(--lz-border);
	background: #fff;
	padding: 40px 24px;
	text-align: center;
	font-size: 16px;
	color: var(--lz-muted);
	margin-bottom: 24px;
}

.yith_wcwl_wishlist_footer:empty {
	display: none;
}

.yith_wcwl_wishlist_footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 24px;
}
