/* Vegano - Estilo v1.7.24 */
* {
    box-sizing: border-box !important;
    user-select: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

*::selection {
    background-color: rgba(59, 117, 114, 0.67);
}

body {
    overflow-y: hidden;
    margin: 0;
    background-color: var(--bg-color, #333633);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--text-color, #fff);
}

/* Box base */
.box {
    width: 100%;
    padding: 8px;
    background-color: rgba(20, 31, 30, 0.5);
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.29);
    border-width: 3px;
    border-radius: 11px;
    box-shadow: 0 4px 8px 2px rgba(0, 0, 0, 0.33);
}

/* Main */
main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(320px, 40vw, 560px);
    display: flex;
    flex-direction: column;
}

/* Seção de lista */
section.list {
    height: clamp(392px, 55vh, 520px);
    margin-bottom: 16px;
}

.boxTitle {
    display: flex;
    align-items: center;
    padding-top: 2px;
    padding-left: 4px;
    padding-bottom: 8px;
}

.boxTitle span {
    margin-left: 9px;
}

/* Lista de itens */
ul.items {
    display: flex;
    background-color: rgba(0, 0, 0, 0.33);
    border-radius: 4px;
    width: 100%;
    height: calc(100% - 34px);
    margin: 0;
    padding: 3px;
    padding-bottom: 0;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

ul.items li {
    margin-bottom: 3px;
    display: flex;
    width: 100%;
    min-height: 25px;
    border-radius: 2px;
    font-size: 13px;
    align-items: center;
    padding-left: 6px;
    padding-bottom: 1px;
    cursor: pointer;
    flex-shrink: 0;
}

ul.items li:hover {
    background-color: rgba(85, 85, 85, 0.08);
}

ul.items li.selected {
    background-color: rgba(85, 85, 85, 0.25);
}

/* Tags */
li .tag {
    background-color: rgba(58, 117, 114, 0.33);
    border-radius: 2px;
    font-size: 10px;
    font-weight: 400;
    padding-left: 4px;
    padding-right: 4px;
    margin-left: 6px;
    margin-top: 1px;
    pointer-events: none;
    white-space: nowrap;
}

li .vtag {
    background-color: rgba(255, 255, 255, 0.75);
    color: #000 !important;
    font-weight: 600;
}

/* Seção de downloads */
section.downloads .downloadButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 30px;
    padding: 4px;
}

.downloadButtons button {
    font-size: 13px;
    padding: 4px 10px;
    color: #fff;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    height: 28px;
    transition: background-color 0.15s;
    white-space: nowrap;
    background-color: var(--primary-color-67, rgba(59, 117, 114, 0.67));
}

.downloadButtons button:hover {
    background-color: var(--primary-color-39, rgba(59, 117, 114, 0.39));
}

.downloadButtons button:active {
    background-color: var(--primary-color-20, rgba(59, 117, 114, 0.2));
    outline: 2px solid var(--primary-color-67, rgba(59, 117, 114, 0.67));
}

/* Quando há 1-3 botões, ocupam espaço igual */
.downloadButtons.few-buttons button {
    flex: 1;
    min-width: 0;
}

/* Cabeçalho da marca / acionador do menu */
aside {
    pointer-events: none;
}

aside * {
    pointer-events: auto;
}

aside.left {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 8001;
    width: 320px;
    height: auto;
    padding: 12px;
}

aside.left .brand-bar {
    position: fixed;
    z-index: 8002;
    top: 12px;
    left: 12px;
    width: 296px;
    min-height: 68px;
    margin: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    column-gap: 6px;
    align-items: center;
    justify-items: center;
    color: #fff;
    background-color: rgba(20, 31, 30, 0.5);
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.29);
    border-width: 3px;
    border-radius: 11px;
    box-shadow: 0 4px 8px 2px rgba(0, 0, 0, 0.33);
    /* Prevenir flicker ao abrir/fechar o drawer */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

aside.left .brand-bar::before {
    display: none;
}

aside.left .brand-bar::after {
    content: '';
    grid-column: 3;
    grid-row: 1;
    width: 40px;
    height: 40px;
    pointer-events: none;
}

aside.left .logo-image {
    grid-column: 2;
    grid-row: 1;
    z-index: 1;
    width: min(176px, 100%);
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 382 / 115;
    overflow: hidden;
    line-height: 0;
}

