/* Variables */
:root {
	--primary-color: #2f3640;
	--secondary-color: #4CAF50;
	--accent-color: #ff4d4d;
	--background-color: #8e9a64;
	--text-light: #ffffff;
	--text-dark: #333333;
	--shadow-standard: 0px 4px 10px rgba(0, 0, 0, 0.3);
	--transition-standard: all 0.3s ease-in-out;
	--border-radius: 15px;
	--spacing-standard: 20px;
}

/* Reset and Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	font-family: 'Arial', sans-serif;
	background-image: url('../img/pães.jpg');
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-size: cover;
	overflow-x: hidden;
}

/* Prevenir scroll do body quando popup está aberto */
body.popup-open {
	overflow: hidden;
}

/* Header Styles */
.header {
	background-color: #FFD700;
	padding: 15px 40px;
	display: flex;
	align-items: center;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 1000;
	box-shadow: var(--shadow-standard);
	height: 80px;
}

.logo {
	width: auto;
	height: 45px;
	object-fit: contain;
}

.nav-section {
	display: flex;
	align-items: center;
	margin-left: 60px;
}

.nav-link {
	color: #333;
	text-decoration: none;
	font-family: Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-left: auto;
}

.cep-header-display {
	display: flex;
	align-items: center;
	gap: 10px;
	background-color: var(--text-light);
	padding: 8px 15px;
	border-radius: var(--border-radius);
	box-shadow: var(--shadow-standard);
}

.join-button {
	background-color: #E31837;
	color: white;
	padding: 10px 24px;
	border-radius: 5px;
	text-decoration: none;
	font-family: Arial, sans-serif;
	font-weight: bold;
	border: none;
	font-size: 16px;
}

.btn-second {
	background-color: #4CAF50;
}

/* Layout */
.container {
	display: flex;
	height: calc(100vh - 140px);
	justify-content: space-between;
	padding: var(--spacing-standard);
	gap: var(--spacing-standard);
	margin-top: 80px;
	margin-bottom: 60px;
}

/* Sidebar Containers */
.container2 {
	width: 380px;
	height: 100%;
	border-radius: var(--border-radius);
	overflow: hidden;
	box-shadow: var(--shadow-standard);
	display: flex;
	flex-direction: column;
	background-color: var(--text-light);
	transition: var(--transition-standard);
}

.container2:hover {
	transform: translateY(-5px);
	box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.4);
}

.container2 h2 {
	background-color: var(--accent-color);
	color: var(--text-light);
	padding: 15px;
	text-align: center;
	font-size: 22px;
	font-weight: bold;
	text-transform: uppercase;
}

.container2 .content {
	background-color: #f7f7f7;
	flex-grow: 1;
	padding: var(--spacing-standard);
	overflow-y: auto;
}

/* Table Styles */
table {
	width: 100%;
	border-collapse: collapse;
	border-radius: 10px;
	overflow: hidden;
	background-color: var(--text-light);
	box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

thead {
	background-color: var(--secondary-color);
	color: var(--text-light);
}

th,
td {
	padding: 12px;
	text-align: left;
}

tbody tr {
	transition: var(--transition-standard);
}

tbody tr:nth-child(even) {
	background-color: #f2f2f2;
}

tbody tr:hover {
	background-color: #d9f2d9;
	transform: scale(1.01);
}

/* Ajustes específicos para a tabela de fornecedores */
.container2 table {
	table-layout: fixed;
	width: 100%;
}

.container2 th:nth-child(1),
.container2 td:nth-child(1) {
	width: 60%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	white-space: normal;
	line-height: 1.2;
}

.container2 th:nth-child(2),
.container2 td:nth-child(2) {
	width: 20%;
	text-align: center;
}

.container2 th:nth-child(3),
.container2 td:nth-child(3) {
	width: 20%;
	text-align: center;
}

.container2 th,
.container2 td {
	padding: 8px 6px;
	font-size: 13px;
}

.container2 td:first-child {
	max-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.container2 tr:hover td:first-child {
	overflow: visible;
	white-space: normal;
	word-break: break-word;
}

/* Map Container */
.map-container {
	flex-grow: 1;
	border-radius: var(--border-radius);
	overflow: hidden;
	box-shadow: var(--shadow-standard);
	background-color: var(--text-light);
	transition: var(--transition-standard);
}

#map {
	width: 100%;
	height: 100%;
}

/* ===================== ESTILOS DE POPUP UNIFICADOS ===================== */

/* Popup Overlay - Estilo unificado para todos os popups */
.popup-overlay, .popup, .modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(46, 54, 64, 0.8));
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1100;
	backdrop-filter: blur(10px);
	animation: fadeIn 0.3s ease-out;
}

