/**
 * Ruiz Local Orders - Frontend Styles
 *
 * Styles for school lunch, specials, and meat pack order forms.
 * Mobile-first responsive design.
 */

/* ===========================
   Container & Layout
   =========================== */

.ruiz-order-form-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
}

/* ===========================
   Typography & Content
   =========================== */

.ruiz-intro {
	background: #f8f9fa;
	border-left: 4px solid #5cb85c;
	padding: 20px;
	margin-bottom: 30px;
	border-radius: 4px;
}

.ruiz-intro h3 {
	margin-top: 0;
	color: #333;
	font-size: 1.4em;
}

.ruiz-intro .bilingual {
	line-height: 1.8;
	color: #555;
}

.ruiz-intro .bilingual strong {
	color: #d9534f;
}

/* Important notices */
.important-notice {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	padding: 15px 20px;
	margin-bottom: 25px;
}

.important-notice ul {
	margin: 0;
	padding-left: 20px;
}

.important-notice li {
	margin-bottom: 8px;
	color: #856404;
}

/* ===========================
   Menu & Products Display
   =========================== */

.ruiz-menu,
.ruiz-specials-grid,
.ruiz-packages-grid {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 30px;
}

.ruiz-menu h3,
.ruiz-specials-grid h3,
.ruiz-packages-grid h3 {
	margin-top: 0;
	color: #333;
	border-bottom: 2px solid #5cb85c;
	padding-bottom: 10px;
}

.ruiz-menu ul {
	list-style: none;
	padding: 0;
	margin: 15px 0;
}

.ruiz-menu li {
	padding: 10px 0;
	border-bottom: 1px solid #eee;
	font-size: 1.05em;
}

.ruiz-menu li:last-child {
	border-bottom: none;
}

.ruiz-menu li::before {
	content: "🍽️ ";
	margin-right: 8px;
}

/* Specials & Packages Grid */
.ruiz-specials-grid,
.ruiz-packages-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
}

.special-item,
.package-item {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 15px;
	transition: transform 0.2s, box-shadow 0.2s;
}

.special-item:hover,
.package-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.special-item h4,
.package-item h4 {
	margin-top: 0;
	color: #5cb85c;
	font-size: 1.2em;
}

.special-item p,
.package-item p {
	margin: 10px 0;
	color: #666;
	line-height: 1.6;
}

.special-price,
.package-price {
	font-size: 1.3em;
	font-weight: bold;
	color: #d9534f;
	display: block;
	margin-top: 10px;
}

/* ===========================
   Form Styling
   =========================== */

.ruiz-order-form {
	background: #fff;
	border: 2px solid #5cb85c;
	border-radius: 8px;
	padding: 30px;
	margin-bottom: 30px;
}

.ruiz-order-form h3 {
	margin-top: 0;
	color: #5cb85c;
	text-align: center;
	font-size: 1.6em;
	margin-bottom: 25px;
}

.form-row {
	margin-bottom: 20px;
}

.form-row label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.form-row label .required {
	color: #d9534f;
	margin-left: 3px;
}

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1em;
	transition: border-color 0.3s;
	box-sizing: border-box;
}

.form-row input[type="text"]:focus,
.form-row input[type="tel"]:focus,
.form-row input[type="email"]:focus,
.form-row select:focus,
.form-row textarea:focus {
	border-color: #5cb85c;
	outline: none;
	box-shadow: 0 0 5px rgba(92, 184, 92, 0.3);
}

.form-row textarea {
	min-height: 100px;
	resize: vertical;
}

.form-row small {
	display: block;
	margin-top: 5px;
	color: #777;
	font-size: 0.9em;
}

/* Radio buttons & Checkboxes */
.form-row .radio-group,
.form-row .checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.form-row .radio-option,
.form-row .checkbox-option {
	display: flex;
	align-items: center;
	padding: 10px;
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.form-row .radio-option:hover,
.form-row .checkbox-option:hover {
	background-color: #e9ecef;
}

.form-row .radio-option input[type="radio"],
.form-row .checkbox-option input[type="checkbox"] {
	margin-right: 10px;
	width: auto;
	cursor: pointer;
}

.form-row .radio-option label,
.form-row .checkbox-option label {
	margin: 0;
	font-weight: normal;
	cursor: pointer;
	flex: 1;
}

/* Submit button */
.form-row .submit-button {
	background-color: #5cb85c;
	color: #fff;
	border: none;
	padding: 15px 40px;
	font-size: 1.1em;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.3s;
	width: 100%;
	max-width: 300px;
	margin: 10px auto;
	display: block;
}

.form-row .submit-button:hover {
	background-color: #4cae4c;
}

.form-row .submit-button:active {
	background-color: #449d44;
}

.form-row .submit-button:disabled {
	background-color: #ccc;
	cursor: not-allowed;
}

/* ===========================
   Action Buttons
   =========================== */

.ruiz-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin: 20px 0;
	justify-content: center;
}

