/* Importação da fonte clássica de barbearia de elite */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Poppins:wght@300;400;500;600&display=swap');

:root { 
    --gold: #c5a059; 
    --dark: #0f0f0f; 
    --card: #1a1a1a; 
    --white: #fff; 
    --gray: #b0b0b0; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; /* Fonte limpa para textos gerais */
}

body { 
    background-color: var(--dark); 
    color: var(--white); 
    line-height: 1.6; 
    scroll-behavior: smooth; 
}

/* Títulos com a Letra Clássica Original */
.logo, .hero h1, .section-title h2, #step-1 h4, #step-2 h4, #step-3 h4, .modal-content h2, .modal-content h3 {
    font-family: 'Cinzel', serif !important;
    letter-spacing: 2px;
}

/* BARRA DE LEMBRETE DESTACADA NO TOPO ABSOLUTO */
.alert-reminder-bar {
    background: #b32424;
    color: #fff;
    text-align: center;
    padding: 12px 5%;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #8a1c1c;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    position: relative;
}
.alert-reminder-bar i {
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Barra Superior e Header */
.top-bar { background: #000; padding: 10px 5%; text-align: right; border-bottom: 1px solid #222; font-size: 0.85rem; }
.top-bar a { color: var(--gold); text-decoration: none; margin-left: 15px; font-weight: bold; cursor: pointer; }

header { padding: 20px 5%; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.95); position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid #333; }
.logo { font-size: 1.5rem; font-weight: bold; color: var(--gold); text-transform: uppercase; }

/* Menu de Navegação Desktop */
nav a { color: var(--white); text-decoration: none; margin-left: 20px; font-size: 0.9rem; transition: 0.3s; font-weight: 500; }
nav a:hover { color: var(--gold); }

/* Botão do Menu Hambúrguer (Oculto no Desktop) */
.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    transition: 0.3s;
}
.menu-toggle-btn:hover { color: var(--gold); }

/* RESPONSIVIDADE DO HEADER (MOBILE) */
@media (max-width: 768px) {
    .menu-toggle-btn { display: block; }
    header nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 15, 15, 0.98);
        border-bottom: 1px solid #333;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    }
    header nav.open { display: flex; }
    header nav a { margin: 12px 0; text-align: center; font-size: 1.1rem; width: 100%; display: block; }
}

