:root {
    --primary-color: #8A2BE2;
    --primary-hover: #701fa1;
    --brand-dark: #000000;
    --brand-light: #FFFFFF;
    --bg-page: #F8F8F8;
    --text-dark: #333333;
    --text-muted: #888888;
    --accent-yellow: #FFD700;
    --border-color: #EAEAEA;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0 0 40px 0;
}

.top-brand-bar {
    width: 100%;
    background-color: var(--brand-dark);
    color: var(--brand-light);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
} 
.brand-logo a { 
    text-decoration: none;
    color: var(--brand-light);
}
.brand-logo .yellow-text {
    color: var(--accent-yellow);
}
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-input {
    background-color: var(--brand-light);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    width: 110px;
    color: var(--text-dark);
    outline: none;
}
.search-input::placeholder {
    color: #A0A0A0;
}
.btn-categories {
    background-color: #222222;
    color: var(--accent-yellow);
    border: 1px solid #333333;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-transform: lowercase;
}

.page-container {
    width: 100%;
    max-width: 900px;
    padding: 0 24px 24px 24px;
}

.breadcrumbs {
    font-size: 13px;
    color: #777777;
    padding: 12px 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.breadcrumbs a {
    color: #777777;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.home-icon-svg {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.store-header-box {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    background: var(--brand-light);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.store-logo {
    width: 110px;
    height: 110px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: var(--brand-light);
    flex-shrink: 0;
}
.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* --- INÍCIO: SPINNER DE CARREGAMENTO --- */
.img-loader {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin-loading 0.8s linear infinite;
    inset: 0;
    margin: auto;
    z-index: 1;
}

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

/* Garante que o círculo fique preso dentro dessas caixas */
.store-logo, .card-left-thumb, .modal-img-container {
    position: relative;
}
/* --- FIM: SPINNER DE CARREGAMENTO --- */

.store-info-text {
    flex: 1;
}
.store-info-text h1 {
    font-size: 22px;
    font-weight: bold;
    color: var(--brand-dark);
    margin-bottom: 10px;
}
.store-description {
    font-size: 14px;
    color: #444444;
    line-height: 1.5;
    text-align: justify;
}
.desc-more { display: inline; }
.desc-dots, .btn-toggle-desc { display: none; }

.tabs-container {
    display: flex;
    border: 1px solid #E0E0E0;
    background-color: var(--brand-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.tab-button {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
    background-color: var(--brand-light);
    color: var(--brand-dark);
}
.tab-button[data-tab="codigos"].active {
    background-color: var(--brand-dark) !important;
    color: var(--brand-light) !important;
}
.tab-button[data-tab="ofertas"].active {
    background-color: var(--accent-yellow) !important;
    color: var(--brand-dark) !important;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.tab-content.active { display: flex; }

.coupon-card {
    background-color: var(--brand-light);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    border: 1px solid #EFEFEF;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative !important;
    overflow: hidden !important;
}
.coupon-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card-left-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #F5F5F5;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
}
.card-left-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.card-middle-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 80px; 
}
.card-title {
    font-size: 22px;
    color: black;
    line-height: 1.2;
    
}
.card-subtitle {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.dynamic-text-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}
.badge-main-pct {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1.1;
    text-transform: uppercase;
}
.badge-sub-txt {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.2;
    font-weight: 500;
}

.modal-img-container .dynamic-text-badge .badge-main-pct { font-size: 44px; }
.modal-img-container .dynamic-text-badge .badge-sub-txt { font-size: 16px; margin-top: 6px; }

.btn-action-trigger {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 90px;
    height: 70px;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: var(--primary-color) !important; 
    color: var(--brand-light) !important;
    font-size: 26px !important; 
    font-weight: 900 !important;
    text-transform: lowercase !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding-right: 12px !important;
    padding-bottom: 6px !important;
    cursor: pointer;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    transition: background-color 0.2s, transform 0.2s !important;
}
.btn-action-trigger:hover { background-color: var(--primary-hover) !important; }

.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 16px;
    overflow: hidden;
}
.overlay-modal.active { opacity: 1; pointer-events: all; }
/* 1. CAIXA PRINCIPAL DO MODAL */
.modal-content {
    /* Removemos o fundo branco e a sombra tradicional */
    background-color: transparent;
    box-shadow: none;
    
    /* Usamos drop-shadow para a sombra contornar os furos do cupom magicamente */
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.25));
    
    width: 100%;
    max-width: 450px;
    /* Zeramos padding e gap, os filhos assumem isso agora */
    padding: 0;
    gap: 0;
    
    border-radius: 16px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* 2. PARTE DE CIMA (Fundo branco superior + Máscara cortando em baixo) */
