﻿
.storefront-sticky-header{position:sticky;top:0;z-index:100;background:#fff}
.favorite-toggle.is-favorite{color:#ef4444}.favorite-toggle.is-favorite svg{fill:#ef4444;stroke:#ef4444}
:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:4px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.storefront-account-icon-link{display:flex;align-items:center;justify-content:center;color:inherit;text-decoration:none}

/* ============================================================
   MOBILE (<=767px) — catálogo
   Regras restritas ao mobile; o desktop permanece inalterado.
   ============================================================ */
@media(max-width:767px){
    html,body{max-width:100%;overflow-x:clip}
    .container{max-width:100%;padding:16px}

    /* HEADER: linha 1 = logo + ações, linha 2 = busca 100% */
    .storefront-sticky-header{position:static}
    .storefront-header-shell{position:sticky;top:0;z-index:100;box-shadow:0 2px 10px rgba(15,23,42,.06)}
    .storefront-header-main{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand actions" "search search";gap:10px 12px;padding-top:10px;padding-bottom:10px}
    .storefront-brand{grid-area:brand;max-width:100%;min-width:0}
    .storefront-header-main .storefront-brand{grid-template-columns:52px minmax(0,1fr);gap:10px}
    .storefront-brand-media{width:52px;height:52px}
    .storefront-brand-copy strong{font-size:14px;line-height:1.1;-webkit-line-clamp:2}
    .storefront-search-wrapper{grid-area:search;width:100%;min-width:0}
    .storefront-search{min-height:46px;padding:4px 6px 4px 14px;gap:8px}
    .storefront-search input{font-size:14px}
    .storefront-search button{width:40px;height:40px}
    .storefront-header-actions{grid-area:actions;justify-self:end;gap:6px;flex-wrap:nowrap}
    .storefront-header-actions .storefront-support,
    .storefront-header-actions .storefront-business-card,
    .storefront-header-actions .storefront-action-link{display:none}
    .storefront-header-actions .storefront-header-socials{display:none!important}
    .storefront-header-actions .storefront-header-copy{display:none!important}
    .storefront-header-actions .storefront-header-card{padding:0!important;gap:0!important;width:38px;height:38px;justify-content:center}
    .storefront-header-actions .storefront-cart-card{width:40px;height:40px}
    .storefront-account-icon-link{width:38px;height:38px}
    .storefront-header-icon{width:34px;height:34px}
    .storefront-cart-badge{min-width:18px;height:18px;font-size:10px;top:-2px;right:-2px}

    /* MENU DE CATEGORIAS: barra com scroll horizontal */
    .storefront-nav-shell{display:block}
    .storefront-nav-row{padding-top:8px;padding-bottom:8px;gap:0;flex-direction:column;align-items:stretch}
    .storefront-mega-menu{display:block}
    .storefront-mega-menu summary{padding:10px 0;font-size:14px;min-height:40px}
    .storefront-mega-panel{top:calc(100% + 6px);max-height:60vh}
    .storefront-main-nav{display:flex;flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;gap:18px;padding:2px 0 12px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
    .storefront-main-nav::-webkit-scrollbar{display:none}
    .storefront-main-nav a{font-size:13px;flex:0 0 auto;padding:8px 0;display:inline-block}

    /* HERO + ATENDIMENTO empilhados, sem altura fixa */
    .hero{padding:28px 0!important}
    .hero-grid{grid-template-columns:1fr;gap:16px}
    .hero-panel{padding:18px}
    .storefront-hero .actions{flex-wrap:wrap;gap:10px}
    .storefront-hero .actions .btn{min-height:42px;display:inline-flex;align-items:center;justify-content:center}

    /* TOOLBAR Produtos / Filtros */
    .catalog-toolbar{flex-direction:column;align-items:stretch!important}
    .catalog-toolbar-controls{width:100%;flex-wrap:wrap;gap:8px}
    .catalog-toolbar-controls select{flex:1;min-width:0;min-height:42px;font-size:14px}
    .catalog-toolbar-controls .btn{min-height:42px;display:inline-flex;align-items:center;justify-content:center;padding:8px 14px}

    /* GRADE DE PRODUTOS: 2 colunas (vence o inline do PHP) */
    .catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
    .catalog-grid .product-card--carousel{min-width:0;flex:1 1 auto}
    .grid-4,.grid-5,.grid-6,.grid-8{grid-template-columns:repeat(auto-fill,minmax(var(--product-card-min-width,190px),1fr));gap:12px}
    .grid-3{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
    .grid-2{grid-template-columns:1fr}

    /* CARDS DE PRODUTO */
    .product-body{padding:10px 12px 12px;gap:6px}
    .product-card__cat{font-size:11px}
    .product-card__brand{font-size:11px}
    .product-card__title{font-size:14px;-webkit-line-clamp:2;min-height:2.7em}
    .product-card__desc{display:none}
    .product-card__price{gap:6px}
    .product-card .price{font-size:18px;line-height:1.1;white-space:nowrap}
    .product-card__price-old{font-size:12px}
    .product-card__stockout{font-size:11px}
    .favorite-toggle{width:38px!important;height:38px!important}
    .product-card__footer{padding:0 12px 12px}
    .product-card__footer .btn{min-height:40px;font-size:13px}
    .product-card-compact .product-media{aspect-ratio:1/1}

    .section-title{font-size:20px}
    .brand-carousel__title{font-size:20px}

    /* MARCAS: ~3 cards visíveis, dimensão uniforme, logo/nome centralizados */
    .brand-carousel__item{width:clamp(96px,28vw,125px);padding:12px 10px}
    .brand-carousel__media{height:48px}
    .brand-carousel__logo{max-height:44px}

    /* DESTAQUES RECENTES: cards com largura mínima confortável */
    .brand-carousel__track .product-card{width:160px}

    /* VER CATÁLOGO COMPLETO: centralizado com respiro */
    #produtos > .actions{margin-top:24px!important;margin-bottom:8px}
    #produtos > .actions .btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:10px 22px}

    /* FOOTER empilhado */
    .storefront-footer .container{padding:28px 16px}
    .storefront-footer form{flex-direction:column;width:100%;min-width:0}
    .storefront-footer form input{width:100%;min-width:0}
    .storefront-footer form .btn{width:100%;min-height:40px}

    /* WHATSAPP flutuante (safe-area) */
    .catalog-whatsapp-fab{bottom:max(16px,env(safe-area-inset-bottom))!important}
    .catalog-whatsapp-fab--right{right:max(16px,env(safe-area-inset-right))!important}
    .catalog-whatsapp-fab--left{left:max(16px,env(safe-area-inset-left))!important}
    body:has(.mobile-bar--visible) .catalog-whatsapp-fab{bottom:calc(84px + env(safe-area-inset-bottom))!important}
}
@media(max-width:430px){
    .storefront-header-main .storefront-brand{grid-template-columns:44px minmax(0,1fr);gap:8px}
    .storefront-brand-media{width:44px;height:44px}
    .storefront-brand-copy strong{font-size:13px}
    .storefront-header-actions{gap:4px}
    .grid-2,.grid-3,.grid-4,.grid-5,.grid-6,.grid-8{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .brand-carousel__item{width:clamp(88px,29vw,110px);padding:10px 8px}
    .brand-carousel__track .product-card{width:150px}
    .product-card__title{font-size:13px;-webkit-line-clamp:2}
    .price{font-size:18px}
    .product-body{padding:10px 10px 8px;gap:6px}
    .product-card__footer{padding:0 10px 10px}
    .btn-small{padding:6px 10px;min-height:40px}
}
@media(max-width:319px){
    .catalog-grid{grid-template-columns:1fr!important}
}
/* PAGINAÇÃO: manter botões usáveis no mobile */
@media(max-width:600px){
    .catalog-pagination>*:not(.catalog-pagination__mobile){display:inline-flex!important}
    .catalog-pagination .catalog-pagination__mobile{display:none!important}
    .catalog-pagination{gap:6px}
    .catalog-pagination .btn{min-height:40px;padding:8px 12px;font-size:13px;white-space:nowrap}
}
@media(max-width:767px){
    /* ============ ADMIN: MENU DRAWER + ACCORDION ============ */
    body .topbar-admin .container{min-height:56px;padding:8px 16px}
    .admin-hamburger{display:flex!important;flex-direction:column;justify-content:center;align-items:center;gap:4px;width:44px;height:44px;cursor:pointer;padding:0;background:none;border:0;border-radius:10px}
    .admin-hamburger span{display:block;width:22px;height:2px;background:#fff;border-radius:2px}
    body .admin-nav-backdrop{display:block;position:fixed;inset:0;background:rgba(2,6,23,.55);z-index:9998;opacity:0;visibility:hidden;transition:opacity .22s ease}
    body.nav-open .admin-nav-backdrop{opacity:1;visibility:visible}
    body.nav-open{overflow:hidden}
    body .topbar-admin .nav{position:fixed;top:0;left:0;bottom:0;width:min(85vw,320px);height:100dvh;transform:translateX(-100%);transition:transform .22s ease;z-index:9999;display:flex;flex-direction:column;align-items:stretch;gap:0;margin:0;padding:12px;overflow-y:auto;-webkit-overflow-scrolling:touch;background:linear-gradient(180deg,#0f172a 0%,#173a63 100%);box-shadow:12px 0 40px rgba(0,0,0,.4);box-sizing:border-box}
    body .topbar-admin .nav.is-open{transform:translateX(0)}
    body .admin-nav-close{display:flex!important;align-items:center;justify-content:center;align-self:flex-end;width:44px;height:44px;margin-bottom:8px;background:rgba(255,255,255,.08);border:0;border-radius:10px;color:#fff;font-size:24px;line-height:1;cursor:pointer;flex:0 0 auto}
    body .topbar-admin .nav > a,
    body .topbar-admin .nav .nav-group{color:#fff;font-size:15px;font-weight:600;text-decoration:none;border-radius:10px;white-space:normal;min-height:46px;display:flex;align-items:center;padding:0 12px;margin:0;border-bottom:1px solid rgba(255,255,255,.12);cursor:pointer;position:static}
    body .topbar-admin .nav .nav-group{justify-content:space-between}
    body .topbar-admin .nav .nav-group:after{content:'\25BE';color:#7dd3fc;font-size:12px;transition:transform .15s}
    body .topbar-admin .nav .nav-group.is-open:after{transform:rotate(180deg)}
    body .topbar-admin .nav .nav-dropdown{display:none;position:static;transform:none;inset:auto;width:100%;min-width:0;background:transparent;border:0;box-shadow:none;padding:0 0 6px 12px;border-radius:0}
    body .topbar-admin .nav .nav-group:hover .nav-dropdown,
    body .topbar-admin .nav .nav-group:focus-within .nav-dropdown{display:none}
    body .topbar-admin .nav .nav-group.is-open .nav-dropdown{display:block}
    body .topbar-admin .nav .nav-dropdown a{display:flex;align-items:center;color:#cbd5e1;font-size:14px;padding:11px 12px;min-height:44px;border-radius:10px;border-bottom:1px solid rgba(255,255,255,.08);text-decoration:none}
    body .topbar-admin .nav .nav-dropdown a:hover{background:rgba(255,255,255,.1);color:#fff}

    /* ============ ADMIN: CONTAINERS / CARDS / FORMS ============ */
    body .crud-card,body .settings-card,body .logx-card,body .intx-card,body .dash-kpi{width:100%;max-width:100%;min-width:0}
    body .crud-page input[type=text],body .crud-page input[type=search],body .crud-page input[type=date],body .crud-page select,body .crud-page textarea,
    body .settings-content input:not([type=checkbox]):not([type=radio]):not([type=color]),
    body .settings-content select,body .settings-content textarea{max-width:100%}
    .form-grid{grid-template-columns:1fr!important}
    body .crud-page .field{width:100%;max-width:100%}
    body .crud-page-header .btn{min-height:44px}

    /* ============ ADMIN: DASHBOARDS ============ */
    body .dash-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    body .dash-actions .btn{width:100%;min-height:44px}
    body .dash-cards{grid-template-columns:1fr}

    /* ============ ADMIN: CLIENTES (mantem tabela) ============ */
    body .clients-page .crud-table{min-width:720px!important}
    body .clients-page .crud-table th,
    body .clients-page .crud-table td{padding:8px 10px;font-size:12.5px}
    body .clients-page .crud-table td:first-child{white-space:normal;min-width:180px;overflow-wrap:anywhere}
    body .clients-page .crud-table th:nth-child(2),
    body .clients-page .crud-table th:nth-child(3),
    body .clients-page .crud-table td:nth-child(2),
    body .clients-page .crud-table td:nth-child(3){text-align:center}

    /* ============ ADMIN: LOGS EM CARDS ============ */
    body .logx-table thead{display:none}
    body .logx-table,body .logx-table tbody,body .logx-table tr,body .logx-table td{display:block;width:100%;box-sizing:border-box}
    body .logx-table{min-width:0}
    body .logx-table tbody tr{background:#fff;border:1px solid #e8eef7;border-radius:14px;padding:12px 14px;margin-bottom:10px;box-shadow:0 2px 8px rgba(15,23,42,.04)}
    body .logx-table tbody td{border:0;padding:5px 0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;white-space:normal;text-align:right}
    body .logx-table tbody td:before{content:attr(data-label);font-size:11px;font-weight:700;color:#94a3b8;text-transform:uppercase;letter-spacing:.03em;flex-shrink:0;text-align:left}
    body .logx-table tbody td.logx-cell-detail{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:left;white-space:normal;max-width:none;font-size:13px}
    body .logx-table tbody td.logx-cell-detail:before{display:block}
    body .logx-table tbody td:last-child{justify-content:flex-end}
    body .logx-table tbody td:last-child:before{content:''}
    body .logx-table tbody td .logx-ver{min-height:40px;padding:8px 16px}

    /* ============ ADMIN: INTEGRACAO ERP ============ */
    body .intx-token-row{flex-direction:column;align-items:stretch}
    body .intx-token-row .intx-field{min-width:0;width:100%}
    body .intx-token-row .btn{min-height:44px}
    body .intx-endpoint-code{min-width:0}

    /* ============ ADMIN: MODAIS ============ */
    body .logx-modal-panel{width:calc(100vw - 24px);max-width:none;max-height:calc(100dvh - 24px);border-radius:16px;top:12px;bottom:12px;right:12px}

    /* ============ TABELAS (escopo admin) ============ */
    .table{display:block;overflow-x:auto}
    body .crud-table th,body .crud-table td,body .logx-table th,body .intx-table th,body .intx-table td{white-space:nowrap}
    body .dash-table th,body .dash-table td{white-space:normal}
}
@media(max-width:360px){
    body .dash-actions{grid-template-columns:1fr}
    body .dash-kpis{grid-template-columns:1fr}
}
