/**
 * Estilos del carrito lateral (drawer) — Vivero Daliz
 *
 * Drawer deslizable desde la derecha con overlay,
 * lista de productos, controles de cantidad y botones CTA.
 */

/* =============================================
   Overlay
   ============================================= */
.vivero-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vivero-cart-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* =============================================
   Drawer principal
   ============================================= */
.vivero-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 400px;
	max-width: 90vw;
	height: 100vh;
	background: #ffffff;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
	font-family: 'Open Sans', sans-serif;
}

.vivero-cart-drawer.is-open {
	transform: translateX(0);
}

/* =============================================
   Cabecera
   ============================================= */
.vivero-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.vivero-cart-drawer__title {
	font-family: 'Playfair Display', serif;
	font-size: 1.25rem;
	font-weight: 600;
	color: #2A4428;
	margin: 0;
}

.vivero-cart-drawer__close {
	background: none;
	border: none;
	cursor: pointer;
	color: #2A4428;
	padding: 4px;
	border-radius: 4px;
	transition: background 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vivero-cart-drawer__close:hover {
	background: #f0f0f0;
}

/* =============================================
   Lista de items
   ============================================= */
.vivero-cart-drawer__items {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
}

/* Item individual */
.vivero-cart-drawer__item {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #f0f0f0;
	align-items: flex-start;
}

.vivero-cart-drawer__item:last-child {
	border-bottom: none;
}

/* Imagen del item */
.vivero-cart-drawer__item-img {
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f5f5f5;
}

.vivero-cart-drawer__item-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Info del item */
.vivero-cart-drawer__item-info {
	flex: 1;
	min-width: 0;
}

.vivero-cart-drawer__item-name {
	font-size: 0.875rem;
	font-weight: 600;
	color: #2A4428;
	margin: 0 0 4px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vivero-cart-drawer__item-price {
	font-size: 0.875rem;
	color: #555;
	margin-bottom: 8px;
}

/* Controles de cantidad */
.vivero-cart-drawer__qty {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	width: fit-content;
}

.vivero-cart-drawer__qty-btn {
	background: #f8f8f8;
	border: none;
	width: 30px;
	height: 30px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	color: #2A4428;
	transition: background 0.2s ease;
}

.vivero-cart-drawer__qty-btn:hover {
	background: #e8e8e8;
}

.vivero-cart-drawer__qty-val {
	width: 36px;
	text-align: center;
	font-size: 0.85rem;
	font-weight: 600;
	color: #333;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	line-height: 30px;
}

/* Botón eliminar */
.vivero-cart-drawer__item-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #999;
	padding: 4px;
	flex-shrink: 0;
	transition: color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	margin-top: 2px;
}

.vivero-cart-drawer__item-remove:hover {
	color: #c0392b;
}

/* =============================================
   Estado vacío
   ============================================= */
.vivero-cart-drawer__empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 40px 24px;
	text-align: center;
}

.vivero-cart-drawer__empty p {
	font-size: 1rem;
	color: #888;
	margin: 0;
}

.vivero-cart-drawer__shop-link {
	display: inline-block;
	padding: 10px 24px;
	background: #2A4428;
	color: #ffffff;
	text-decoration: none;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 600;
	transition: background 0.2s ease;
}

.vivero-cart-drawer__shop-link:hover {
	background: #1e3320;
	color: #ffffff;
}

/* =============================================
   Pie del drawer (subtotal + botones)
   ============================================= */
.vivero-cart-drawer__footer {
	padding: 20px 24px;
	border-top: 1px solid #e8e8e8;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.vivero-cart-drawer__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 1rem;
}

.vivero-cart-drawer__subtotal span {
	color: #555;
}

.vivero-cart-drawer__subtotal strong {
	font-size: 1.125rem;
	color: #2A4428;
}

/* Botones CTA */
.vivero-cart-drawer__btn {
	display: block;
	text-align: center;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	cursor: pointer;
}

.vivero-cart-drawer__btn--primary {
	background: #2A4428;
	color: #ffffff;
}

.vivero-cart-drawer__btn--primary:hover {
	background: #1e3320;
	color: #ffffff;
}

.vivero-cart-drawer__btn--outline {
	background: transparent;
	color: #2A4428;
	border: 1.5px solid #2A4428;
}

.vivero-cart-drawer__btn--outline:hover {
	background: #2A4428;
	color: #ffffff;
}

/* =============================================
   Imagen del producto en card (para el front-page)
   ============================================= */
.vivero-featured__card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Estado de carga del botón agregar al carrito */
.vivero-featured__card-cart.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Corazón activo (wishlist visual) — color unificado con vivero-home.css */
.vivero-featured__card-fav.is-active svg {
	fill: #e74c3c;
	stroke: #e74c3c;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 480px) {
	.vivero-cart-drawer {
		width: 100vw;
		max-width: 100vw;
	}

	.vivero-cart-drawer__header {
		padding: 16px 16px;
	}

	.vivero-cart-drawer__items {
		padding: 12px 16px;
	}

	.vivero-cart-drawer__footer {
		padding: 16px 16px;
	}

	.vivero-cart-drawer__item-img {
		width: 60px;
		height: 60px;
	}
}
