/* responsivo.css - para telas até 1024px (celular/tablet) */

@media (max-width: 1024px) {
  /* Reset e corpo */
  body, html {
    overflow-x: hidden;
    height: 100%;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    color: #f0f4c3;
  }

  .app-container {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  /* Sidebar inicialmente oculta, com posição fixa */
  nav.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background-color: #2c5f02;
    padding: 25px 20px;
    box-shadow: 2px 0 14px rgba(0,0,0,0.7);
    transform: translateX(-110%);
    transition: transform 0.3s ease-in-out;
    z-index: 1500;
    overflow-y: auto;
  }
  nav.sidebar.active {
    transform: translateX(0);
  }

  nav.sidebar h1 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
    user-select: none;
    text-shadow: 1px 1px 2px #4a6b00;
  }

  nav.sidebar ul {
    max-height: calc(100% - 100px);
    overflow-y: auto;
    padding-right: 8px;
  }

  nav.sidebar ul li {
    margin-bottom: 16px;
  }

  nav.sidebar ul li button {
    font-size: 1.2rem;
    padding: 14px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: none;
    border: none;
    color: #cddc39;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 0 transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  nav.sidebar ul li button i {
    font-size: 1.6rem;
    min-width: 28px;
    text-align: center;
    user-select: none;
    transition: transform 0.3s ease;
  }
  nav.sidebar ul li button:hover {
    background-color: #4caf50;
    color: #fff;
    box-shadow: inset 5px 0 10px rgba(255,255,255,0.3);
  }
  nav.sidebar ul li button:hover i {
    transform: scale(1.2);
  }
  nav.sidebar ul li button.active {
    background-color: #aed581;
    color: #1b5e20;
    box-shadow: inset 5px 0 15px rgba(27,94,32,0.8);
    font-weight: 700;
  }
  nav.sidebar ul li button.active i {
    transform: scale(1.3);
  }

  /* Botão Hamburger visível no topo */
  .hamburger {
    display: flex;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1600;
    background-color: #2c5f02;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 14px #4caf50;
    transition: background-color 0.3s ease;
  }
  .hamburger:hover {
    background-color: #4caf50;
  }

  /* Conteúdo principal: ocupa toda a tela, scroll vertical */
  main.content {
    flex-grow: 1;
    background: rgba(255,255,255,0.1);
    padding: 20px 18px 80px 18px;
    margin-left: 0;
    height: 100vh;
    overflow-y: auto;
    position: relative;
  }

  /* Header fixo no topo, sombra verde */
  header.main-header {
    position: sticky;
    top: 0;
    z-index: 1400;
    font-size: 2rem;
    font-weight: 700;
    padding: 16px 18px;
    background: rgba(44, 95, 2, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(76, 175, 80, 0.7);
    user-select: none;
    color: #d4e157;
    margin-bottom: 20px;
  }

  /* Input de cidade e botão lado a lado responsivos */
  #cidade {
    width: 70%;
    padding: 12px 14px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    border: 2px solid #7cb342;
    color: #2c5f02;
    background-color: #e6f2d1;
    box-shadow: inset 2px 2px 6px rgba(124, 179, 66, 0.2);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: text;
    margin-bottom: 14px;
  }
  #cidade::placeholder {
    color: #a0af7a;
    font-style: italic;
  }
  #cidade:focus {
    border-color: #aed581;
    box-shadow: 0 0 10px #aed581;
    background-color: #f0f9e7;
  }

  #buscar {
    width: 28%;
    padding: 12px 0;
    border-radius: 12px;
    border: none;
    background: linear-gradient(90deg, #d4e157, #7cb342);
    color: #1b5e20;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 8px rgba(124, 179, 66, 0.6);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-left: 2%;
  }
  #buscar:hover {
    background-color: #aed581;
    box-shadow: 0 6px 14px rgba(174, 213, 129, 0.8);
  }
  #buscar:focus {
    outline: none;
  }

  /* Seção títulos menores para celular */
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: #d4e157;
    text-shadow: 1px 1px 2px #4a6b00;
  }

  /* Carrossel cotações: horizontal scroll com espaço e tamanho ajustado */
  .carousel-container {
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 18px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    max-width: 100%;
    margin-bottom: 30px;
    overflow-x: auto;
  }

  .carousel-track {
    display: flex;
    gap: 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .carousel-item {
    scroll-snap-align: start;
    min-width: 160px;
    max-width: 180px;
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 18px 14px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.5);
    text-align: center;
    color: #f0f4c3;
  }

  .carousel-item .price {
    font-size: 1rem;
    color: #d4e157;
    margin-top: 8px;
  }

  /* Notícias em uma coluna, cards grandes com espaçamento */
  .news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
  }

  .news-item {
    background: rgba(0,0,0,0.25);
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    font-size: 1.1rem;
  }

  .news-item a {
    color: #d4e157;
    font-weight: 700;
    text-decoration: none;
  }
  .news-item a:hover {
    text-decoration: underline;
  }

  /* Previsão do tempo - cards flexíveis e scroll horizontal */
  .previsao-cards {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .previsao-card {
    scroll-snap-align: start;
    flex: 0 0 140px;
    background: rgba(0,0,0,0.25);
    border-radius: 16px;
    padding: 14px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    color: #f0f4c3;
    text-align: center;
    user-select: none;
    font-weight: 600;
  }

  .previsao-card h4, .previsao-card div {
    margin: 8px 0;
  }

  /* Fases da Lua usando mesma estilização de cards previsão */
  #fasesLua {
    margin-top: 20px;
    margin-bottom: 30px;
  }

  /* Scrollbar estilo suave (opcional) */
  .carousel-track::-webkit-scrollbar,
  .previsao-cards::-webkit-scrollbar,
  nav.sidebar ul::-webkit-scrollbar {
    height: 8px;
  }
  .carousel-track::-webkit-scrollbar-thumb,
  .previsao-cards::-webkit-scrollbar-thumb,
  nav.sidebar ul::-webkit-scrollbar-thumb {
    background: rgba(124, 179, 66, 0.5);
    border-radius: 6px;
  }

  /* Evitar overflow horizontal no body */
  body {
    overflow-x: hidden;
  }
}
