/**
 * BayarForm Public Styles
 *
 * @package    BayarForm
 * @subpackage BayarForm/public/css
 * @since      1.0.0
 */

/* Form Wrapper */
.bayarform-wrapper {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

.bayarform-wrapper * {
	box-sizing: border-box;
}

.bayarform-form {
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 30px;
}

/* Form Sections */
.bayarform-section {
	margin-bottom: 30px;
}

.bayarform-section h3 {
	font-size: 1.4em;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #f0f0f0;
	color: #333;
}

/* Form Fields */
.bayarform-fields {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.bayarform-field {
	display: flex;
	flex-direction: column;
}

.bayarform-field label {
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.bayarform-field .required-indicator {
	color: #dc3545;
	margin-left: 3px;
}

.bayarform-input {
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1em;
	transition: border-color 0.3s;
}

.bayarform-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

/* Product List */
.bayarform-product-list {
	display: grid;
	gap: 15px;
}

.bayarform-product-item {
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 15px;
	transition: all 0.3s;
	display: flex !important;
	flex-direction: row !important;
	justify-content: flex-start !important;
	align-items: flex-start !important;
	text-align: left !important;
	gap: 15px;
}

.bayarform-product-item:hover {
	border-color: #0073aa;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.bayarform-product-select {
	display: flex !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	flex: 1;
	gap: 10px;
	width: 100%;
}

.bayarform-product-select input[type="radio"],
.bayarform-product-select input[type="checkbox"] {
	margin: 0 !important;
	margin-top: 4px !important;
	flex-shrink: 0;
	align-self: flex-start;
}

.bayarform-product-select label {
	display: flex !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	flex-direction: row !important;
	gap: 15px;
	cursor: pointer;
	margin: 0 !important;
	flex: 1;
	min-width: 0;
	text-align: left !important;
	width: 100%;
}

.bayarform-product-image {
	flex-shrink: 0 !important;
	align-self: flex-start;
}

.bayarform-product-image img {
	width: 80px;
	height: 80px;
	max-width: 100%;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.bayarform-product-details {
	flex: 1;
	min-width: 0;
	text-align: left !important;
	align-self: flex-start;
}

.bayarform-product-name {
	font-size: 1.1em;
	margin: 0 0 5px 0 !important;
	color: #333;
	word-wrap: break-word;
	text-align: left !important;
}

.bayarform-product-price {
	color: #0073aa;
	font-weight: 600;
	text-align: left !important;
}

.bayarform-product-quantity {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bayarform-quantity-input {
	width: 60px;
	max-width: 100%;
	padding: 5px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
}

/* CAPTCHA */
.bayarform-recaptcha,
.bayarform-turnstile {
	margin: 20px 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Consent */
.bayarform-consent {
	padding: 15px;
	background: #f9f9f9;
	border-radius: 4px;
}

.bayarform-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
}

.bayarform-consent-label input[type="checkbox"] {
	margin-top: 3px;
}

/* Submit Button */
.bayarform-submit {
	text-align: center;
	margin-top: 30px;
}

.bayarform-submit-button {
	background: #0073aa;
	color: #ffffff;
	padding: 15px 40px;
	font-size: 1.1em;
	font-weight: 600;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
}

.bayarform-submit-button:hover {
	background: #005a87;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.bayarform-submit-button:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
}

/* Submit Button Layout for Multiple Buttons */
.bayarform-submit {
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

/* COD Button - Secondary Style */
.bayarform-cod-button {
	background: transparent;
	color: #0073aa;
	border: 2px solid #0073aa;
}

.bayarform-cod-button:hover {
	background: #0073aa;
	color: #ffffff;
	border-color: #0073aa;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.bayarform-cod-button:disabled {
	background: transparent;
	color: #ccc;
	border-color: #ccc;
	cursor: not-allowed;
	transform: none;
}

/* Messages */
.bayarform-messages {
	margin-top: 20px;
	padding: 15px;
	border-radius: 4px;
}

.bayarform-messages.error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.bayarform-messages.success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

/* Loading */
.bayarform-loading {
	text-align: center;
	padding: 20px;
}

.bayarform-loading .spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-right: 10px;
}

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

/* Error State */
.bayarform-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
	padding: 15px;
	border-radius: 4px;
	margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
	.bayarform-wrapper {
		padding: 15px;
	}

	.bayarform-form {
		padding: 20px 15px;
	}

	.bayarform-fields {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.bayarform-product-select {
		flex: 1 1 100%;
		justify-content: flex-start !important;
	}

	.bayarform-product-select label {
		gap: 12px;
		justify-content: flex-start !important;
		text-align: left !important;
	}

	.bayarform-product-item {
		flex-wrap: wrap;
		padding: 12px;
		justify-content: flex-start !important;
		align-items: flex-start !important;
	}

	.bayarform-product-quantity {
		flex: 1 1 100%;
		padding-left: 20px;
	}

	.bayarform-section h3 {
		font-size: 1.2em;
	}
}

@media (max-width: 480px) {
	.bayarform-wrapper {
		padding: 10px;
	}

	.bayarform-form {
		padding: 15px 10px;
		border-radius: 4px;
	}

	.bayarform-fields {
		gap: 12px;
	}

	.bayarform-section {
		margin-bottom: 20px;
	}

	.bayarform-section h3 {
		font-size: 1.1em;
		margin-bottom: 15px;
	}

	.bayarform-product-select {
		gap: 8px;
		flex: 1 1 100%;
		justify-content: flex-start !important;
	}

	.bayarform-product-select label {
		gap: 10px;
		justify-content: flex-start !important;
		text-align: left !important;
	}

	.bayarform-product-image img {
		width: 60px;
		height: 60px;
	}

	.bayarform-product-name {
		font-size: 1em;
		text-align: left !important;
	}

	.bayarform-product-price {
		font-size: 0.95em;
		text-align: left !important;
	}

	.bayarform-submit-button {
		width: 100%;
		padding: 12px 20px;
		font-size: 1em;
	}

	.bayarform-submit {
		flex-direction: column;
		gap: 10px;
	}

	.bayarform-product-item {
		padding: 10px;
		justify-content: flex-start !important;
		align-items: flex-start !important;
	}

	.bayarform-product-quantity {
		flex: 1 1 100%;
		padding-left: 18px;
	}

	.bayarform-input {
		font-size: 16px; /* Prevents zoom on iOS */
	}
}

@media (max-width: 360px) {
	.bayarform-wrapper {
		padding: 5px;
	}

	.bayarform-form {
		padding: 10px;
	}

	.bayarform-fields {
		gap: 10px;
	}

	.bayarform-product-select {
		gap: 6px;
		flex: 1 1 100%;
		justify-content: flex-start !important;
	}

	.bayarform-product-select label {
		gap: 8px;
		justify-content: flex-start !important;
		text-align: left !important;
	}

	.bayarform-product-image img {
		width: 50px;
		height: 50px;
	}

	.bayarform-product-name {
		font-size: 0.95em;
		text-align: left !important;
	}

	.bayarform-product-price {
		font-size: 0.9em;
		text-align: left !important;
	}

	.bayarform-product-item {
		padding: 8px;
		justify-content: flex-start !important;
		align-items: flex-start !important;
	}

	.bayarform-product-quantity {
		flex: 1 1 100%;
		padding-left: 16px;
	}
}