.popup-overlay.show, .popup.show, .modal.show {
	display: flex !important;
}

/* Popup Content - Estilo unificado */
.popup-content, .modal-content {
	background: linear-gradient(145deg, #ffffff, #f8f9fa);
	padding: 40px 32px 32px 32px;
	border-radius: 24px;
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.15),
		0 8px 20px rgba(0, 0, 0, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.8);
	width: 95%;
	max-width: 450px;
	max-height: 90vh;
	overflow-y: auto;
	text-align: center;
	position: relative;
	animation: slideInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Botões de fechar - Estilo unificado */
.close-button, .popup-close, .modal-close {
	position: absolute;
	top: 16px;
	right: 20px;
	font-size: 28px;
	color: #999;
	cursor: pointer;
	transition: all 0.3s ease;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.05);
	border: none;
	z-index: 10;
}

.close-button:hover, .popup-close:hover, .modal-close:hover {
	color: #e31837;
	background: rgba(227, 24, 55, 0.1);
	transform: rotate(90deg);
}

/* Títulos dos popups */
.popup-content h3, .modal-content h3 {
	margin-bottom: 24px;
	font-size: 1.8rem;
	color: var(--primary-color);
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.popup-content h3 img, .modal-content h3 img {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Campos de input nos popups */
.popup-content .mb-3, .modal-content .form-group {
	margin-bottom: 24px;
}

.popup-content input, .modal-content input {
	font-size: 1.2rem;
	padding: 16px 20px;
	border-radius: 16px;
	border: 2px solid #e9ecef;
	width: 100%;
	margin-bottom: 16px;
	background: #ffffff;
	transition: all 0.3s ease;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
	font-weight: 500;
	text-align: center;
	letter-spacing: 1px;
}

.popup-content input:focus, .modal-content input:focus {
	outline: none;
	border-color: #FFD700;
	box-shadow:
		inset 0 2px 4px rgba(0, 0, 0, 0.06),
		0 0 0 4px rgba(255, 215, 0, 0.2);
	transform: translateY(-1px);
}

.popup-content input::placeholder, .modal-content input::placeholder {
	color: #adb5bd;
	font-weight: 400;
}

/* Botões nos popups */
.popup-content .btn, .modal-content .btn {
	margin: 8px 6px;
	min-width: 140px;
	font-size: 1rem;
	font-weight: 600;
	padding: 14px 24px;
	border-radius: 12px;
	border: none;
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	position: relative;
	overflow: hidden;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
}

.popup-content .btn::before, .modal-content .btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s;
}

.popup-content .btn:hover::before, .modal-content .btn:hover::before {
	left: 100%;
}

.popup-content .btn-primary, .modal-content .btn-primary {
	background: linear-gradient(135deg, #007bff, #0056b3);
	color: #fff;
	box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.popup-content .btn-primary:hover, .modal-content .btn-primary:hover {
	background: linear-gradient(135deg, #0056b3, #004085);
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.popup-content .btn-second, .modal-content .btn-success {
	background: linear-gradient(135deg, #4CAF50, #388e3c);
	color: #fff;
	box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.popup-content .btn-second:hover, .modal-content .btn-success:hover {
	background: linear-gradient(135deg, #388e3c, #2e7d32);
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.popup-content .btn-info, .modal-content .btn-info {
	background: linear-gradient(135deg, #17a2b8, #138496);
	color: #fff;
	box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.popup-content .btn-info:hover, .modal-content .btn-info:hover {
	background: linear-gradient(135deg, #138496, #0f6674);
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.popup-content .btn-secondary, .modal-content .btn-secondary {
	background: linear-gradient(135deg, #6c757d, #545b62);
	color: #fff;
	box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.popup-content .btn-secondary:hover, .modal-content .btn-secondary:hover {
	background: linear-gradient(135deg, #545b62, #383d41);
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* Mensagens de status nos popups */
.popup-content .status-message, .modal-content .status-message {
	margin-top: 16px;
	font-size: 1rem;
	color: #e31837;
	min-height: 24px;
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 8px;
}

/* ===================== ESTILOS PARA PRODUTOS ===================== */

.produto-imagem {
	width: 80px;
	text-align: center;
	vertical-align: middle;
	padding: 8px;
}

.produto-img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 8px;
	border: 2px solid #e9ecef;
	transition: all 0.3s ease;
	background-color: #f8f9fa;
}

.produto-img:hover {
	transform: scale(1.1);
	border-color: var(--secondary-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.produto-nome {
	font-weight: 600;
	color: var(--primary-color);
	vertical-align: middle;
	max-width: 200px;
	word-wrap: break-word;
}

.produto-descricao {
	color: #666;
	font-size: 13px;
	vertical-align: middle;
	line-height: 1.3;
	max-width: 250px;
	word-wrap: break-word;
}

.container2:last-child table {
	table-layout: fixed;
}

.container2:last-child th:nth-child(1),
.container2:last-child td:nth-child(1) {
	width: 25%;
}

.container2:last-child th:nth-child(2),
.container2:last-child td:nth-child(2) {
	width: 35%;
}

.container2:last-child th:nth-child(3),
.container2:last-child td:nth-child(3) {
	width: 40%;
}

/* ===================== ESTILOS PARA BOTÕES DAS TABELAS ===================== */

.btn-sm {
	padding: 6px 12px;
	font-size: 12px;
	border-radius: 8px;
	transition: all 0.3s ease;
	border: none;
	font-weight: 600;
	text-decoration: none;
	display: inline-block;
	margin: 2px;
	min-width: auto;
	cursor: pointer;
}

.btn-success {
	background: linear-gradient(135deg, #28a745, #20c997);
	color: white;
	box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
	background: linear-gradient(135deg, #218838, #1ea085);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
	color: white;
	text-decoration: none;
}

.btn-primary {
	background: linear-gradient(135deg, #007bff, #0056b3);
	color: white;
	box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
	background: linear-gradient(135deg, #0056b3, #004085);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
	color: white;
	text-decoration: none;
}

.btn-warning {
	background: linear-gradient(135deg, #ffc107, #e0a800);
	color: #212529;
	box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
	background: linear-gradient(135deg, #e0a800, #d39e00);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
	color: #212529;
	text-decoration: none;
}

/* ===================== LOADING STYLES ===================== */

.loading {
	display: none;
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.9);
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.spinner {
	width: 50px;
	height: 50px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #007bff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 20px;
}

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

/* ===================== FOOTER ===================== */

.footer {
	background-color: #FFD700;
	padding: 1rem 2rem;
	position: fixed;
	bottom: 0;
	width: 100%;
	z-index: 1000;
	box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.footer-content {
	display: flex;
	gap: 2rem;
}

.footer-links a {
	color: #333;
	text-decoration: none;
	transition: var(--transition-standard);
	margin-right: 20px;
}

.footer-links a:hover {
	color: #E31837;
}

.footer-copyright {
	color: #333;
}

#linkLoja a:hover {
	color: #E31837;
}

#linkLoja a {
	color: #333;
	text-decoration: none;
	transition: var(--transition-standard);
	margin-right: 20px;
}

/* ===================== ANIMAÇÕES ===================== */

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

@keyframes slideInScale {
	from {
		transform: translateY(-30px) scale(0.9);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

@keyframes slideIn {
	from {
		transform: translateY(-20px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes slideInRight {
	from {
		transform: translateX(100px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* ===================== RESPONSIVIDADE ===================== */

@media (max-width: 1200px) {
	.container {
		flex-direction: column;
		height: auto;
		padding: 10px;
		gap: 10px;
	}

	.container2 {
		width: 100%;
		height: 300px;
		margin-bottom: 10px;
	}

	.map-container {
		height: 400px;
		order: -1;
	}

	.popup-content, .modal-content {
		margin: 10px;
		max-width: calc(100% - 20px);
		padding: 30px 20px 20px 20px;
	}
}

@media (max-width: 768px) {
	.header {
		padding: 10px 20px;
		flex-wrap: wrap;
		height: auto;
		min-height: 80px;
	}

	.nav-section {
		margin-left: 20px;
	}

	.header-right {
		gap: 10px;
		margin-left: auto;
	}

	.container {
		margin-top: 100px;
		padding: 10px;
		gap: 10px;
	}

	.container2 {
		height: 250px;
	}

	.map-container {
		height: 300px;
	}

	.popup-content, .modal-content {
		margin: 5px;
		max-width: calc(100% - 10px);
		border-radius: 16px;
		padding: 25px 15px 15px 15px;
	}

	.popup-content h3, .modal-content h3 {
		font-size: 1.4rem;
	}

	.popup-content input, .modal-content input {
		font-size: 16px;
		padding: 12px 16px;
	}

	.popup-content .btn, .modal-content .btn {
		min-width: 120px;
		padding: 12px 20px;
		font-size: 0.9rem;
	}
}

@media (max-width: 480px) {
	.header {
		flex-direction: column;
		text-align: center;
		padding: 15px;
	}

	.nav-section {
		margin-left: 0;
		margin-top: 10px;
	}

	.header-right {
		margin-left: 0;
		margin-top: 10px;
		justify-content: center;
	}

	.container {
		margin-top: 120px;
	}

	.popup-content .btn, .modal-content .btn {
		min-width: 100px;
		margin: 5px 3px;
	}
}