
/* Visual: Fundo branco, detalhes em azul, profissional e responsivo */
:root {
  --bg-light: #f4f7fa;
  --panel-bg: #ffffff;
  --primary-blue: #3498db;
  --dark-blue: #2c3e50;
  --text-color: #34495e;
  --muted-text: #7f8c8d;
  --border-color: #e6e9ed;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --green-price: #27ae60;
}

/* --- GERAL --- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg-light);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
a { color: var(--primary-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- CABEÇALHO E RODAPÉ --- */
.site-header {
  background: var(--header-bg);
  padding: 14px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-bottom: 1px solid var(--border-color);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 800; color: var(--header-text); font-size: 22px; }
.site-footer { padding: 24px 0; text-align: center; color: var(--footer-text); background: var(--footer-bg); border-top: 1px solid var(--border-color); margin-top: 40px; }

/* --- BOTÕES --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  background: var(--primary-blue);
  color: white !important;
  border: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: var(--dark-blue); text-decoration: none; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.big { padding: 14px 24px; font-size: 16px; }

/* --- PÁGINA INICIAL E CARDS --- */
.hero {
    background: linear-gradient(45deg, var(--dark-blue), var(--primary-blue));
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.hero h1 {
    font-size: 2.8rem;
    margin: 0 0 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* --- Grade de Produtos (Desktop) --- */
.grid { 
  display: grid;
  /* Cria colunas com no mínimo 280px, mas que se ajustam ao espaço. O 1fr garante que elas ocupem o espaço disponível. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card-link { 
  text-decoration: none; 
  color: inherit; 
}
.card {
  background: var(--card-bg);
  border-radius: 12px; /* Bordas mais arredondadas */
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color); /* Borda sutil que combina com o tema */
}
.card-link:hover .card { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.card-img { width: 100%; height: 180px; object-fit: contain; }
.card-img-placeholder { width: 100%; height: 180px; background: #eee; }
.card-body { 
  padding: 20px; 
  flex-grow: 1; 
  display: flex; 
  flex-direction: column; 
}
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card .price { color: var(--green-price); font-weight: 700; margin-bottom: 12px; font-size: 1.2rem; }
.card .desc { color: var(--muted-text); font-size: 0.9rem; border-top: 1px solid var(--border-color); padding-top: 15px; margin-bottom: 20px; flex-grow: 1; }

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto; /* Empurra os botões para o final do card */
}
.card-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-secondary { background-color: var(--dark-blue); }
.btn-secondary:hover { background-color: var(--primary-blue); }
.btn-primary { background-color: var(--primary-blue); }
.btn-primary:hover { background-color: var(--dark-blue); }

/* --- Alinhamento da Grade de Produtos (APENAS DESKTOP) --- */
@media (min-width: 768px) {
  .grid {
    display: flex; /* Usar flexbox para a grade em telas maiores */
    flex-wrap: wrap;
    justify-content: flex-start; /* Alinha os itens à esquerda */
  }
  .card-link { flex: 1 1 30%; max-width: 32%; } /* Define o tamanho e comportamento dos cards */
}

/* --- PÁGINA DE PRODUTO --- */
.product-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  background: var(--card-bg);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) { .product-page { grid-template-columns: 1fr 1.2fr; } }
.product-image-gallery img { width: 100%; border-radius: 8px; }
.product-details-content h1 { font-size: 2.2rem; margin: 0 0 10px; }
.product-details-content .price { font-size: 1.8rem; color: var(--green-price); font-weight: 700; margin-bottom: 20px; }
.product-details-content .meta { color: var(--muted-text); margin-bottom: 10px; }
.full-desc { line-height: 1.7; margin-bottom: 30px; }

.youtube-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin-bottom: 20px;
  border-radius: 8px;
}
.youtube-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.product-actions { margin-bottom: 20px; display: flex; gap: 10px; }
.add-to-cart-form { margin-top: 20px; }

/* --- FORMULÁRIOS (CHECKOUT, LOGIN) --- */
.checkout-form, .customer-auth-form {
  max-width: 500px;
  margin: 40px auto;
  background: var(--card-bg);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 15px; }
.form-row label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-row input, .form-row textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--text-color);
}
.notice {
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  border: 1px solid var(--primary-blue);
  background-color: #eaf5fb;
  color: var(--dark-blue);
}
.notice.error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.copy-pix-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.copy-pix-wrapper textarea {
  flex-grow: 1;
  font-size: 12px;
  word-break: break-all;
}

/* --- TABELAS (MINHA CONTA) --- */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}
.table th, .table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); text-align: left; }
.table th { background-color: #f8f9fa; }
.table tr:last-child td { border-bottom: none; }

/* --- CARRINHO LATERAL --- */
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.cart-overlay.open { opacity: 1; visibility: visible; }

.category-title {
    font-size: 1.8rem;
    color: var(--primary-blue);
    background-color: var(--card-bg);
    padding: 12px 20px; /* Padding vertical menor */
    margin-top: 50px;
    margin-bottom: 30px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--primary-blue);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2); /* Efeito de brilho na caixa */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    animation: pulse-effect 3s infinite ease-in-out; /* Adiciona a pulsação */
}

/* --- ADMIN --- */
.category-group { margin-bottom: 40px; }
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

/* --- EFEITO PARA PRODUTO DESTACADO --- */
@keyframes pulse-effect {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2); /* Brilho dourado */
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
}
.card.featured-product {
  animation: pulse-effect 2.5s infinite ease-in-out;
  border: 2px solid var(--primary-blue); /* Borda mais grossa para destaque */
}