/* Hero */
.hero { height: 65vh; background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('images/loja.jpg') center/cover; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.btn-gold { background: var(--gold); color: black; padding: 15px 40px; font-weight: bold; border: none; cursor: pointer; transition: 0.3s; margin-top: 20px; text-transform: uppercase; border-radius: 0; }
.btn-gold:hover { transform: scale(1.05); background: #d4ae6a; }

/* Secções Gerais */
section { padding: 80px 10%; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { color: var(--gold); text-transform: uppercase; font-size: 2rem; }

/* Menu de Serviços Minimalista Estático no Site */
.menu-item-wrapper { border-bottom: 1px solid #222; padding-bottom: 20px; }
.menu-item-description { font-size: 0.95rem; color: var(--gray); font-weight: 300; line-height: 1.5; margin-top: 5px; }

@media (max-width: 768px) { section { padding: 50px 8%; } }

/* Estrutura de Grelhas Gerais (Equipa/Testemunhos) */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 25px; }

/* Carrosséis */
.carousel-wrapper { position: relative; display: flex; align-items: center; }
.horizontal-carousel { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 20px 0; scrollbar-width: none; scroll-behavior: smooth; width: 100%; }
.horizontal-carousel::-webkit-scrollbar { display: none; }
.barber-card, .gallery-card { min-width: 280px; scroll-snap-align: center; background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid #333; transition: 0.3s; }
.barber-card img { width: 100%; height: 380px; object-fit: cover; filter: grayscale(1); transition: 0.5s; cursor: pointer; }
.barber-card:hover img { filter: grayscale(0); }
.gallery-card img { width: 100%; height: 300px; object-fit: cover; transition: 0.4s; }
.gallery-card:hover img { transform: scale(1.08); }

.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(197, 160, 89, 0.9); color: black; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.prev-btn { left: -60px; } .next-btn { right: -60px; }
@media (max-width: 1100px) { .nav-btn { display: none; } }

/* Testemunhos */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.testimonial-card { background: var(--card); padding: 35px; border-left: 4px solid var(--gold); border-radius: 4px; }
.testimonial-card p { font-style: italic; color: var(--gray); margin-bottom: 15px; }

/* Modais Básicos */
.modal { display: none; position: fixed; z-index: 2000; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.96); align-items: center; justify-content: center; }
.modal-content { background: var(--card); border: 1px solid var(--gold); max-width: 450px; width: 92%; padding: 30px; border-radius: 15px; position: relative; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color: #fff; }

/* Agendamento Estilo */
.quick-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.quick-barber-box { display: flex; align-items: center; gap: 10px; background: #222; padding: 6px 15px; border-radius: 30px; flex-grow: 1; border: 1px solid #333; }
.quick-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
#res_barbeiro_quick { background: transparent; color: white; border: none; font-size: 1.1rem; font-weight: bold; outline: none; flex-grow: 1; cursor: pointer; }
#res_barbeiro_quick option { background: #1a1a1a; color: white; }
.back-btn-step { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 1.3rem; transition: 0.2s; }
.back-btn-step:hover { transform: translateX(-3px); }

/* Componente de Datas */
/* Componente de Datas */
.date-chips-container { 
    display: flex; 
    gap: 12px; 
    overflow-x: auto; 
    overflow-y: hidden;
    padding: 10px 0; 
    scrollbar-width: none;               /* Firefox */
    -ms-overflow-style: none;            /* IE e Edge */
    -webkit-overflow-scrolling: touch;   /* Suavidade no iOS / Safari Mobile */
    scroll-behavior: smooth;
}

/* Oculta a scrollbar no Chrome, Safari e Edge Chromium */
.date-chips-container::-webkit-scrollbar {
    display: none;
}

.date-chip { 
    min-width: 60px; 
    padding: 10px; 
    background: #222; 
    border: 1px solid #444; 
    border-radius: 12px; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.3s; 
    flex-shrink: 0; 
    user-select: none;                   /* Impede seleção de texto ao arrastar no ecrã */
}

.date-chip.active { 
    background: var(--gold); 
    border-color: var(--gold); 
    color: black; 
}

.date-chip strong { 
    display: block; 
    font-size: 1.4rem; 
    line-height: 1; 
}

.date-chip span { 
    display: block; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    margin-top: 4px; 
    color: var(--gray); 
}

.date-chip.active span { 
    color: black; 
}

/* Grelha de Horas */
.grid-horas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.btn-hora { background: #222; color: white; border: 1px solid #444; padding: 12px; cursor: pointer; border-radius: 8px; border: none; font-weight: 500; }
.btn-hora.selected { background: var(--gold); color: black; font-weight: bold; }

/* Inputs e Ajustes Gerais */
.input-barber, select, input { width: 100%; padding: 12px; margin: 10px 0; background: #222; border: 1px solid #444; color: white; border-radius: 8px; outline: none; }
.tab-btn { flex: 1; padding: 10px; background: none; border: none; color: white; cursor: pointer; border-bottom: 2px solid #333; font-weight: bold; }
.tab-btn.active { color: var(--gold); border-bottom: 2px solid var(--gold); }

/* DESIGN DOS EXTRAS RECUPERADO */
.extras-container { max-height: 200px; overflow-y: auto; margin-top: 10px; padding-right: 5px; scrollbar-width: thin; }
.extra-item { display: flex; justify-content: space-between; align-items: center; background: #222; border: 1px solid #333; padding: 12px 15px; border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: 0.2s; }
.extra-item:hover { border-color: var(--gold); }
.extra-item.selected { border-color: var(--gold); background: rgba(197, 160, 89, 0.1); }
.extra-meta { font-size: 0.85rem; color: var(--gray); display: block; margin-top: 2px; }
.extra-checkbox-mock { width: 20px; height: 20px; border-radius: 4px; border: 2px solid #555; display: flex; align-items: center; justify-content: center; color: transparent; font-size: 0.75rem; flex-shrink: 0; }
.extra-item.selected .extra-checkbox-mock { background: var(--gold); border-color: var(--gold); color: black; }
/* ==========================================================================
   BARRA ESTILO APLICAÇÃO MÓVEL (MOBILE BOTTOM NAVIGATION)
   ========================================================================== */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #111;
    border-top: 1px solid #222;
    display: none; /* Oculto no computador por padrão */
    justify-content: space-around;
    align-items: center;
    z-index: 1900; 
    padding-bottom: env(safe-area-inset-bottom); /* Suporte para a barra do iPhone */
    box-shadow: 0 -5px 25px rgba(0,0,0,0.8);
}

.app-nav-item {
    background: none;
    border: none;
    color: var(--gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    flex: 1;
}

.app-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    transition: 0.2s;
}

.app-nav-item:hover, .app-nav-item:active { 
    color: var(--gold); 
}

.app-nav-item.has-vouchers {
    color: var(--gold);
    animation: voucher-pulse 1.2s ease-in-out infinite;
}

.app-nav-item.has-vouchers i {
    filter: drop-shadow(0 0 7px var(--gold));
}

@keyframes voucher-pulse {
    50% { opacity: .55; transform: scale(1.08); }
}

.voucher-notice {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 2200;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 36px);
    padding: 14px 16px;
    border: 1px solid var(--gold);
    border-radius: 12px;
    background: #171511;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.voucher-notice[hidden] { display: none; }
.voucher-notice i { color: var(--gold); margin-right: 6px; }
.voucher-notice button {
    border: 0;
    background: transparent;
    color: var(--gold);
    font-weight: 700;
    cursor: pointer;
}
.voucher-notice .voucher-notice-close {
    color: #aaa;
    font-size: 1.25rem;
}

.voucher-card {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    border: 1px solid rgba(197, 160, 89, .72);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 100% 0, rgba(197, 160, 89, .12), transparent 44%),
        linear-gradient(135deg, #24211a, #151412 70%);
    color: #fff;
    text-align: left;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .04);
}

.voucher-card-header,
.voucher-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.voucher-category,
.voucher-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #b7aa8b;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.voucher-card h3 {
    margin: 0;
    color: var(--gold);
    font-size: 1.08rem;
    line-height: 1.35;
}

.voucher-status {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid rgba(76, 175, 120, .4);
    border-radius: 999px;
    background: rgba(46, 204, 113, .1);
    color: #8ae0ad;
    font-size: .7rem;
    font-weight: 600;
}

.voucher-status-pending {
    border-color: rgba(197, 160, 89, .45);
    background: rgba(197, 160, 89, .1);
    color: #e0c27f;
}

.voucher-divider {
    height: 1px;
    margin: 14px 0;
    background: repeating-linear-gradient(to right, rgba(197, 160, 89, .55) 0 5px, transparent 5px 9px);
}

.voucher-code-wrap { margin-bottom: 13px; }

.voucher-card .voucher-code {
    display: inline-block;
    margin: 0;
    padding: 6px 10px;
    border: 1px dashed rgba(197, 160, 89, .7);
    border-radius: 7px;
    background: rgba(0, 0, 0, .22);
    color: #fff;
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: 1.3px;
    overflow-wrap: anywhere;
}

.voucher-offer {
    padding: 12px 14px;
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    background: rgba(197, 160, 89, .08);
}

.voucher-offer strong {
    display: block;
    color: #f2d48f;
    font-size: 1rem;
}

.voucher-card .voucher-offer p {
    margin: 4px 0 0;
    color: #d1cbc0;
    font-size: .86rem;
}

.voucher-card-footer {
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
}

.voucher-card .voucher-card-footer p {
    margin: 0;
    color: #aaa;
    font-size: .78rem;
}

.voucher-card .voucher-card-footer .voucher-remaining {
    color: #8ae0ad;
    font-weight: 700;
}

.voucher-card .voucher-card-footer .voucher-product-note {
    margin-top: 6px;
    color: #c6b584;
    font-size: .74rem;
}

@media (max-width: 480px) {
    .voucher-card { padding: 15px; }
    .voucher-card-header { gap: 8px; }
    .voucher-card h3 { font-size: .98rem; }
    .voucher-status { font-size: .64rem; }
}

/* O Botão Central Flutuante Dourado de Agendamento */
.app-nav-item.center-action { 
    position: relative; 
    z-index: 1950; 
}

.app-nav-item.center-action .icon-box {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--gold), #d4ae6a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.5rem;
    margin-top: -32px; /* Faz o botão saltar para fora da barra */
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
    border: 4px solid #111; 
    transition: 0.3s ease;
}

.app-nav-item.center-action:hover .icon-box { 
    transform: scale(1.08) translateY(-2px); 
}

/* Regras Responsivas para Ativar a App Bar */
@media (max-width: 768px) {
    /* 1. O botão hambúrguer aparece SEMPRE no topo direito */
    .menu-toggle-btn { 
        display: block !important; 
    }
    
    /* 2. A barra estilo App no rodapé aparece SEMPRE cá em baixo */
    .app-bottom-nav { 
        display: flex !important; 
    }
    
    /* 3. Garante o espaço em baixo em qualquer dispositivo para o conteúdo não ser tapado */
    body { 
        padding-bottom: 75px !important; 
    }
    
    /* 4. Oculta a barra superior preta desktop para não duplicar espaço */
    .top-bar { 
        display: none !important; 
    } 
    
    /* 5. Configuração do menu drop-down que desce do topo ao clicar no hambúrguer */
    header nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 15, 15, 0.98);
        border-bottom: 1px solid #333;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.8);
        z-index: 9999;
    }
    header nav.open { 
        display: flex; 
    }
    header nav a { 
        margin: 12px 0; 
        text-align: center; 
        font-size: 1.1rem; 
        width: 100%; 
        display: block; 
    }
}

/* Controla a exibição do botão de logout dentro do modal */
.btn-logout-mobile {
    display: none; /* Escondido por padrão no computador */
}

@media (max-width: 768px) {
    .btn-logout-mobile {
        display: inline-block; /* Aparece apenas no mobile dentro do Perfil */
    }
    .btn-logout-mobile:hover {
        background: #ff4444;
        color: #fff !important;
    }
}
/* Controla a exibição do logout dentro do menu drop-down */
.nav-logout-mobile {
    display: none; /* Escondido no ecrã grande/computador */
}

@media (max-width: 768px) {
    .nav-logout-mobile {
        display: block; /* Ativa-se apenas quando a janela encolhe ou passa a mobile */
    }
}

/* Esconde SEMPRE no Desktop */
.user-greeting-mobile {
    display: none !important;
}

/* Mostra APENAS quando o ecrã colapsa para mobile / tablet */
@media (max-width: 768px) {
    .user-greeting-mobile {
        display: block !important;
        margin-top: 35px; /* Mais espaço abaixo do botão */
        font-size: 1rem;
        color: #ffffff;
        text-align: center;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); /* Garante leitura sobre a imagem de fundo */
    }

    .user-greeting-mobile strong {
        color: #ffffff;
        font-weight: 700;
    }
}
/* =========================================================
   TOAST / LEMBRETE FLUTUANTE DE AGENDAMENTO
   ========================================================= */

/* Posicionamento inicial no Topo (escondido acima do ecrã) */
.toast-card-lembrete {
    position: fixed;
    top: -120px; /* Começa acima da janela */
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #1a1a1a;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    max-width: 92%;
    width: 380px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Estado ativo (desliza para baixo até à posição final) */
.toast-card-lembrete.visivel {
    top: 25px; /* Distância a contar do topo do ecrã */
}

/* Ícone de Destaque */
.toast-icone {
    background: #fdf5e6;
    color: var(--gold, #c59b27);
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Conteúdo de Texto */
.toast-conteudo {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.toast-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #888888;
    letter-spacing: 0.5px;
}

.toast-texto {
    margin: 2px 0 0 0;
    font-size: 0.88rem;
    color: #222222;
    line-height: 1.25;
}

.toast-texto strong {
    color: #000000;
    font-weight: 700;
}

/* Botões de Ação */
.toast-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toast-alterar {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-toast-alterar:active {
    transform: scale(0.96);
}

.btn-toast-alterar:hover {
    background: #333333;
}

.btn-toast-fechar {
    background: transparent;
    border: none;
    color: #aaaaaa;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-toast-fechar:hover {
    color: #333333;
}

/* =========================================================
   MINI-WIDGET / BADGE FLUTUANTE (AMARELO TORRADO - INVERTIDO)
   ========================================================= */
.badge-lembrete-widget {
    position: fixed;
    top: -80px;
    right: 16px;
    background: #c59b27;
    color: #121212;
    border: 1px solid #b0851a;
    padding: 0 16px;
    height: 38px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(197, 155, 39, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    z-index: 9990;
    user-select: none;
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.2s ease, background 0.2s;
}

/* Ícone */
.badge-lembrete-widget i {
    color: #121212;
    font-size: 0.95rem;
}

/* Data destacada */
.badge-lembrete-widget strong {
    color: #000000;
    font-weight: 850;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

/* Estado Visível (logo abaixo do cabeçalho com o título) */
.badge-lembrete-widget.visivel {
    top: calc(var(--header-h, 90px) + 10px);
}

/* Interações */
.badge-lembrete-widget:active {
    transform: scale(0.95);
}

.badge-lembrete-widget:hover {
    background: #d4af37;
}