/* Estilos responsivos para diferentes tamanhos de tela */

/* Tablet - landscape */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .pharmacy-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablet - portrait */
@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .search-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-highlight,
    .btn-location {
        width: 100%;
        max-width: 300px;
    }
    
    .pharmacy-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .period-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 480px) {
    header {
        padding: var(--spacing-md) 0;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    header .subtitle {
        font-size: 12px;
    }
    
    header .current-datetime {
        font-size: 12px;
    }
    
    .search-section {
        padding: var(--spacing-lg);
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-highlight,
    .btn-location {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .pharmacy-card {
        padding: var(--spacing-md);
    }
    
    .pharmacy-card h3 {
        font-size: 16px;
    }
    
    .pharmacy-card .address,
    .pharmacy-card .phone {
        font-size: 14px;
    }
    
    .pharmacy-card .actions {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .btn-map,
    .btn-call {
        width: 100%;
        padding: 10px;
    }
    
    /* Modal responsivo */
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-body {
        padding: var(--spacing-md);
    }
    
    /* Botão SAMU fixo - mobile */
    .samu-button-fixed {
        width: 60px;
        height: 60px;
        bottom: 80px;
        right: 15px;
    }
    
    .samu-icon {
        font-size: 18px;
    }
    
    .samu-text {
        font-size: 9px;
    }
    
    /* Footer mobile - layout vertical */
    footer {
        padding: var(--spacing-lg) 0;
    }
    
    .footer-line {
        display: block;
        text-align: center;
        margin-bottom: 8px;
        font-size: 12px;
        line-height: 1.4;
    }
    
    .footer-line:last-child {
        margin-bottom: 0;
    }
    
    /* Linha de copyright com versão */
    .footer-copyright {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .copyright-text {
        white-space: nowrap;
    }
    
    .version-info {
        background-color: var(--primary-color);
        color: white;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: bold;
        white-space: nowrap;
    }
    
    /* Decreto */
    .footer-decree {
        font-weight: 500;
        color: #666;
    }
    
    /* Documento oficial */
    .footer-document {
        color: #666;
    }
    
    .document-link {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
    }
    
    .document-link:hover {
        text-decoration: underline;
    }
    
    /* Emergência */
    .footer-emergency {
        color: #666;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .emergency-text {
        white-space: nowrap;
    }
    
    /* Contato */
    .footer-contact {
        margin-top: 4px;
    }
    
    /* Links do footer mobile - evitar quebra */
    footer .samu-link,
    footer .feedback-link {
        white-space: nowrap;
        display: inline-block;
        margin: 0 2px;
    }
}

/* Mobile pequeno */
@media (max-width: 360px) {
    header h1 {
        font-size: 18px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .search-section {
        padding: var(--spacing-md);
    }
    
    .pharmacy-card {
        padding: var(--spacing-sm);
    }
    
    /* Footer extra pequeno */
    .footer-line {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .version-info {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    footer .samu-link,
    footer .feedback-link {
        font-size: 11px;
        padding: 2px 4px;
    }
}

/* Orientação landscape em mobile */
@media (max-height: 600px) and (orientation: landscape) {
    header {
        padding: var(--spacing-sm) 0;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .search-section {
        padding: var(--spacing-md);
    }
    
    .samu-button-fixed {
        width: 50px;
        height: 50px;
    }
}

/* Print */
@media print {
    header {
        background-color: transparent;
        color: var(--text-color);
        box-shadow: none;
        border-bottom: 2px solid var(--primary-color);
    }
    
    header h1,
    header .subtitle,
    header .source-info {
        color: var(--text-color);
    }
    
    .search-section,
    .samu-button-fixed,
    footer {
        display: none;
    }
    
    .pharmacy-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .btn-map,
    .btn-call {
        display: none;
    }
    
    .pharmacy-card .actions {
        display: none;
    }
    
    a {
        text-decoration: none;
        color: var(--text-color);
    }
}

/* Acessibilidade - Alto contraste */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1a5d1f;
        --text-color: #000;
        --bg-color: #fff;
        --border-color: #000;
    }
    
    .pharmacy-card {
        border-width: 2px;
    }
}

/* Acessibilidade - Reduzir movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .samu-button-fixed {
        animation: none;
    }
}