/**
 * Wishlist Pro for Divi — Frontend Styles
 *
 * Uses CSS custom properties so colors can be overridden via
 * the admin settings page (fase 7) without touching this file.
 *
 * @package WishlistProForDivi
 * @since   1.0.0
 */

/* ============================================================
   Custom properties (overridden by admin color settings)
   ============================================================ */

:root {
	--wpd-color:        #e74c3c;
	--wpd-color-border: currentColor;
	--wpd-transition:   color .15s ease, border-color .15s ease, fill .15s ease;
}

/* ============================================================
   Toggle button
   ============================================================ */

.wpd-toggle-btn {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	gap:             .4em;
	width:           100%;
	padding:         .5em .85em;
	margin-top:      .5em;
	background:      transparent;
	border:          1px solid var(--wpd-color-border);
	border-radius:   3px;
	color:           inherit;
	font-family:     inherit;
	font-size:       inherit;
	line-height:     inherit;
	cursor:          pointer;
	transition:      var(--wpd-transition);
	-webkit-appearance: none;
}

.wpd-toggle-btn:hover {
	border-color: var(--wpd-color);
	opacity:      .85;
}

.wpd-toggle-btn--active {
	color:        var(--wpd-color);
	border-color: var(--wpd-color);
}

.wpd-toggle-btn:disabled,
.wpd-toggle-btn--loading {
	opacity: .6;
	cursor:  wait;
}

/* Heart icon */

.wpd-toggle-btn svg {
	display:      block;
	width:        1em;
	height:       1em;
	fill:         none;
	stroke:       currentColor;
	stroke-width: 2;
	flex-shrink:  0;
	transition:   var(--wpd-transition);
}

.wpd-toggle-btn--active svg {
	fill: currentColor;
}

/* Label text */

.wpd-toggle-btn__label {
	white-space: nowrap;
}

/* ============================================================
   Counter badge  [wishlist_pro_count]
   ============================================================ */

.wpd-count-wrapper {
	display:     inline-flex;
	align-items: center;
	gap:         .35em;
}

.wpd-count-wrapper svg {
	display:      block;
	width:        1em;
	height:       1em;
	fill:         none;
	stroke:       currentColor;
	stroke-width: 2;
	flex-shrink:  0;
}

.wpd-count {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	min-width:       1.3em;
	height:          1.3em;
	padding:         0 .3em;
	background:      var(--wpd-color);
	color:           #fff;
	border-radius:   1em;
	font-size:       .72em;
	font-weight:     700;
	line-height:     1;
}

/* ============================================================
   Counter Divi Module  [wpd/wishlist-counter]
   ============================================================ */

.wpd-counter {
	display:     inline-flex;
	align-items: center;
	gap:         .35em;
	color:       var(--wpd-counter-color, currentColor);
}

.wpd-counter:hover {
	color: var(--wpd-counter-hover-color, var(--wpd-counter-color, currentColor));
}

.wpd-counter__icon {
	display:      block;
	width:        var(--wpd-icon-size, 1.25em);
	height:       var(--wpd-icon-size, 1.25em);
	fill:         none;
	stroke:       currentColor;
	stroke-width: 2;
	flex-shrink:  0;
}

/* Badge / sup layout */

.wpd-counter--badge .wpd-counter__icon-wrap {
	position: relative;
	display:  inline-flex;
}

.wpd-counter--badge .wpd-counter__icon {
	width:  var(--wpd-icon-size, 1.75em);
	height: var(--wpd-icon-size, 1.75em);
}

.wpd-counter--badge .wpd-count {
	position: absolute;
	top:      -6px;
	right:    -6px;
	min-width: 16px;
	height:    16px;
	padding:   0 3px;
	font-size: .65em;
}

/* ============================================================
   Wishlist page  [wishlist_pro]
   ============================================================ */

.wpd-wishlist__header {
	display:       flex;
	flex-wrap:     wrap;
	align-items:   baseline;
	gap:           .5em 1.5em;
	margin-bottom: 1.5em;
}

.wpd-wishlist__name {
	margin: 0;
}

.wpd-wishlist__share {
	margin-left: auto;
	text-align:  right;
}

.wpd-wishlist__share-label {
	display:       block;
	font-size:     .85em;
	margin-bottom: .4em;
}

.wpd-wishlist__share-icons {
	display:         flex;
	flex-wrap:       wrap;
	justify-content: flex-end;
	gap:             .4em;
}

