/**
 * Custom Card Ubud — Card Builder CSS
 *
 * Exact match to the ATV tour card design.
 * Responsive grid — desktop (4 col), tablet (2 col), mobile (1 col).
 *
 * @package CustomCardUbud
 * @version 1.2.0
 */

/* Kill all underlines in card grid — prevent theme link styles from leaking in */
.ccu-card-builder-grid a,
.ccu-card-builder-grid a:hover,
.ccu-card-builder-grid a:focus,
.ccu-card-builder-grid a:visited {
	text-decoration: none !important;
	box-shadow: none !important;
	outline: none;
}

/* CSS Variables */
.ccu-card-builder-grid {
	--ccu-cb-primary: #ff7a00;
	--ccu-cb-text-dark: #111827;
	--ccu-cb-text-gray: #4b5563;
	--ccu-cb-text-light: #9ca3af;
	--ccu-cb-star: #f99f1b;
	--ccu-cb-border: #f3f4f6;
}

/* =========================================================
   GRID CONTAINER
   ========================================================= */
.ccu-card-builder-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Column Variants */
.ccu-cb-cols-1 { grid-template-columns: repeat(1, 1fr); }
.ccu-cb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ccu-cb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ccu-cb-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Alignment */
.ccu-cb-align-left   .ccu-card-builder-item { text-align: left; }
.ccu-cb-align-center .ccu-card-builder-item { text-align: center; }
.ccu-cb-align-center .ccu-cb-content { align-items: center; }
.ccu-cb-align-center .ccu-cb-footer { flex-direction: column; align-items: center; }
.ccu-cb-align-center .ccu-cb-price-wrapper { align-items: center; }
.ccu-cb-align-center .ccu-cb-price-old { text-align: center; }
.ccu-cb-align-center .ccu-cb-price-new { text-align: center; }

/* =========================================================
   CARD ITEM — exact match to user design
   ========================================================= */
.ccu-card-builder-item {
	background: #ffffff;
	max-width: 100%;
	width: 100%;
	border-radius: 12px;
	border: 1px solid var(--ccu-cb-border);
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
	position: relative;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.ccu-card-builder-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
}

.ccu-cb-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

/* Image wrapper — no overflow:hidden so badge can overflow freely. */
.ccu-cb-image-wrapper {
	position: relative;
	width: 100%;
	height: 220px;
	background-color: #e5e7eb;
	flex-shrink: 0;
}

/* Inner container clips only the image/placeholder for rounded corners + hover zoom. */
.ccu-cb-image-inner {
	width: 100%;
	height: 100%;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
}

.ccu-cb-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.ccu-card-builder-item:hover .ccu-cb-image {
	transform: scale(1.04);
}

.ccu-cb-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
	color: var(--ccu-cb-accent, var(--ccu-cb-primary));
	font-size: 52px;
}

.ccu-cb-image-placeholder svg {
	width: 52px;
	height: 52px;
	fill: currentColor;
}

/* =========================================================
   BADGE — positioned to overlap into content area
   ========================================================= */
.ccu-cb-badge {
	position: absolute;
	bottom: -16px;
	left: 50%;
	transform: translateX(-50%);
	background-color: var(--ccu-cb-accent, var(--ccu-cb-primary));
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	padding: 6px 18px;
	border-radius: 4px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	white-space: nowrap;
	z-index: 2;
	letter-spacing: 0.3px;
	line-height: 1.4;
}

/* =========================================================
   CONTENT AREA
   ========================================================= */
.ccu-cb-content {
	padding: 32px 24px 24px;
	display: flex;
	flex-direction: column;
	gap: 0;
	flex: 1;
	border-radius: 0 0 12px 12px;
}

/* =========================================================
   TITLE — 18px bold, dark
   ========================================================= */
.ccu-cb-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--ccu-cb-text-dark);
	line-height: 1.4;
	margin: 0 0 20px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   META — location & availability
   ========================================================= */
.ccu-cb-meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.ccu-cb-meta-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ccu-cb-meta-icon {
	font-size: 16px;
	color: var(--ccu-cb-accent, var(--ccu-cb-primary));
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}

.ccu-cb-meta-text {
	font-size: 15px;
	color: var(--ccu-cb-text-gray);
	font-weight: 500;
}

/* =========================================================
   DESCRIPTION
   ========================================================= */
.ccu-cb-description {
	font-size: 14px;
	color: var(--ccu-cb-text-gray);
	line-height: 1.6;
	margin: 0 0 20px;
	font-weight: 400;
}

/* =========================================================
   FOOTER — rating left, price right
   ========================================================= */
.ccu-cb-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0;
}

/* Rating */
.ccu-cb-rating-wrapper {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ccu-cb-stars {
	display: flex;
	gap: 3px;
	color: var(--ccu-cb-star);
	font-size: 14px;
	line-height: 1;
}

.ccu-cb-rating-text {
	font-size: 12px;
	color: var(--ccu-cb-text-light);
}

/* Price */
.ccu-cb-price-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0;
	line-height: 1.2;
	text-align: right;
}

.ccu-cb-price-old {
	font-size: 13px;
	font-weight: 600;
	color: var(--ccu-cb-text-light);
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
	text-align: right;
}

.ccu-cb-price-new {
	font-size: 16px;
	font-weight: 700;
	color: var(--ccu-cb-accent, var(--ccu-cb-primary));
	line-height: 1.1;
	text-align: right;
}

/* No-rating state: push price to left */
.ccu-cb-align-left .ccu-cb-footer:only-child {
	justify-content: flex-start;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media screen and (max-width: 1024px) {
	.ccu-cb-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
	.ccu-cb-cols-3,
	.ccu-cb-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 540px) {
	.ccu-card-builder-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 8px;
		min-width: 0;
	}

	.ccu-card-builder-item {
		min-width: 0;
		word-break: break-word;
	}

	.ccu-cb-image-wrapper {
		height: 110px;
	}

	.ccu-cb-image-inner {
		border-radius: 8px 8px 0 0;
	}

	.ccu-cb-image {
		width: 100%;
		min-width: 0;
	}

	.ccu-cb-content {
		padding: 16px 8px 10px;
	}

	.ccu-cb-title {
		font-size: 12px;
		margin-bottom: 8px;
	}

	.ccu-cb-meta {
		margin-bottom: 8px;
		gap: 4px;
	}

	.ccu-cb-meta-item {
		gap: 4px;
	}

	.ccu-cb-meta-icon {
		font-size: 10px;
		width: 12px;
	}

	.ccu-cb-meta-text {
		font-size: 10px;
	}

	.ccu-cb-footer {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.ccu-cb-stars {
		font-size: 10px;
		gap: 2px;
	}

	.ccu-cb-rating-text {
		font-size: 10px;
	}

	.ccu-cb-price-old {
		font-size: 10px;
	}

	.ccu-cb-price-new {
		font-size: 12px;
	}

	.ccu-cb-badge {
		font-size: 10px;
		padding: 3px 10px;
		bottom: -12px;
	}
}
