/* ==========================================================================
   ro-products.css  v2.0
   [ro_products] shortcode — redesigned card system
   Inspired by Kent & Aquaguard product card patterns
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   Custom properties
   -------------------------------------------------------------------------- */

:root {
	--ro-indigo:        #4f46e5;
	--ro-indigo-dark:   #4338ca;
	--ro-navy:          #0f172a;
	--ro-cyan:          #06b6d4;

	--ro-text-primary:  #1a1a2e;
	--ro-text-secondary:#64748b;
	--ro-text-muted:    #94a3b8;

	--ro-border:        #e8eaf0;
	--ro-surface:       #ffffff;
	--ro-bg-image:      #f4f6fb;

	--ro-green:         #16a34a;
	--ro-green-bg:      #dcfce7;
	--ro-green-text:    #15803d;

	--ro-badge-new-bg:      #059669;
	--ro-badge-new-text:    #ffffff;
	--ro-badge-feat-bg:     #f59e0b;
	--ro-badge-feat-text:   #ffffff;
	--ro-badge-best-bg:     #1e3a5f;
	--ro-badge-best-text:   #ffffff;

	--ro-radius-card:   12px;
	--ro-radius-pill:   999px;
	--ro-radius-btn:    8px;

	--ro-shadow:        0 2px 8px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
	--ro-shadow-hover:  0 8px 24px rgba(79,70,229,.12), 0 2px 6px rgba(0,0,0,.06);

	--ro-font:          'Inter', system-ui, -apple-system, sans-serif;
	--ro-ease:          220ms ease;
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */

.ro-products-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(4, 1fr);
}

.ro-grid--cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.ro-grid--cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.ro-grid--cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.ro-grid--cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.ro-grid--cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.ro-grid--cols-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }

/* --------------------------------------------------------------------------
   Card shell
   -------------------------------------------------------------------------- */

.ro-product-card {
	display: flex;
	flex-direction: column;
	background: var(--ro-surface);
	border: 1px solid var(--ro-border);
	border-radius: var(--ro-radius-card);
	box-shadow: var(--ro-shadow);
	overflow: hidden;
	transition: box-shadow var(--ro-ease), transform var(--ro-ease);
	height: 100%;
	font-family: var(--ro-font);
}

.ro-product-card:hover {
	box-shadow: var(--ro-shadow-hover);
	transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   Image area
   -------------------------------------------------------------------------- */

.ro-card__image-link {
	display: block;
	text-decoration: none;
}

.ro-card__image-wrap {
	position: relative;
	background: var(--ro-bg-image);
	/* Fixed height so all cards look uniform */
	height: 200px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ro-card__image {
	display: block;
	width: 60%;
	height: 100%;
	object-fit: contain;
	padding: 16px;
	transition: transform var(--ro-ease);
}

.ro-card__image-link:hover .ro-card__image {
	transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Badges — top-left stack
   -------------------------------------------------------------------------- */

.ro-card__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	z-index: 2;
}

.ro-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-family: var(--ro-font);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1.4;
	white-space: nowrap;
}

.ro-badge--new {
	background: var(--ro-badge-new-bg);
	color: var(--ro-badge-new-text);
}

.ro-badge--featured {
	background: var(--ro-badge-feat-bg);
	color: var(--ro-badge-feat-text);
}

.ro-badge--bestseller {
	background: var(--ro-badge-best-bg);
	color: var(--ro-badge-best-text);
}

/* --------------------------------------------------------------------------
   Card body
   -------------------------------------------------------------------------- */

.ro-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px 16px 18px;
	gap: 0;
}

/* --------------------------------------------------------------------------
   Title
   -------------------------------------------------------------------------- */

.ro-card__title {
	font-family: var(--ro-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--ro-text-primary);
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 40px; /* reserve 2 lines */
}

.ro-card__title a {
	color: inherit;
	text-decoration: none;
}

.ro-card__title a:hover {
	color: var(--ro-indigo);
}

/* --------------------------------------------------------------------------
   Attribute pills  — Aquaguard-style soft coloured tags
   -------------------------------------------------------------------------- */

.ro-card__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 12px;
	min-height: 24px;
}

.ro-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 4px;
	font-family: var(--ro-font);
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	line-height: 1.5;
	/* Soft indigo tint — matches Aquaguard blue pill style */
	background: #eff0fe;
	color: #3730a3;
	border: 1px solid #c7d2fe;
	transition: background var(--ro-ease), color var(--ro-ease);
}

.ro-pill:nth-child(2) {
	background: #fef9ec;
	color: #92400e;
	border-color: #fde68a;
}

.ro-pill:nth-child(3) {
	background: #ecfdf5;
	color: #065f46;
	border-color: #a7f3d0;
}

.ro-pill:nth-child(4) {
	background: #fdf2f8;
	color: #831843;
	border-color: #fbcfe8;
}

.ro-pill:nth-child(5) {
	background: #f0fdf4;
	color: #14532d;
	border-color: #bbf7d0;
}

/* --------------------------------------------------------------------------
   Price block — Kent-inspired layout
   -------------------------------------------------------------------------- */

.ro-card__price {
	margin-top: auto;
	margin-bottom: 12px;
}

/* Row 1: current price + % OFF pill */
.ro-price__current-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 3px;
}

.ro-price__current {
	font-family: var(--ro-font);
	font-size: 20px;
	font-weight: 700;
	color: var(--ro-text-primary);
	line-height: 1.15;
}

.ro-price__current .woocommerce-Price-amount,
.ro-price__current .amount {
	font-size: 20px;
	font-weight: 700;
	color: var(--ro-text-primary);
}