.wpd-share-btn {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	width:           2.25em;
	height:          2.25em;
	padding:         0;
	border:          1px solid currentColor;
	border-radius:   50%;
	background:      transparent;
	color:           inherit;
	opacity:         .6;
	cursor:          pointer;
	text-decoration: none;
	transition:      opacity .15s, background-color .15s, color .15s, border-color .15s;
}

.wpd-share-btn:hover { opacity: 1; }

.wpd-share-btn svg {
	width:   1em;
	height:  1em;
	display: block;
}

.wpd-share-btn--facebook svg,
.wpd-share-btn--x svg {
	width:  1.4em;
	height: 1.4em;
}

.wpd-share-btn--copy:hover      { background: var(--wpd-color); color: #fff; border-color: var(--wpd-color); }
.wpd-share-btn--mail:hover      { background: #555;     color: #fff; border-color: #555; }
.wpd-share-btn--whatsapp:hover  { background: #25d366;  color: #fff; border-color: #25d366; }
.wpd-share-btn--facebook:hover  { background: #1877f2;  color: #fff; border-color: #1877f2; }
.wpd-share-btn--x:hover         { background: #000;     color: #fff; border-color: #000; }
.wpd-share-btn--instagram:hover { background: #e1306c;  color: #fff; border-color: #e1306c; }

.wpd-share-btn--copied,
.wpd-share-btn--copied:hover {
	background:   #27ae60 !important;
	color:        #fff !important;
	border-color: #27ae60 !important;
	opacity:      1 !important;
}

.wpd-share-btn--copy,
.wpd-share-btn--instagram {
	position: relative;
}

.wpd-share-btn--copy::after,
.wpd-share-btn--instagram::after {
	content:       attr(data-copied-label);
	position:      absolute;
	bottom:        calc(100% + 6px);
	left:          50%;
	transform:     translateX(-50%) translateY(4px);
	background:    #27ae60;
	color:         #fff;
	font-size:     .7em;
	white-space:   nowrap;
	padding:       .25em .55em;
	border-radius: 3px;
	pointer-events: none;
	opacity:       0;
	transition:    opacity .15s, transform .15s;
}

.wpd-share-btn--copied::after {
	opacity:   1;
	transform: translateX(-50%) translateY(0);
}

.wpd-wishlist__empty {
	display:        flex;
	flex-direction: column;
	align-items:    flex-start;
	gap:            .75em;
}

.wpd-wishlist__items {
	list-style: none;
	margin:     0;
	padding:    0;
	display:    flex;
	flex-direction: column;
	gap:        0;
}

.wpd-wishlist__item {
	display:               grid;
	grid-template-columns: auto 1fr auto;
	gap:                   1em;
	align-items:           start;
	padding:               1.25em 0;
	border-bottom:         1px solid rgba(0, 0, 0, .08);
}

.wpd-wishlist__item:first-child {
	padding-top: 0;
}

.wpd-wishlist__item:last-child {
	border-bottom: none;
}

.wpd-item__image {
	width:         80px;
	overflow:      hidden;
	border-radius: 3px;
	flex-shrink:   0;
}

.wpd-item__image img {
	display: block;
	width:   100%;
	height:  auto;
}

.wpd-item__info {
	display:        flex;
	flex-direction: column;
	gap:            .25em;
}

.wpd-item__name {
	margin:    0;
	font-size: 1em;
}

.wpd-item__name a {
	text-decoration: none;
	color:           inherit;
}

.wpd-item__name a:hover {
	text-decoration: underline;
}

.wpd-item__variation {
	font-size: .85em;
	opacity:   .75;
}

.wpd-item__variation-notice {
	font-size:  .85em;
	font-style: italic;
	opacity:    .75;
	margin:     0;
}

.wpd-item__price {
	font-weight: 600;
}

.wpd-item__stock-notice {
	font-size: .85em;
	color:     var(--wpd-color);
	margin:    0;
}

.wpd-item__actions {
	display:        flex;
	flex-direction: column;
	align-items:    stretch;
	gap:            .4em;
	min-width:      110px;
}

.wpd-item__actions .button,
.wpd-item__actions .wpd-toggle-btn {
	width:      100%;
	text-align: center;
	margin-top: 0;
}

/* Responsive: stack actions below info on narrow screens */

@media (max-width: 480px) {
	.wpd-wishlist__item {
		grid-template-columns: auto 1fr;
		grid-template-rows:    auto auto;
	}

	.wpd-item__actions {
		grid-column:  2;
		align-items:  flex-start;
		min-width:    0;
	}
}
