/**
 * Dravin Wishlist And Cart Bar — Frontend Styles
 *
 * Sticky bottom bar with wishlist + add-to-cart for mobile.
 * Pixel-perfect match to The Souled Store reference:
 *   - Container: 430.4 × 61.6, padding 10px, bg #FFF
 *   - Wishlist: col-5 (41.67%), btn 165.16 × 41.6, font 15px #000
 *   - Cart: col-auto (58.33%), btn 235.24 × 41.6, bg #EC3D25, font 15px #FFF
 *   - Icon: 20 × 20
 *
 * @package Dravin_WCBar
 */

/* ==========================================================================
   1. BASE BAR — padded container, buttons float inside
   ========================================================================== */

.dwcb-sticky-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100% !important;
	display: none;
	flex-direction: row;
	align-items: center;
	z-index: var(--dwcb-z-index, 9999);
	background: var(--dwcb-bar-bg, #ffffff);
	padding: 10px;
	gap: 0;
	height: auto;
	min-height: 62px;
	border-radius: 0;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
	transition: transform var(--dwcb-entry-duration, 0.4s) cubic-bezier(0.4, 0, 0.2, 1),
				opacity var(--dwcb-entry-duration, 0.4s) ease;
}

.dwcb-sticky-bar.dwcb-visible {
	display: flex !important;
}

.dwcb-sticky-bar *,
.dwcb-sticky-bar *::before,
.dwcb-sticky-bar *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   2. WISHLIST BUTTON — col-5 equivalent (41.67%)
   Ref: 165.16 × 41.6, color #000, font 15px Source Sans Pro, p-0
   ========================================================================== */

.dwcb-wishlist-btn {
	flex: 0 0 var(--dwcb-wishlist-width, 41.67%) !important;
	width: var(--dwcb-wishlist-width, 41.67%) !important;
	max-width: var(--dwcb-wishlist-width, 41.67%) !important;
	min-width: 0 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 42px;
	background: transparent;
	border: 1px solid #222222;
	border-radius: 2px;
	color: #000000;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Source Sans Pro', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	padding: 0;
	line-height: 1;
}

.dwcb-wishlist-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

/* --- Wishlist icon wrapper — 20 × 20 --- */
.dwcb-wishlist-btn .dwcb-wishlist-icon-wrap {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	font-size: 20px;
	line-height: 1;
}

/* --- Icon visibility --- */
.dwcb-wishlist-btn .dravin-wishlist-icon-inactive,
.dwcb-wishlist-btn .dravin-wishlist-icon-active {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.dwcb-wishlist-btn .dravin-wishlist-icon-active {
	display: none;
}

.dwcb-wishlist-btn.is-active .dravin-wishlist-icon-inactive {
	display: none;
}

.dwcb-wishlist-btn.is-active .dravin-wishlist-icon-active {
	display: inline-flex;
}

.dwcb-wishlist-btn.is-active {
	color: #e74c3c;
}

.dwcb-wishlist-btn:hover {
	background: #f9f9f9;
}

.dwcb-wishlist-text {
	display: inline-block;
	line-height: 1.2;
	white-space: nowrap;
}

.dwcb-wishlist-btn svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* ==========================================================================
   3. WISHLIST ANIMATIONS
   ========================================================================== */

@keyframes dwcb-heartbeat {
	0%   { transform: scale(1); }
	25%  { transform: scale(var(--dwcb-wishlist-pulse-scale, 1.3)); }
	50%  { transform: scale(1); }
	75%  { transform: scale(var(--dwcb-wishlist-pulse-scale, 1.3)); }
	100% { transform: scale(1); }
}

@keyframes dwcb-bounce {
	0%, 100% { transform: scale(1); }
	40%      { transform: scale(var(--dwcb-wishlist-pulse-scale, 1.3)); }
	60%      { transform: scale(0.9); }
	80%      { transform: scale(1.1); }
}

.dwcb-wishlist-btn.dwcb-animating-pulse .dwcb-wishlist-icon-wrap {
	animation: dwcb-heartbeat 0.6s ease-in-out;
}

.dwcb-wishlist-btn.dwcb-animating-bounce .dwcb-wishlist-icon-wrap {
	animation: dwcb-bounce 0.6s ease-in-out;
}

/* ==========================================================================
   4. ADD-TO-CART BUTTON — col-auto equivalent (remaining ~58%)
   Ref: 235.24 × 41.6, bg #EC3D25, color #FFF, font 15px, padding 4px 18px 3px
   ========================================================================== */

.dwcb-cart-btn {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 42px;
	padding: 4px 18px 3px;
	margin-left: 10px;
	background: #EC3D25;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 700;
	font-family: 'Source Sans Pro', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	line-height: 1.2;
	white-space: nowrap;
}

.dwcb-cart-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.dwcb-cart-btn:hover {
	opacity: 0.9;
}

.dwcb-cart-icon {
	display: inline-flex;
	align-items: center;
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
}

.dwcb-cart-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.dwcb-cart-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: dwcb-spin 0.6s linear infinite;
	flex-shrink: 0;
}

@keyframes dwcb-spin {
	to { transform: rotate(360deg); }
}

.dwcb-cart-btn.is-loading {
	pointer-events: none;
	opacity: 0.85;
}

.dwcb-cart-btn.is-loading .dwcb-cart-icon {
	display: none;
}

.dwcb-cart-btn.is-loading .dwcb-cart-spinner {
	display: inline-block;
}

.dwcb-cart-btn.is-added {
	background: #27ae60;
	color: #ffffff;
}

.dwcb-cart-btn.is-added .dwcb-cart-spinner {
	display: none;
}

.dwcb-cart-btn.is-added .dwcb-cart-icon {
	display: none;
}

.dwcb-cart-btn.is-disabled {
	pointer-events: none;
	opacity: 0.5;
	cursor: not-allowed;
}

@keyframes dwcb-shake {
	0%, 100% { transform: translateX(0); }
	20%      { transform: translateX(-6px); }
	40%      { transform: translateX(6px); }
	60%      { transform: translateX(-4px); }
	80%      { transform: translateX(4px); }
}

.dwcb-cart-btn.dwcb-shake {
	animation: dwcb-shake 0.4s ease;
}

/* ==========================================================================
   5. ENTRY ANIMATIONS
   ========================================================================== */

.dwcb-sticky-bar.dwcb-animation-slide-up {
	transform: translateY(100%);
	opacity: 0;
}

.dwcb-sticky-bar.dwcb-animation-slide-up.dwcb-entered {
	transform: translateY(0);
	opacity: 1;
}

.dwcb-sticky-bar.dwcb-animation-fade-in {
	opacity: 0;
}

.dwcb-sticky-bar.dwcb-animation-fade-in.dwcb-entered {
	opacity: 1;
}

.dwcb-sticky-bar.dwcb-animation-none.dwcb-visible {
	opacity: 1;
	transform: none;
}

/* ==========================================================================
   6. ELEMENTOR EDITOR — full-width realistic preview
   ========================================================================== */

.elementor-editor-active .dwcb-sticky-bar {
	position: relative !important;
	bottom: auto !important;
	left: auto !important;
	right: auto !important;
	display: flex !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08) !important;
	transform: none !important;
	opacity: 1 !important;
	overflow: visible !important;
}

/* ==========================================================================
   7. SAFE-AREA (iPhone notch)
   ========================================================================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
	.dwcb-sticky-bar.dwcb-safe-area {
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
}
