/* ===================================
   CSS DE IMPRESSÃO - CARTA DE VINHOS
   Restaurante Turismo - MARGENS EM TODAS AS PÁGINAS
   =================================== */

@media print {
    
    /* RESET */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box;
    }
    
    @page {
        size: A4 portrait;
        margin: 30mm 35mm 25mm 35mm;
    }
    
    html {
        margin: 0;
        padding: 0;
    }
    
    body {
        font-family: 'Helvetica Neue', Arial, sans-serif;
        font-size: 9pt;
        line-height: 1.4;
        color: #2c2c2c;
        background: white !important;
        margin: 0 !important;
        padding: 30mm 35mm 25mm 35mm !important; /* PADDING EM VEZ DE MARGIN */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* OCULTAR ELEMENTOS */
    header#header,
    footer#footer,
    .ct-header-trigger,
    .ct-search-box,
    .ct-header-search,
    button,
    .entry-button,
    nav.ct-pagination,
    .ct-drawer-canvas,
    #offcanvas,
    #search-modal,
    .skip-link,
    script,
    noscript,
    .ct-ajax-loader,
    svg,
    .ct-toggle-close,
    .ct-panel-actions,
    .ct-load-more-helper,
    .ct-dynamic-filter,
    [data-block="hook:478"],
    [data-block="hook:494"],
    .entry-divider {
        display: none !important;
    }
    
    /* CONTAINERS */
    #main-container,
    .site-main,
    .ct-container,
    section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    
    /* TÍTULO DA REGIÃO */
    .hero-section {
        margin: 0 0 22pt 0 !important;
        padding: 0 !important;
        background: transparent !important;
        page-break-after: avoid !important;
        clear: both !important;
    }
    
    .hero-section .page-title {
        font-size: 13pt !important;
        font-weight: normal !important;
        color: #2c2c2c !important;
        font-style: italic;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* LISTA DE VINHOS */
    .entries {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* CADA VINHO */
    .entry-card {
        display: block !important;
        position: relative !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin: 0 0 18pt 0 !important;
        padding: 0 0 5pt 60pt !important;
        background: transparent !important;
        min-height: 52pt !important;
        clear: both !important;
        overflow: visible !important;
    }
    
    .entry-card .card-content {
        display: block !important;
        position: relative !important;
        clear: both !important;
    }
    
    /* RESETAR META */
    .entry-card .entry-meta {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }
    
    .entry-card .entry-meta li {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* ANO - COLUNA ESQUERDA */
    .entry-card .meta-custom-field[data-field="colheita"] {
        position: absolute !important;
        left: -60pt !important;
        top: 0 !important;
        width: 50pt !important;
        font-size: 10pt !important;
        font-weight: normal !important;
        color: #2c2c2c !important;
        text-align: left !important;
    }
    
    .entry-card .meta-custom-field[data-field="colheita"] small,
    .entry-card .meta-custom-field[data-field="colheita"] br {
        display: none !important;
    }
    
    /* PREÇO - COLUNA DIREITA */
    .entry-card .meta-custom-field[data-field="preco"] {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        width: 80pt !important;
        font-size: 10pt !important;
        font-weight: normal !important;
        color: #2c2c2c !important;
        text-align: right !important;
    }
    
    /* NOME DO VINHO */
    .entry-card .meta-custom-field[data-field="nome"] {
        display: block !important;
        font-size: 10.5pt !important;
        font-weight: normal !important;
        color: #2c2c2c !important;
        margin: 0 90pt 5pt 0 !important;
        padding: 0 !important;
        line-height: 1.3 !important;
    }
    
    /* INFORMAÇÕES TÉCNICAS */
    .entry-card .meta-custom-field[data-field="tipo"],
    .entry-card .meta-custom-field[data-field="pais_de_origem"],
    .entry-card .meta-custom-field[data-field="regiao"] {
        display: block !important;
        font-size: 8.5pt !important;
        color: #555 !important;
        margin: 0 90pt 2pt 0 !important;
        padding: 0 !important;
        line-height: 1.5 !important;
    }
    
    /* LABELS EM NEGRITO */
    .entry-card .meta-custom-field small {
        display: inline !important;
        font-size: 8.5pt !important;
        font-weight: bold !important;
        color: #2c2c2c !important;
        text-transform: uppercase !important;
    }
    
    .entry-card .meta-custom-field small::after {
        content: ":" !important;
        margin-right: 4pt !important;
    }
    
    /* REMOVER <BR> */
    .entry-card .meta-custom-field br {
        display: none !important;
    }
    
    /* CLEARFIX */
    .entry-card::after {
        content: "" !important;
        display: block !important;
        clear: both !important;
        height: 2pt !important;
    }
    
    /* LINKS */
    a {
        color: inherit !important;
        text-decoration: none !important;
    }
    
    a[href]::after {
        content: none !important;
    }
    
    /* QUEBRAS DE PÁGINA - 7 VINHOS FIXOS POR PÁGINA */
    .entry-card:nth-child(7n) {
        clear: both !important;
        page-break-after: auto !important;
        break-after: page !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* GARANTIR ESPAÇO NO TOPO APÓS QUEBRA */
    .entry-card:nth-child(7n+1) {
        margin-top: 25mm !important;
        padding-top: 0 !important;
    }
    .entry-card:nth-child(1) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* EVITAR QUEBRAS INDESEJADAS */
    .entry-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    .hero-section {
        page-break-after: avoid !important;
        orphans: 3 !important;
        widows: 3 !important;
    }
    
    /* PRIMEIRA PÁGINA - MARGEM TOP EXTRA */
    .hero-section:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* RODAPÉ */
    @page {
        @bottom-right {
            content: "iva incluído à taxa em vigor";
            font-size: 7pt;
            color: #999;
            font-style: italic;
        }
    }
    
    body::after {
        content: "iva incluído à taxa em vigor";
        position: fixed;
        bottom: 8mm;
        right: 35mm;
        font-size: 7pt;
        color: #999;
        font-style: italic;
    }
}