/* Estilos para fontes dinâmicas */
:root {
    /* Cor de fundo padrão, será sobrescrita pelo JS */
    --page-background: #FFF; 
}

body {
    /* O background é controlado pelo JS (applyGlobalStyles) */
    background: var(--page-background);
    transition: background 0.3s, color 0.3s;
}

/* Container do site público que recebe os estilos de fonte */
#public-site-container {
    font-family: var(--page-font-family, 'Inter', sans-serif);
    font-size: var(--page-font-size, 16px);
    color: var(--page-font-color, #333);
}

.product-card {
    width: var(--product-card-width, 280px);
    background-color: var(--product-card-bg-color, #ffffff);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.product-description,
.page-description {
    white-space: pre-wrap;
}

#settings-panel {
    transition: transform 0.3s ease-in-out;
}

/* Garante que o painel e os modais tenham sempre a fonte padrão e cor escura */
#settings-panel,
#generic-modal,
#login-modal {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #333; /* Cor de texto escura padrão */
}

/* Esconde o input[type=file] original */
.custom-file-input input[type="file"] {
    display: none;
}


/* --- NOVAS REGRAS DE LAYOUT PARA O PAINEL ADMIN (Fallback do Tailwind) --- */

/* Contêiner para os itens nas abas Produtos, Social, Layout */
.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem; /* p-3 */
    background-color: #f9fafb; /* bg-gray-50 */
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    margin-bottom: 0.75rem; /* Adiciona espaço (como space-y-3 no pai) */
}
/* Lado esquerdo (imagem/ícone + texto) */
.admin-list-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* space-x-3 */
    overflow: hidden; /* Garante que o conteúdo não estoure */
    margin-right: 0.5rem; /* mr-2 */
}
.admin-list-item-content img {
    width: 3rem; /* w-12 */
    height: 3rem; /* h-12 */
    object-fit: cover;
    border-radius: 0.375rem; /* rounded-md */
    flex-shrink: 0; /* Impede que a imagem encolha */
    border: 1px solid #e5e7eb; /* border */
}
.admin-list-item-content i {
    font-size: 1.5rem; /* text-2xl */
    color: #374151; /* text-gray-700 */
    flex-shrink: 0; /* Impede que o ícone encolha */
    width: 2rem; /* Adiciona largura fixa para alinhamento */
    text-align: center;
}
.admin-list-item-content span {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #1f2937; /* text-gray-800 */
    white-space: nowrap; /* Impede quebra de linha */
    overflow: hidden; /* Esconde o excesso */
    text-overflow: ellipsis; /* Adiciona "..." */
}
/* Lado direito (botões) */
.admin-list-item-actions {
    flex-shrink: 0; /* Impede que os botões encolham */
    display: flex;
    gap: 0.25rem; /* space-x-1 */
}
.admin-list-item-actions button {
    background: none;
    border: none;
    padding: 0.25rem; /* p-1 */
    border-radius: 0.25rem; /* rounded */
    cursor: pointer;
}
/* Estilos dos botões do admin list (replicando Tailwind) */
.admin-list-item-actions .edit-product-btn,
.admin-list-item-actions .edit-social-btn {
    color: #2563eb; /* text-blue-600 */
}
.admin-list-item-actions .edit-product-btn:hover,
.admin-list-item-actions .edit-social-btn:hover {
    color: #1d4ed8; /* hover:text-blue-800 */
}
.admin-list-item-actions .remove-product-btn,
.admin-list-item-actions .remove-social-btn {
    color: #dc2626; /* text-red-600 */
}
.admin-list-item-actions .remove-product-btn:hover,
.admin-list-item-actions .remove-social-btn:hover {
    color: #991b1b; /* hover:text-red-800 */
}
.admin-list-item-actions .move-section-up-btn,
.admin-list-item-actions .move-section-down-btn {
    color: #4b5563; /* text-gray-500 */
}
.admin-list-item-actions .move-section-up-btn:hover,
.admin-list-item-actions .move-section-down-btn:hover {
    color: #2563eb; /* hover:text-blue-600 */
}
.admin-list-item-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* --- NOVAS REGRAS PARA O MODAL (Adicionar/Editar) --- */
/* Esta classe substitui o 'space-y-4' do HTML */
.modal-form-group {
    /* Adiciona espaço entre os grupos de formulário (label+input) */
    margin-bottom: 1rem;
}
.modal-form-group:last-child {
    margin-bottom: 0;
}
/* Garante que os inputs/textareas/selects ocupem a largura total e tenham estilo */
.modal-form-group input[type="text"],
.modal-form-group input[type="url"],
.modal-form-group textarea,
.modal-form-group select {
    margin-top: 0.25rem; /* mt-1 */
    display: block;
    width: 100%;
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid #d1d5db; /* border-gray-300 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    padding: 0.5rem 0.75rem; /* Adiciona padding padrão */
    font-size: 0.875rem; /* sm:text-sm */
    line-height: 1.25rem;
}
.modal-form-group input[type="text"]:focus,
.modal-form-group input[type="url"]:focus,
.modal-form-group textarea:focus,
.modal-form-group select:focus {
     border-color: #2563eb; /* focus:border-blue-500 */
     outline: 2px solid transparent;
     outline-offset: 2px;
     --tw-ring-color: #2563eb; /* focus:ring-blue-500 */
     box-shadow: 0 0 0 2px var(--tw-ring-color);
}
/* Ajuste específico para o preview da imagem */
.modal-image-preview-group {
    display: flex;
    align-items: flex-end; /* Alinha o botão de upload na base */
    gap: 1rem; /* space-x-4 */
    margin-top: 0.25rem; /* mt-1 */
}

/* NOVO: Estilo para a imagem de preview no modal de produto */
#modal-product-preview {
    max-height: 180px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    background-color: #f9fafb; /* bg-gray-50 */
}