.side-cart {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--card-bg);
  z-index: 999;
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}
.side-cart.open { right: 0; }

.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.cart-header h3 { margin: 0; }
.close-cart-btn { background: none; border: none; color: var(--muted-text); font-size: 28px; cursor: pointer; line-height: 1; }

.cart-body { flex-grow: 1; overflow-y: auto; padding: 10px; }
.cart-item { display: flex; gap: 15px; padding: 10px; }
.cart-item-img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.cart-item-details { flex-grow: 1; }
.cart-item-title { font-weight: bold; margin-bottom: 5px; font-size: 0.9rem; }
.cart-item-price { color: var(--muted-text); font-size: 0.9rem; margin-bottom: 8px; }
.cart-item-form { display: flex; align-items: center; }
.cart-item-qty {
  width: 50px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  color: var(--text-color);
  text-align: center;
}
.btn-update-qty {
  background: none;
  border: none;
  color: var(--primary-blue);
  cursor: pointer;
  margin-left: 10px;
  font-size: 12px;
  text-decoration: underline;
}

.cart-footer { padding: 20px; border-top: 1px solid var(--border-color); background: #fdfdfd; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-size: 1.2rem; font-weight: bold; }

/* --- PÁGINA DE SUPORTE --- */
.ticket-conversation { display: flex; flex-direction: column; gap: 15px; }
.ticket-reply {
    padding: 15px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word; /* Garante a quebra de palavras longas */
}
.customer-reply {
    background-color: var(--bg-light);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0; /* Efeito de balão de chat */
}
.admin-reply {
    background-color: #eaf5fb;
    align-self: flex-end;
    border: 1px solid var(--primary-blue);
    border-bottom-right-radius: 0; /* Efeito de balão de chat */
}
.reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.9rem; color: var(--muted-text); }
.reply-body { line-height: 1.6; }

/* --- NAVEGAÇÃO MOBILE INFERIOR --- */
.mobile-nav {
    display: none; /* Oculto por padrão */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--card-bg);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 990;
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    align-items: stretch;
}
.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted-text);
    font-size: 12px;
    flex-grow: 1;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 0;
}
.mobile-nav-link i {
    font-size: 20px;
    margin-bottom: 5px;
}

/* Media Query para exibir a navegação mobile e ocultar a de desktop */
@media (max-width: 768px) {
    body { padding-bottom: 65px; } /* Adiciona espaço no final da página */
    /* Oculta os botões de ação no cabeçalho em telas pequenas */
    #main-nav #cart-toggle, 
    #main-nav a[href*="my-account.php"],
    #main-nav a[href*="login.php"] { display: none; }
    .mobile-nav { display: flex; } /* Exibe a barra inferior */
}

/* --- Estilos Independentes para a Página de Suporte --- */
.support-page-wrapper {
    color: #333; /* Texto preto */
}
.support-page-wrapper h2,
.support-page-wrapper h3 {
    color: #111;
}
.support-page-wrapper .card,
.support-page-wrapper .table {
    background-color: #ffffff; /* Fundo branco */
    border: 1px solid #e0e0e0;
}
.support-page-wrapper .form-row input,
.support-page-wrapper .form-row textarea {
    background-color: #ffffff;
    color: #333;
    border-color: #ccc;
}
.support-page-wrapper .btn {
    background-color: #3498db; /* Botão azul */
    color: #fff !important;
}
.support-page-wrapper .btn:hover {
    background-color: #2980b9;
}
.support-page-wrapper .table th {
    background-color: #f2f2f2;
}

/* Tabela Responsiva para a Página de Suporte */
@media (max-width: 768px) {
    .support-page-wrapper .table-responsive {
        overflow-x: auto;
    }
    .support-page-wrapper .table thead {
        display: none; /* Esconde o cabeçalho da tabela */
    }
    .support-page-wrapper .table, .support-page-wrapper .table tbody, .support-page-wrapper .table tr, .support-page-wrapper .table td {
        display: block;
        width: 100%;
    }
    .support-page-wrapper .table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
    }
    .support-page-wrapper .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }
    .support-page-wrapper .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: bold;
    }
    .support-page-wrapper .table td:last-child {
        border-bottom: none;
    }
}

/* Ajuste para a conversa de ticket no mobile */
@media (max-width: 768px) {
    .ticket-reply {
        max-width: 90%; /* Aumenta um pouco a largura no mobile */
    }
}

/* --- Ajuste para expandir o formulário de ticket --- */
.support-page-wrapper .card:first-of-type {
    margin-left: -22px; /* Deixa uma pequena margem lateral */
    margin-right: -22px; /* Deixa uma pequena margem lateral */
    border-left: none;
    border-right: none;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

/* --- PÁGINA DE VISUALIZAÇÃO DE TICKET (CLIENTE) --- */
.ticket-view-header {
    padding: 15px;
    margin: -20px -20px 20px -3px; /* Expande para as bordas do card pai */
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}
.ticket-view-header h2 {
    margin: 0 0 5px;
    font-size: 1.5rem;
    word-break: break-word; /* Garante que o título não quebre o layout */
}
.ticket-view-header p {
    margin: 0;
    color: var(--muted-text);
}

.reply-form-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.reply-form-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
}
.reply-form-container textarea {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    min-height: 120px;
}
.reply-form-container .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}


/* Tabela Responsiva para a Página de Suporte */
@media (max-width: 768px) {
    .support-page-wrapper .table-responsive {
        
    }      
/* --- TÍTULO DE SEÇÃO (Ex: Produtos Relacionados) --- */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-top: 60px;
    margin-bottom: 30px;
    color: var(--dark-blue);
}