.ruiz-button,
.whatsapp-button,
.phone-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 25px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 1em;
	transition: transform 0.2s, box-shadow 0.2s;
}

.ruiz-button:hover,
.whatsapp-button:hover,
.phone-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.2);
	text-decoration: none;
}

.whatsapp-button {
	background-color: #25D366;
	color: #fff;
}

.whatsapp-button:hover {
	background-color: #1ebe57;
	color: #fff;
}

.phone-button {
	background-color: #5bc0de;
	color: #fff;
}

.phone-button:hover {
	background-color: #46b8da;
	color: #fff;
}

/* ===========================
   Success & Error Messages
   =========================== */

.ruiz-success-message {
	background-color: #d4edda;
	border: 2px solid #28a745;
	border-radius: 6px;
	padding: 25px;
	margin: 30px 0;
	text-align: center;
}

.ruiz-success-message h3 {
	color: #155724;
	margin-top: 0;
	font-size: 1.8em;
}

.ruiz-success-message .bilingual {
	font-size: 1.1em;
	line-height: 1.8;
	color: #155724;
}

.ruiz-success-message .order-number {
	background: #fff;
	border: 1px dashed #28a745;
	border-radius: 4px;
	padding: 15px;
	margin: 20px 0;
	font-size: 1.3em;
	font-weight: 600;
	color: #28a745;
}

.ruiz-error-message {
	background-color: #f8d7da;
	border: 2px solid #dc3545;
	border-radius: 6px;
	padding: 20px;
	margin: 20px 0;
	color: #721c24;
}

.ruiz-error-message strong {
	display: block;
	margin-bottom: 10px;
	font-size: 1.1em;
}

/* ===========================
   Validation States
   =========================== */

.form-row.error input,
.form-row.error select,
.form-row.error textarea {
	border-color: #d9534f;
}

.form-row .error-message {
	color: #d9534f;
	font-size: 0.9em;
	margin-top: 5px;
	display: none;
}

.form-row.error .error-message {
	display: block;
}

/* ===========================
   Loading State
   =========================== */

.ruiz-order-form.loading {
	opacity: 0.6;
	pointer-events: none;
}

.ruiz-order-form.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #5cb85c;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

@media (max-width: 768px) {
	.ruiz-order-form-container {
		padding: 15px;
	}

	.ruiz-order-form {
		padding: 20px 15px;
	}

	.ruiz-intro,
	.important-notice {
		padding: 15px;
	}

	.ruiz-specials-grid,
	.ruiz-packages-grid {
		grid-template-columns: 1fr;
	}

	.ruiz-actions {
		flex-direction: column;
	}

	.ruiz-button,
	.whatsapp-button,
	.phone-button {
		width: 100%;
	}

	.form-row .submit-button {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.ruiz-order-form h3 {
		font-size: 1.3em;
	}

	.ruiz-intro h3 {
		font-size: 1.2em;
	}

	.special-item h4,
	.package-item h4 {
		font-size: 1.1em;
	}
}

/* ===========================
   Accessibility
   =========================== */

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 2px solid #5cb85c;
	outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
	position: absolute;
	top: -40px;
	left: 0;
	background: #5cb85c;
	color: #fff;
	padding: 8px 15px;
	text-decoration: none;
	z-index: 100;
}

.skip-to-content:focus {
	top: 0;
}

/* ===========================
   Email Subscription Form
   =========================== */

.ruiz-subscribe-form {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px solid #5cb85c;
	border-radius: 12px;
	padding: 30px;
	margin: 30px 0;
	max-width: 600px;
}

.ruiz-subscribe-form.ruiz-subscribe-compact {
	padding: 20px;
	max-width: 400px;
}

.ruiz-subscribe-header {
	text-align: center;
	margin-bottom: 25px;
}

.ruiz-subscribe-header h3 {
	margin: 0 0 10px;
	color: #333;
	font-size: 1.6em;
}

.ruiz-subscribe-header p {
	margin: 0;
	color: #666;
	line-height: 1.6;
}

