/**
 * Rautamai Builder Pro - Master Frontend Production Stylesheet
 * Fully responsive across Desktop, Laptop, Tablet, and Mobile devices.
 * Supports Containers, Grid Rows, Columns, Buttons, Forms, WooCommerce & Animations.
 *
 * @package RautamaiBuilderPro
 * @version 1.0.0
 */

:root {
	--rb-primary: #0073aa;
	--rb-primary-hover: #005177;
	--rb-success: #10b981;
	--rb-danger: #ef4444;
	--rb-text: #0f172a;
	--rb-text-muted: #64748b;
	--rb-border: #e2e8f0;
	--rb-card-bg: #ffffff;
	--rb-radius: 8px;
	--rb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	--rb-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. GLOBAL & BASE LAYOUT STRUCTURE
   ========================================================================== */
.rautamai-container-element,
.rautamai-row-element,
.rautamai-column-element,
.rb-element-wrapper,
.rb-button-wrapper {
	max-width: 100%;
	box-sizing: border-box;
	position: relative;
}

.rautamai-container-element *,
.rautamai-row-element *,
.rautamai-column-element *,
.rb-element-wrapper *,
.rb-button-wrapper * {
	box-sizing: border-box;
}

/* Grid Layout Base */
.rb-row-grid {
	display: grid;
	width: 100%;
}

/* Layout Containers */
.rb-container-boxed {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.rb-container-full {
	width: 100%;
	max-width: 100%;
}

.rautamai-container-children,
.rautamai-row-children,
.rautamai-column-children {
	width: 100%;
}

/* ==========================================================================
   2. BUTTON ELEMENT ENGINE (Button.php Integration)
   ========================================================================== */
.rb-button-wrapper {
	display: flex;
	width: 100%;
}

.rb-align-left {
	justify-content: flex-start;
	text-align: left;
}

.rb-align-center {
	justify-content: center;
	text-align: center;
}

.rb-align-right {
	justify-content: flex-end;
	text-align: right;
}

.rb-align-justify {
	justify-content: stretch;
	text-align: center;
}

.rb-button-wrapper .rb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	line-height: 1.2;
	cursor: pointer;
	border: 1px solid transparent;
	outline: none;
	user-select: none;
	transition: var(--rb-transition);
	-webkit-font-smoothing: antialiased;
}

.rb-button-wrapper.rb-align-justify .rb-button {
	width: 100%;
}

.rb-button .dashicons,
.rb-button .rb-btn-icon {
	line-height: 1;
	font-size: 1.1em;
	width: auto;
	height: auto;
}

/* ==========================================================================
   3. RESPONSIVE VISIBILITY UTILITIES
   ========================================================================== */
@media (min-width: 1025px) {
	.rautamai-hide-desktop {
		display: none !important;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.rautamai-hide-tablet {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.rautamai-hide-mobile {
		display: none !important;
	}
}

/* ==========================================================================
   4. ENTRANCE ANIMATIONS ENGINE
   ========================================================================== */
.rautamai-anim-fade-in {
	animation: rbFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rautamai-anim-slide-up {
	animation: rbSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rautamai-anim-zoom-in {
	animation: rbZoomIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rautamai-anim-bounce {
	animation: rbBounce 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rbFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes rbSlideUp {
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes rbZoomIn {
	from { opacity: 0; transform: scale(0.92); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes rbBounce {
	0% { opacity: 0; transform: translateY(20px); }
	50% { transform: translateY(-8px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   5. DYNAMIC FORMS & NOTICES
   ========================================================================== */
.rautamai-form-element {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
}

.rautamai-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rautamai-form-field label {
	font-size: 14px;
	font-weight: 600;
	color: var(--rb-text);
}

.rautamai-form-field input,
.rautamai-form-field textarea,
.rautamai-form-field select {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	border: 1px solid var(--rb-border);
	border-radius: 6px;
	background: #ffffff;
	color: var(--rb-text);
	outline: none;
	transition: var(--rb-transition);
}

.rautamai-form-field input:focus,
.rautamai-form-field textarea:focus,
.rautamai-form-field select:focus {
	border-color: var(--rb-primary);
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.rautamai-form-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	background-color: var(--rb-primary);
	color: #ffffff;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--rb-transition);
	width: 100%;
}

.rautamai-form-submit-btn:hover {
	background-color: var(--rb-primary-hover);
}

.rautamai-notice {
	padding: 14px 18px;
	border-radius: var(--rb-radius);
	font-size: 14px;
	margin-bottom: 16px;
}

.rautamai-notice.success {
	background: #ecfdf5;
	border: 1px solid #10b981;
	color: #065f46;
}

.rautamai-notice.error {
	background: #fef2f2;
	border: 1px solid #f87171;
	color: #991b1b;
}

/* ==========================================================================
   6. WOOCOMMERCE PRODUCT GRID & GALLERY
   ========================================================================== */
.rautamai-product-grid {
	display: grid;
	grid-template-columns: repeat(var(--rb-grid-cols, 4), 1fr);
	gap: 24px;
	width: 100%;
}

.rb-product-card {
	background: var(--rb-card-bg);
	border: 1px solid var(--rb-border);
	border-radius: var(--rb-radius);
	overflow: hidden;
	box-shadow: var(--rb-shadow);
	display: flex;
	flex-direction: column;
	transition: var(--rb-transition);
}

.rb-product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.rb-product-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f8fafc;
}

.rb-product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.rb-product-card:hover .rb-product-thumb img {
	transform: scale(1.04);
}

.rb-product-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 10px;
}

.rb-product-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--rb-text);
	text-decoration: none;
	margin: 0;
	line-height: 1.4;
}

.rb-product-title:hover {
	color: var(--rb-primary);
}

.rb-product-price {
	font-size: 16px;
	font-weight: 700;
	color: var(--rb-text);
}

.rb-product-price ins {
	color: var(--rb-danger);
	text-decoration: none;
	margin-right: 8px;
}

.rb-product-price del {
	color: var(--rb-text-muted);
	font-size: 0.9em;
	font-weight: 400;
}

.rautamai-product-gallery {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.rb-gallery-main {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--rb-radius);
	overflow: hidden;
	border: 1px solid var(--rb-border);
	background: #f8fafc;
}

.rb-gallery-main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rb-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.rb-gallery-thumb-item {
	aspect-ratio: 1 / 1;
	border-radius: 4px;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: pointer;
	transition: var(--rb-transition);
}

.rb-gallery-thumb-item.active,
.rb-gallery-thumb-item:hover {
	border-color: var(--rb-primary);
}

.rb-gallery-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS (Tablet & Mobile Adjustments)
   ========================================================================== */
@media (max-width: 1200px) {
	.rb-row-grid {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
		gap: 20px !important;
	}
}

@media (max-width: 1024px) {
	.rb-container-boxed {
		max-width: 100% !important;
		padding-left: 20px;
		padding-right: 20px;
	}

	.rautamai-product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
	
	.rb-column-item {
		max-width: 100% !important;
		flex: 0 0 100% !important;
	}
}

@media (max-width: 768px) {
	/* Force multi-column grid rows into a single vertical stack on mobile devices */
	.rb-row-grid {
		grid-template-columns: 1fr !important;
		gap: 16px !important;
	}

	.rb-container-boxed,
	.rb-container-full {
		padding-left: 16px;
		padding-right: 16px;
	}

	.rautamai-container-element,
	.rautamai-row-element,
	.rautamai-column-element {
		padding-left: 12px !important;
		padding-right: 12px !important;
	}
}

@media (max-width: 640px) {
	.rautamai-product-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.rb-add-to-cart-wrap .cart {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.rb-add-to-cart-wrap .quantity input.qty,
	.rb-add-to-cart-wrap button.single_add_to_cart_button,
	.rb-add-to-cart-wrap .button.add_to_cart_button {
		width: 100%;
	}
}