/**
 * Responsive CSS - Dandra
 */

@media (max-width: 950px) {
    .header-row {
        grid-template-columns: auto 1fr auto;
        gap: 15px;
    }

    .nav-row {
        overflow-x: auto;
        white-space: nowrap;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .benefit-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .benefit:nth-child(2) {
        border-right: 0;
    }

    .benefit:nth-child(-n+2) {
        border-bottom: 1px solid var(--line);
    }

    .product-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    body {
        padding-bottom: 70px;
    }

    .admin-bar .header {
        top: 0;
    }

    .topbar .container {
        justify-content: center;
        font-size: 0.74rem;
    }

    .toplinks {
        display: none;
    }

    .header-row {
        min-height: 64px;
        grid-template-columns: auto 1fr auto;
        gap: 11px;
    }

    .brand {
        font-size: 1.08rem;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

        /* Busca funcional no mobile */
    .header-search {
        min-width: 0;
    }

    .header-search .search {
        height: 42px;
        width: 100%;
        padding-inline: 4px 4px;
        justify-content: stretch;
    }

    .header-search .search input[type="search"],
    .header-search .search input[type="text"] {
        display: block;
        width: 100%;
        min-width: 0;
        flex: 1;
    }

    /* Mobile exibe apenas: LOGO + BUSCA + HAMBÚRGUER */
    .header-actions {
        gap: 6px;
    }

    .header-actions .action {
        display: none;
    }

    .header-actions .action.menu-toggle {
        display: grid;
        width: 40px;
        height: 40px;
    }

    .nav {
        display: none;
    }

    .hero {
        padding-top: 16px;
    }

    .slider,
    .slide {
        min-height: auto;
    }

    .slide {
        grid-template-columns: 1fr;
    }

    .slide-copy {
        padding: 38px 25px 26px;
    }

    .slide-art {
        min-height: 225px;
    }

    .slider-controls {
        right: 14px;
        bottom: 13px;
    }

    section {
        padding: 34px 0;
    }

    .section-head {
        align-items: center;
        margin-bottom: 16px;
    }

    .section-head p {
        display: none;
    }

    .benefit-grid {
        grid-template-columns: 1fr 1fr;
    }

    .benefit {
        min-height: 88px;
        padding: 12px;
        gap: 9px;
    }

    .benefit-icon {
        width: 34px;
        height: 34px;
    }

    .benefit b {
        font-size: 0.76rem;
    }

    .benefit span {
        font-size: 0.67rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 11px;
    }

    .category-card {
        min-height: 140px;
    }

    .product-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 11px;
    }

    .product,
    .woocommerce ul.products li.product {
        padding: 7px;
        border-radius: 14px;
    }

    .product-info {
        padding: 10px 3px 3px;
    }

    .product h3,
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        min-height: 38px;
        margin: 5px 0 6px;
        font-size: 0.8rem;
    }

    .price {
        font-size: 1rem;
    }

    .quick-add,
    .woocommerce ul.products li.product .button {
        margin-top: 9px;
    }

    .promo-box {
        grid-template-columns: 1fr;
    }

    .promo-copy {
        padding: 30px 25px;
    }

    .promo-art {
        min-height: 160px;
    }

    .newsletter-box {
        padding: 25px;
        display: block;
    }

    .newsletter-form {
        margin-top: 20px;
        display: grid;
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px 22px;
        padding: 36px 0 28px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom-row {
        display: block;
        line-height: 1.7;
    }

    /* Menu mobile fixo */
    .mobile-nav {
        position: fixed;
        z-index: 30;
        right: 0;
        bottom: 0;
        left: 0;
        height: 66px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        border-top: 1px solid #EAD9B0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        align-content: center;
        gap: 3px;
        color: #8A857C;
        font-size: 0.68rem;
    }

    .mobile-nav a.active {
        color: var(--primary);
        font-weight: 800;
    }

    .mobile-nav svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .product-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }
}



/* ==========================================================
   BUSCA MOBILE - MODELO 6
   Header: [logo] [ícone de lupa] [hambúrguer]
   Ao clicar na lupa, a barra de pesquisa abre DESLIZANDO
   logo abaixo do header.
   ========================================================== */
.mobile-search-toggle { display: none; }
.mobile-search-panel { display: none; }

@media (max-width: 950px) {

    /* Barra de busca desktop some no mobile */
    .header-search { display: none !important; }

    /* Ícone de lupa visível no header mobile (especificidade alta p/ vencer CSS adicional) */
    .header-actions .action.mobile-search-toggle { display: inline-grid !important; width: 40px; height: 40px; padding: 0; }

    /* Painel que desliza abaixo do header */
    .mobile-search-panel {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #121212;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 12px 0 16px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
        z-index: 19;
        box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
    }

    .mobile-search-panel.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Barra de pesquisa dentro do painel */
    .mobile-search-panel .search,
    .mobile-search-panel form.woocommerce-product-search {
        height: 46px;
        display: flex;
        align-items: center;
        gap: 0;
        padding: 0 4px 0 16px;
        background: #FFFFFF;
        border: 1px solid #E7E2D9;
        border-radius: 12px;
        overflow: hidden;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .mobile-search-panel .search input[type="search"],
    .mobile-search-panel form.woocommerce-product-search input[type="search"] {
        flex: 1;
        min-width: 0;
        height: 100%;
        padding: 0;
        border: 0 !important;
        outline: 0;
        background: transparent !important;
        color: #121212 !important;
        font-size: 0.95rem;
        box-shadow: none !important;
    }

    .mobile-search-panel .search input::placeholder {
        color: #8A857C;
        opacity: 1;
    }

    .mobile-search-panel .search:focus-within {
        border-color: #C5A059;
        box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
    }

    /* Lupa do painel (sempre visível) */
    .mobile-search-panel .search .search-submit {
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        display: grid !important;
        place-items: center;
        padding: 0;
        border: 0;
        background: transparent;
        color: #6E6A63;
        cursor: pointer;
        transition: color 0.2s;
    }

    .mobile-search-panel .search .search-submit:hover { color: #C5A059; }

    .mobile-search-panel .search .search-submit svg {
        width: 20px;
        height: 20px;
        display: block;
    }
}

@media (max-width: 680px) {
    .dandra-header-logo { max-height: 32px; }
    .dandra-logo-svg svg { height: 30px; }
}


/* ==========================================================
   MODELO 6 - ALINHAMENTO DO HEADER MOBILE
   [LOGO à esquerda] ................ [🔍] [≡] à direita
   Logo não encolhe, ícones agrupados na ponta direita.
   ========================================================== */
@media (max-width: 950px) {
    .header-row {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        justify-content: space-between;
        align-items: center;
    }

    /* Logo colado à esquerda, do jeito que está */
    .header-logo {
        justify-self: start;
        min-width: 0;
        flex: none;
    }

    /* Ícones de busca e hambúrguer agrupados à direita */
    .header-actions {
        justify-self: end;
        margin-left: auto;
        flex: none;
        gap: 8px;
    }

    .header-actions .action.mobile-search-toggle,
    .header-actions .action.menu-toggle {
        display: inline-grid !important;
        width: 40px;
        height: 40px;
        padding: 0;
        flex: none;
    }
}
