/* =============================================
   Shared product card ("deal card")
   Used by: homepage carousels (Oraimo, Laptops, Accessories, Phones)
   AND category/brand/shop product grids.

   Also styles the color/border of the New Arrivals WhatsApp button
   (.simple-card__btn) and the overlay Add to Cart icon
   (.cart-overlay-btn, now actively used by New Arrivals cards on the
   homepage — bottom-right corner of the product image) so both
   sections look identical. Layout-only rules for .simple-card__btn
   live in front-page.css next to the rest of New Arrivals — this
   file only owns color/border, so nothing is duplicated.
   ============================================= */

.deal-card {
	flex: 0 0 calc((100% - 4 * 16px) / 4.5);
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
	background: var(--color-bg);
}

.deal-card:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.deal-card__image-link {
	position: relative;
	display: block;
	text-decoration: none;
}

.deal-card__image-anchor {
	display: block;
}

.deal-card__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--color-accent);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 999px;
	z-index: 2;
}

.deal-card__image {
	aspect-ratio: 1 / 1;
	background: var(--color-bg-alt);
	overflow: hidden;
}

.deal-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.deal-card__image--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}

.deal-card__body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.deal-card__title-link {
	text-decoration: none;
	color: inherit;
}

.deal-card__title {
	font-size: 0.9rem;
	font-weight: 500;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- Price hierarchy ---- */
.deal-card__price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 0.9rem;
}

.deal-card__price-regular {
	color: var(--color-text-muted);
	text-decoration: line-through;
	font-size: 0.8rem;
	font-weight: 400;
}

.deal-card__price-sale,
.deal-card__price ins {
	color: var(--color-accent);
	font-weight: 700;
	font-size: 0.98rem;
	text-decoration: none;
}

.deal-card__price del {
	color: var(--color-text-muted);
	font-size: 0.8rem;
	font-weight: 400;
	margin-right: 4px;
	text-decoration: line-through;
}

.deal-card__actions {
	display: flex;
	gap: 8px;
	margin-top: 2px;
	align-items: stretch;
}

/* Shared button base */
.deal-card__btn,
.simple-card__btn {
	flex: 1;
	min-width: 0;
	padding: 8px 8px;
	font-size: 0.78rem;
	font-weight: 700;
	text-align: center;
	white-space: normal;
	line-height: 1.2;
	overflow-wrap: break-word;
	border-radius: 999px;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	text-decoration: none;
}

/* WhatsApp button — shared by carousel cards and New Arrivals */
.whatsapp-btn-label {
	border: 1.5px solid #25d366;
	color: #1ebe5b;
	background: transparent;
	font-weight: 700;
}

.whatsapp-btn-label:hover,
.whatsapp-btn-label:focus-visible {
	background: rgba(37, 211, 102, 0.08);
	color: #1ebe5b;
	border-color: #25d366;
}

/* Add to Cart button — used by carousel cards (.deal-card__btn) */
.deal-card__btn.btn-secondary,
.deal-card__btn.btn-primary {
	border: 1.5px solid var(--color-accent);
	color: var(--color-accent);
	background: transparent;
	font-weight: 700;
}

.deal-card__btn.btn-secondary:hover,
.deal-card__btn.btn-secondary:focus-visible,
.deal-card__btn.btn-primary:hover,
.deal-card__btn.btn-primary:focus-visible {
	background: rgba(0, 0, 0, 0.03);
}

/* Keep icons from shrinking */
.deal-card__btn svg,
.simple-card__btn svg {
	flex-shrink: 0;
}

/* ---- Add to Cart — "Added" state (carousel cards) ----
   Solid fill confirms the click registered, and it visually reads as
   inert now that clicking it again does nothing (JS disables it via
   aria-disabled once added — see product-card.js). Matches the same
   solid-success treatment the single product page's buy box button
   already uses, so the confirmation looks consistent everywhere. */
.deal-card__btn.solid-add-to-cart-btn.is-added {
	background: var(--color-success);
	border-color: var(--color-success);
	color: #fff;
	cursor: default;
}

.deal-card__btn.solid-add-to-cart-btn.is-added:hover,
.deal-card__btn.solid-add-to-cart-btn.is-added:focus-visible {
	background: var(--color-success);
	border-color: var(--color-success);
	color: #fff;
}

@media (max-width: 640px) {
	.deal-card__actions {
		flex-direction: column;
	}

	.deal-card__btn,
	.simple-card__btn {
		padding: 8px 6px;
		font-size: 0.74rem;
		min-height: 36px;
	}
}

/* =============================================
   Add to Cart overlay button
   Now actively used by New Arrivals cards on the homepage — sits at
   the bottom-right corner of the product image, overlapping it
   slightly. Also available for reuse on category/brand cards later
   if wanted, since it shares the same .solid-add-to-cart-btn JS hook
   and is-added state as every other Add to Cart button in the theme.
   ============================================= */

.cart-overlay-btn {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--color-bg);
	color: var(--color-text);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: background 0.15s ease, color 0.15s ease;
	text-decoration: none;
	border: 1px solid var(--color-border);
}

.cart-overlay-btn:hover,
.cart-overlay-btn:focus-visible {
	background: var(--color-accent);
	color: #fff;
	border-color: var(--color-accent);
}

.cart-overlay-btn .cart-icon-added {
	display: none;
}

.cart-overlay-btn.is-added {
	background: var(--color-success);
	color: #fff;
	border-color: var(--color-success);
	cursor: default;
}

.cart-overlay-btn.is-added:hover,
.cart-overlay-btn.is-added:focus-visible {
	background: var(--color-success);
	color: #fff;
	border-color: var(--color-success);
}

.cart-overlay-btn.is-added .cart-icon-default {
	display: none;
}

.cart-overlay-btn.is-added .cart-icon-added {
	display: block;
}

@media (max-width: 640px) {
	.cart-overlay-btn {
		width: 34px;
		height: 34px;
	}

	.cart-overlay-btn svg {
		width: 16px;
		height: 16px;
	}
}