.modal-header-split {
    background-color: var(--brand-light);
    /* Mantemos o padding de cima e dividimos o meio */
    padding: 28px 28px 10px 28px;
    border-radius: 16px 16px 0 0;
    
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    
    /* Corta dois recortes de 1/4 de círculo na base */
    -webkit-mask-image: 
        radial-gradient(circle at 0% 100%, transparent 10px, black 10.5px),
        radial-gradient(circle at 100% 100%, transparent 10px, black 10.5px);
    mask-image: 
        radial-gradient(circle at 0% 100%, transparent 10px, black 10.5px),
        radial-gradient(circle at 100% 100%, transparent 10px, black 10.5px);
    -webkit-mask-position: left bottom, right bottom;
    mask-position: left bottom, right bottom;
    -webkit-mask-size: 51% 100%;
    mask-size: 51% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* 3. PARTE DE BAIXO (Fundo branco inferior + Máscara cortando em cima) */
.modal-actions {
    background-color: var(--brand-light);
    /* Recebe a outra metade do espaço divido e o padding de baixo */
    padding: 30px 28px 28px 28px;
    border-radius: 0 0 16px 16px;
    
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    
    /* Corta dois recortes de 1/4 de círculo no topo */
    -webkit-mask-image: 
        radial-gradient(circle at 0% 0%, transparent 10px, black 10.5px),
        radial-gradient(circle at 100% 0%, transparent 10px, black 10.5px);
    mask-image: 
        radial-gradient(circle at 0% 0%, transparent 10px, black 10.5px),
        radial-gradient(circle at 100% 0%, transparent 10px, black 10.5px);
    -webkit-mask-position: left top, right top;
    mask-position: left top, right top;
    -webkit-mask-size: 51% 100%;
    mask-size: 51% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* 4. A LINHA TRACEJADA */
.modal-actions::before {
    content: "";
    position: absolute;
    top: 0;
    left: 14px; /* Afastado das bordas para não cruzar os furos */
    right: 14px;
    border-top: 2px dashed #C4C4C4;
    height: 1px;
    pointer-events: none;
}

.overlay-modal.active .modal-content { transform: scale(1); }
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background-color: #E0E0E0;
    color: var(--text-dark);
    border: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.modal-close:hover { background-color: #CCCCCC; }

.modal-header-split {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}
.modal-text-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    flex: 1;
}
.modal-side-subtitle {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
}
.modal-side-meta {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: pre-line;
}
.modal-img-container {
    width: 180px; 
    height: 180px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background-color: var(--brand-light);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    flex-shrink: 0;
}
.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.btn-modal {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}
.btn-modal:active { transform: scale(0.98); }
.btn-primary-action {
    background-color: var(--brand-dark);
    color: var(--brand-light);
    width: 100%;
    font-size: 18px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 10px;
}
.btn-primary-action:hover { background-color: #222222; }
.btn-secondary-action {
    background-color: #F0F0F0;
    color: var(--brand-dark);
    width: 100%;
}
.btn-secondary-action:hover { background-color: #E5E5E5; }

.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--brand-light);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.modal-star {
    position: fixed;
    bottom: -25px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    animation: modalFloatUp linear infinite;
}
.modal-star svg { fill: #FFFFFF; stroke: none; }

@keyframes modalFloatUp {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.45; }
    90% { opacity: 0.45; }
    100% { transform: translateY(-110vh) translateX(35px) rotate(45deg); opacity: 0; }
}

@media(max-width: 480px) {
         .tab-content {
        margin-left: -20px;  /* Puxa 14px para a esquerda */
        margin-right: -20px; /* Puxa 14px para a direita */
    }
    
    
    .store-header-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px;
    }
    .store-description.truncated .desc-more { display: none; }
    .store-description.truncated .desc-dots { display: inline; }
    .store-description.expanded .desc-more { display: inline; }
    .store-description.expanded .desc-dots { display: none; }
    
    .btn-toggle-desc {
        display: inline-block;
        color: #0066CC;
        background: none;
        border: none;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
        margin-top: 6px;
        text-decoration: underline;
    }
    .coupon-card { padding: 12px; gap: 12px; }
    .card-middle-info { padding-right: 30px; }
    .card-title { font-size: 18px;
                  
    }
    .btn-action-trigger {
        width: 75px;
        height: 60px;
        font-size: 22px !important;
        padding-right: 8px !important;
        padding-bottom: 4px !important;
    }
    .modal-header-split { flex-direction: row; gap: 12px; }
    .modal-img-container { width: 130px; height: 130px; }
}
.code-highlight {
    background-color: #8A2BE2; 
    color: var(--brand-light); 
    padding: 4px 8px;          
    border-radius: 50px;        
    font-size: 12px;
    margin-left: auto;
    margin-right: 10px;
}
/* =======================================================
   SKELETON LOADING PARA OS CUPONS (PURO CSS)
   ======================================================= */

/* 1. Cria a animação do "brilho" passando da esquerda pra direita */
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 2. Aplica o skeleton na imagem (apenas enquanto a div estiver vazia) */
.card-left-thumb:empty {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border: none;
}

/* 3. Aplica o skeleton no Subtítulo e Meta (apenas enquanto estiverem vazios) */
.card-subtitle:empty {
    height: 14px;
    width: 50%;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    margin-top: 4px;
}

.card-meta:empty {
    height: 12px;
    width: 80%;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    margin-top: 6px;
}

/* 4. Substitui a palavra "Carregando..." por uma barra animada elegante */
.coupon-card:has(.card-subtitle:empty) .card-title {
    color: transparent; /* Esconde a palavra escrita */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 4px;
    width: 70%;
    height: 18px;
}

/* 5. Desativa visualmente o botão roxo "Ver" enquanto o card carrega */
.coupon-card:has(.card-subtitle:empty) .btn-action-trigger {
    background: #e0e0e0 !important;
    color: transparent !important;
    pointer-events: none; /* Impede que o usuário clique no esqueleto */
}