.ruiz-form-row {
	margin-bottom: 20px;
}

.ruiz-form-row label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.ruiz-form-row label .required {
	color: #d9534f;
}

.ruiz-form-row input[type="email"],
.ruiz-form-row input[type="text"],
.ruiz-form-row input[type="tel"] {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 1em;
	transition: border-color 0.3s, box-shadow 0.3s;
	box-sizing: border-box;
}

.ruiz-form-row input:focus {
	border-color: #5cb85c;
	outline: none;
	box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.2);
}

.ruiz-form-row-inline {
	display: flex;
	gap: 15px;
}

.ruiz-form-half {
	flex: 1;
}

.ruiz-subscription-options {
	margin-top: 20px;
}

.ruiz-options-label {
	display: block;
	font-weight: 600;
	margin-bottom: 12px;
	color: #333;
}

.ruiz-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ruiz-checkbox-label {
	display: flex;
	align-items: flex-start;
	padding: 12px 15px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ruiz-checkbox-label:hover {
	border-color: #5cb85c;
	background: #f8fff8;
}

.ruiz-checkbox-label input[type="checkbox"] {
	margin-right: 12px;
	margin-top: 3px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #5cb85c;
}

.ruiz-checkbox-label input[type="checkbox"]:checked + .ruiz-checkbox-text strong {
	color: #5cb85c;
}

.ruiz-checkbox-text {
	flex: 1;
}

.ruiz-checkbox-text strong {
	display: block;
	color: #333;
	font-size: 1em;
	margin-bottom: 2px;
}

.ruiz-checkbox-text small {
	color: #777;
	font-size: 0.85em;
}

.ruiz-form-submit {
	margin-top: 25px;
	text-align: center;
}

.ruiz-subscribe-btn {
	background: linear-gradient(135deg, #5cb85c 0%, #4cae4c 100%);
	color: #fff;
	border: none;
	padding: 14px 30px;
	font-size: 1.1em;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 6px rgba(92, 184, 92, 0.3);
	width: 100%;
	max-width: 300px;
}

.ruiz-subscribe-btn:hover {
	background: linear-gradient(135deg, #4cae4c 0%, #449d44 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 12px rgba(92, 184, 92, 0.4);
}

.ruiz-subscribe-btn:active {
	transform: translateY(0);
}

.ruiz-subscribe-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.ruiz-subscribe-btn .btn-loading {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ruiz-subscribe-btn .btn-loading::after {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.ruiz-subscribe-result {
	margin-top: 20px;
	padding: 15px 20px;
	border-radius: 8px;
	text-align: center;
	font-weight: 500;
}

.ruiz-subscribe-result.success {
	background: #d4edda;
	border: 1px solid #28a745;
	color: #155724;
}

.ruiz-subscribe-result.error {
	background: #f8d7da;
	border: 1px solid #dc3545;
	color: #721c24;
}

.ruiz-privacy-note {
	text-align: center;
	margin-top: 15px;
	color: #999;
}

.ruiz-privacy-note small {
	font-size: 0.8em;
	line-height: 1.5;
}

/* Subscription Status Messages */
.ruiz-subscription-message {
	padding: 15px 20px;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: center;
	font-weight: 500;
}

.ruiz-subscription-success {
	background: #d4edda;
	border: 2px solid #28a745;
	color: #155724;
}

.ruiz-subscription-info {
	background: #d1ecf1;
	border: 2px solid #17a2b8;
	color: #0c5460;
}

.ruiz-subscription-error {
	background: #f8d7da;
	border: 2px solid #dc3545;
	color: #721c24;
}

/* Compact Form Adjustments */
.ruiz-subscribe-compact .ruiz-form-row {
	margin-bottom: 15px;
}

.ruiz-subscribe-compact .ruiz-checkbox-label {
	padding: 10px 12px;
}

.ruiz-subscribe-compact .ruiz-subscribe-btn {
	padding: 12px 25px;
	font-size: 1em;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
	.ruiz-subscribe-form {
		padding: 20px 15px;
		margin: 20px 10px;
	}

	.ruiz-form-row-inline {
		flex-direction: column;
		gap: 0;
	}

	.ruiz-form-half {
		margin-bottom: 15px;
	}

	.ruiz-subscribe-header h3 {
		font-size: 1.3em;
	}

	.ruiz-checkbox-label {
		padding: 10px;
	}

	.ruiz-subscribe-btn {
		max-width: 100%;
	}
}