aside.left .logo-image .vegano-logo {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    /* Prevenir repaint/flicker da logo ao abrir/fechar o menu no mobile */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.category-menu-toggle,
.category-drawer-close {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    background: rgba(14, 18, 18, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.category-menu-toggle {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    padding: 10px 9px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.category-menu-toggle:hover,
.category-drawer-close:hover {
    background: var(--primary-color-39, rgba(59, 117, 114, 0.39));
}

.category-menu-toggle:focus-visible,
.category-drawer-close:focus-visible,
.category-button:focus-visible,
.category-drawer .social a:focus-visible {
    outline: 2px solid var(--primary-color, #28a745);
    outline-offset: 3px;
}

.category-menu-toggle-icon {
    width: 20px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-menu-toggle-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

body.category-menu-open .category-menu-toggle-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.category-menu-open .category-menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

body.category-menu-open .category-menu-toggle-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Drawer lateral de categorias */
.category-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 7998;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.category-drawer {
    position: fixed;
    z-index: 7999;
    inset: 88px auto 0 0;
    width: min(82vw, 320px);
    height: calc(100dvh - 88px);
    display: flex;
    flex-direction: column;
    color: #fff;
    background-color: rgba(20, 31, 30, 0.5);
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.29);
    border-width: 3px;
    border-radius: 11px;
    box-shadow: 0 4px 8px 2px rgba(0, 0, 0, 0.33);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 260ms;
}

body.category-menu-open {
    overflow: hidden !important;
}

/* No desktop o drawer é persistente e não deve bloquear scroll. */
@media (min-width: 960px) and (orientation: landscape) {
    body.category-menu-open {
        overflow: visible !important;
        overflow-y: auto !important;
    }
}

body.category-menu-open .category-drawer-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.category-menu-open .category-drawer {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.category-drawer-header {
    flex: 0 0 auto;
    min-height: 62px;
    padding: 12px 14px 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.category-drawer-header strong {
    font-size: 17px;
    letter-spacing: 0.02em;
}

.category-drawer-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.category-drawer-nav {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
}

.category-drawer .categories {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
}

.category-drawer .categories li {
    width: 100%;
    margin: 0;
    padding: 0;
}

.category-button {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    word-break: break-word;
    cursor: pointer;
}

.category-button:hover {
    background: var(--primary-color-20, rgba(59, 117, 114, 0.2));
}

.category-button.selected {
    border-color: var(--primary-color-39, rgba(59, 117, 114, 0.39));
    background: var(--primary-color-67, rgba(59, 117, 114, 0.67));
}

.category-drawer-footer {
    flex: 0 0 auto;
    padding: 12px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.category-drawer-social-label {
    display: block;
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.category-drawer .social {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.category-drawer .social a {
    width: 22px;
    height: 22px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.86;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.category-drawer .social a:hover {
    opacity: 1;
}

.category-drawer .social svg {
    width: 15px;
    height: 15px;
}

/* Desktop: menu persistente por padrão e conteúdo centralizado na área livre. */
@media (min-width: 960px) and (orientation: landscape) {
    .category-drawer {
        inset: 92px auto 12px 12px;
        width: 320px;
        height: auto;
    }

    .category-drawer-backdrop,
    body.category-menu-open .category-drawer-backdrop {
        display: none;
    }

    .category-drawer-close {
        display: none;
    }

    .category-drawer-header {
        justify-content: flex-start;
        padding-left: 22px;
    }


}



@media (prefers-reduced-motion: reduce) {
    .category-drawer,
    .category-drawer-backdrop,
    .category-menu-toggle-icon span {
        transition: none;
    }
}

/* Search */
.search {
    position: absolute;
    top: 12px;
    width: clamp(320px, 40vw, 560px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    padding: 6px;
    align-items: center;
}

input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    width: 275px;
    margin-left: 6px;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* DMCA */
.dmca {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    opacity: 0.5;
    white-space: nowrap;
}

/* Overlay / Popup */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

#overlay.active {
    display: flex;
}

#overlay .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 660px;
    margin-bottom: 10px;
    gap: 12px;
}

#overlay .title .vegano-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

#overlay .title span {
    font-size: 20px;
    font-weight: 600;
}

#overlay .title button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

#overlay .title button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#overlay article.box {
    width: 660px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

#overlay article h1 {
    font-size: 32px;
    margin-bottom: 16px;
    text-align: center;
}

#overlay article h2 {
    font-size: 23px;
    margin-top: 30px;
    margin-bottom: 12px;
    color: #ffcc00;
    text-align: center;
}

#overlay article h3 {
    font-size: 19px;
    margin-bottom: 12px;
    font-weight: 400;
    text-align: center;
}

#overlay article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

#overlay article a {
    color: #4fc3f7;
    text-decoration: underline;
}

/* Links de texto convertidos em <button> pela proteção de URLs:
   manter aparência de link azul clicável, não de botão. */
#overlay article button.vegano-text-link,
.vegano-warning-text button.vegano-text-link {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: inline !important;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: inherit;
    color: #4fc3f7 !important;
    text-decoration: underline !important;
    cursor: pointer;
}

#overlay article button.vegano-text-link:hover,
.vegano-warning-text button.vegano-text-link:hover {
    color: #81d4fa !important;
    opacity: 1;
    transform: none;
}

#overlay article img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px auto;
    display: block;
}

/* Botões dentro do popup */
.popup-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.popup-buttons button {
    font-size: 14px;
    padding: 10px 18px;
    color: #fff !important;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background-color: var(--primary-color-67, rgba(59, 117, 114, 0.67));
    transition: all 0.15s;
    text-align: center;
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.popup-buttons button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.popup-buttons button:active {
    opacity: 0.6;
    transform: translateY(0);
}

/* Cores de botão no popup */
.popup-buttons button.btn-green {
    background-color: #28a745 !important;
}

.popup-buttons button.btn-blue {
    background-color: #007bff !important;
}

.popup-buttons button.btn-orange {
    background-color: #fd7e14 !important;
}

.popup-buttons button.btn-yellow {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.popup-buttons button.btn-red {
    background-color: #dc3545 !important;
}

/* Throbber / Loading */
.throbber {
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Responsivo - Mobile (portrait ou telas estreitas) */
@media (orientation: portrait), (max-width: 705px) {
    body {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        align-content: start;
        gap: 10px;
        min-height: 100svh;
        padding: 10px 12px 12px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Somente o cabeçalho da marca participa da grade; o drawer permanece fixo. */
    aside.left {
        display: contents;
    }

    aside.left .brand-bar {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        position: sticky;
        top: 0;
        left: auto;
        width: min(100%, 430px);
        min-height: 64px;
        margin: 0;
    }

    aside.left .logo-image {
        width: clamp(180px, 48vw, 200px);
        max-width: 100%;
        margin: 0;
    }

    aside.left .logo-image .vegano-logo {
        margin: 0;
    }

    .category-menu-toggle {
        width: 38px;
        height: 38px;
    }

    main {
        grid-column: 1;
        grid-row: 3;
        position: static;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        min-width: 0;
    }

    section.list {
        height: clamp(280px, calc(100svh - 300px), 520px) !important;
    }

    .search {
        grid-column: 1;
        grid-row: 2;
        position: sticky;
        z-index: 7000;
        top: 90px;
        left: auto;
        transform: none;
        width: 100%;
        min-height: 46px;
        padding: 6px 8px;
        align-items: center;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .search input {
        height: 32px;
        width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    .category-drawer {
        inset: 96px auto 0 0;
        width: min(86vw, 320px);
        height: calc(100dvh - 96px);
    }

    #overlay article.box {
        width: calc(100vw - 32px);
    }

    #overlay .title {
        width: calc(100vw - 52px);
    }

    .dmca {
        display: none;
    }
}

@media (max-width: 320px) {
    .category-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .category-drawer {
        width: min(88vw, 290px);
    }
}

@media (max-height: 600px) {
    .dmca {
        display: none !important;
    }
}

/* Popup de Aviso Prévio */
.vegano-warning-content {
    text-align: center;
}

.vegano-warning-content h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #ffcc00;
}

.vegano-warning-text {
    text-align: left;
    margin-bottom: 24px;
}

.vegano-warning-text p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
    color: var(--text-color, #fff);
}

.vegano-warning-text img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
}

.vegano-warning-text a {
    color: #4fc3f7;
    text-decoration: underline;
}

.vegano-warning-text .popup-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.vegano-warning-text .popup-buttons a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 5px;
    background-color: var(--primary-color, #3b7572);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.15s;
}

.vegano-warning-text .popup-buttons a:hover {
    opacity: 0.85;
}

.vegano-warning-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}

.vegano-warn-btn {
    font-size: 14px;
    padding: 12px 18px;
    color: #fff;
    border: none;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.vegano-warn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vegano-warn-btn:not(:disabled):hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.vegano-warn-btn:not(:disabled):active {
    opacity: 0.7;
    transform: translateY(0);
}

.vegano-warn-btn-hide {
    background-color: rgba(0,0,0,.29);
}

.vegano-warn-btn-show {
    background-color: rgba(59, 117, 114, .67);
}

.vegano-timer {
    font-weight: 700;
}