/* % OFF green pill */
.ro-price__off {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--ro-green-bg);
	color: var(--ro-green-text);
	font-family: var(--ro-font);
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
	line-height: 1.5;
}

/* Row 2: MRP strikethrough — subtle, Kent-style */
.ro-price__mrp-row {
	display: flex;
	align-items: center;
	gap: 2px;
	line-height: 1.3;
}

.ro-price__mrp-label {
	font-family: var(--ro-font);
	font-size: 12px;
	font-weight: 500;
	color: var(--ro-text-muted);
	letter-spacing: .02em;
}

.ro-price__mrp {
	font-family: var(--ro-font);
	font-size: 12px;
	font-weight: 400;
	color: var(--ro-text-muted);
	text-decoration: line-through;
	text-decoration-color: var(--ro-text-muted);
	text-decoration-thickness: 1px;
}

/* ensure WC inner spans inherit strikethrough */
.ro-price__mrp .woocommerce-Price-amount,
.ro-price__mrp .amount {
	font-size: 12px;
	color: var(--ro-text-muted);
}

/* Variable product range */
.ro-card__price--variable .ro-price__current {
	font-size: 16px;
}

/* --------------------------------------------------------------------------
   Add to cart button
   -------------------------------------------------------------------------- */
.ro-btn--buynow {
    background: var(--ro-indigo);
    color: #fff;
}

.ro-btn--buynow:hover {
    background: var(--ro-indigo-dark);
	color:#fff;
    transform: translateY(-1px);
}


.ro-card__actions {
	margin-top: 0;
}

.ro-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 10px 16px;
	border-radius: var(--ro-radius-btn);
	border: none;
	cursor: pointer;
	font-family: var(--ro-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background var(--ro-ease), opacity var(--ro-ease), transform var(--ro-ease);
	white-space: nowrap;
}

/* Cart icon — using a simple SVG inline via pseudo */
/* .ro-btn--cart::before {
	content: '';
	display: inline-block;
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	flex-shrink: 0;
} */

.ro-btn--cart {
	background: #1C2E77;
	color: #fff;
}

.ro-btn--cart:hover:not(:disabled) {
	background: var(--ro-indigo-dark);
	transform: translateY(-1px);
}

.ro-btn--cart:active:not(:disabled) {
	transform: translateY(0);
}

/* Select Options (variable) */
.ro-btn--options {
	background: transparent;
	color: var(--ro-indigo);
	border: 1.5px solid var(--ro-indigo);
}

.ro-btn--options:hover {
	background: var(--ro-indigo);
	color: #fff;
}

/* External */
.ro-btn--external {
	background: var(--ro-cyan);
	color: #fff;
}

.ro-btn--external:hover {
	background: #0891b2;
}

/* Out of stock */
.ro-btn--outofstock {
	background: #f1f5f9;
	color: var(--ro-text-muted);
	border: 1px solid var(--ro-border);
	cursor: not-allowed;
	opacity: .8;
}

/* AJAX states */
.ro-btn--cart.is-adding {
	opacity: .7;
	pointer-events: none;
}

.ro-btn--cart.is-adding::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3C/svg%3E");
	animation: ro-spin 1s linear infinite;
}

.ro-btn--cart.is-added {
	background: var(--ro-green);
}
/* 
.ro-btn--cart.is-added::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
} */

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

/* --------------------------------------------------------------------------
   View cart link — below button after add
   -------------------------------------------------------------------------- */

.ro-view-cart {
	display: block;
	margin-top: 7px;
	text-align: center;
	font-family: var(--ro-font);
	font-size: 12px;
	font-weight: 500;
	color: var(--ro-indigo);
	text-decoration: none;
}

.ro-view-cart:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.ro-products-empty {
	text-align: center;
	color: var(--ro-text-secondary);
	font-family: var(--ro-font);
	font-size: 15px;
	padding: 48px 20px;
	grid-column: 1 / -1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199px) {
	.ro-grid--cols-4,
	.ro-grid--cols-5,
	.ro-grid--cols-6 {
		grid-template-columns: repeat(3, minmax(0,1fr));
	}
}

@media (max-width: 899px) {
	.ro-products-grid,
	.ro-grid--cols-3,
	.ro-grid--cols-4,
	.ro-grid--cols-5,
	.ro-grid--cols-6 {
		grid-template-columns: repeat(2, minmax(0,1fr));
	}
	.ro-grid--cols-1 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 639px) {
	.ro-products-grid {
		grid-template-columns: repeat(2, minmax(0,1fr));
		gap: 12px;
	}

	.ro-card__image-wrap {
		height: 160px;
	}

	.ro-card__body {
		padding: 12px 12px 14px;
	}

	.ro-card__title {
		font-size: 13px;
		min-height: 38px;
		margin-bottom: 8px;
	}

	.ro-price__current,
	.ro-price__current .woocommerce-Price-amount,
	.ro-price__current .amount {
		font-size: 16px;
	}

	.ro-pill {
		font-size: 10px;
		padding: 2px 7px;
	}

	.ro-btn {
		font-size: 12px;
		padding: 9px 12px;
	}
}

@media (max-width: 399px) {
	.ro-products-grid {
		grid-template-columns: 1fr;
	}
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.ro-product-card,
	.ro-card__image,
	.ro-btn,
	.ro-pill {
		transition: none;
	}
	.ro-product-card:hover {
		transform: none;
	}
	.ro-card__image-link:hover .ro-card__image {
		transform: none;
	}
	.ro-btn--cart.is-adding::before {
		animation: none;
	}
}