/* === CAMPO DE BUSCA === */
.campo-de-busca {
    position: relative;
    flex: 1;
    display: flex;
    width: 100%;
    margin-bottom: 10px;
    float: right;
}
.campo-de-busca input[type='text'] {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}
.campo-de-busca input[type="text"]:focus {
  outline: none;
  border: 1px solid #bbb;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2) !important;
}

.campo-de-busca::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.29 14.29l4.7 4.7a1 1 0 001.41-1.41l-4.7-4.7A8 8 0 0010 2zm0 2a6 6 0 110 12A6 6 0 0110 4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* === LISTAGEM DE PRODUTOS === */
.woo-produto-listagem {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Padrão: 1 coluna (mobile) */
.woo-produto-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

/* Tablet: 2 colunas */
/* === AJUSTE UNIVERSAL PARA TABLETS (modo retrato ou paisagem) === */
@media (min-width: 501px) and (max-width: 1023px) {
  .woo-produto-card {
    width: calc(50% - 8px) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    min-height: 280px !important;
  }

  .product-thumb {
    width: 160px !important;
    height: 160px !important;
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    object-position: center;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
  }

  .produto-info {
    align-items: center !important;
    text-align: center !important;
    width: 100%;
  }

  .produto-info a,
  .produto-preco {
    text-align: center !important;
  }

  .qty-wrapper {
    margin-left: 0 !important;
  }

  .woo-subtotal {
    margin-left: 0 !important;
    margin-top: 10px !important;
    text-align: center !important;
  }
}

/* Desktop: 4 colunas */
@media (min-width: 1024px) {
  .woo-produto-card {
    width: calc(25% - 12px);
    min-height: 280px; /* altura mínima fixa */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-align: left; /* alinha título, SKU e preço à esquerda */
    overflow: hidden;
  }

  .product-thumb {
    width: 180px;
    height: 180px;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain; /* centraliza e limita imagem */
    object-position: center;
    flex-shrink: 0;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }

  .produto-info {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: left;
    overflow: hidden;
    gap: 4px;
  }

  .produto-info a {
    font-size: 11px;
    text-align: center !important;
    display: block;
    width: 100%;
    color: #54595f !important;
  }
  .produto-info a:hover {
    color: #000 !important;
  }

  .produto-preco {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-top: 4px;
  }
  .woo-subtotal {
    margin-top: 10px;
  }
}

.produto-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.produto-info a {
    font-size: 12px;
    font-weight: 500;
    font-family: 'Montserrat';
    text-decoration: none;
    color: #333;
}
.produto-preco {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-top: 5px;
}

/* === QUANTIDADE & SUBTOTAL === */
.qty-wrapper {
    display: flex;
    align-items: stretch;
    height: 40px;
    border-radius: 10px;
    background-color: #fff;
    overflow: hidden;
    border: 1px solid #ddd;
    margin-top: 10px;
}
.qty-wrapper .qty-minus,
.qty-wrapper .qty-plus {
    width: 40px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}
.qty-wrapper .qty-minus {
    background: #fff;
    color: #ccc;
    cursor: default;
    margin-top: -3px;
}
.qty-wrapper .qty-plus {
    background: #000;
    color: #ffff00;
    font-size: 22px;
    cursor: pointer;
    margin-top: -3px;
    transition: background 0.2s ease;
}
.qty-wrapper .qty-minus:hover {
    background: #f3f3f3 !important;
    color: #000 !important;
}
.qty-wrapper .qty-plus:hover {
    background: #222;
}
.qty-wrapper .b2bking_quantity_input {
    width: 70px;
    height: 100%;
    border: none;
    background: #fff;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: textfield;
    box-sizing: border-box;
}
.qty-wrapper .b2bking_quantity_input::-webkit-inner-spin-button,
.qty-wrapper .b2bking_quantity_input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.woo-subtotal {
    min-width: 80px;
    text-align: center;
    font-weight: bold;
    color: #444;
}

/* === SPINNER DE CARREGAMENTO === */
.woo-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.woo-loading-spinner .spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #ccc;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.woo-loading-spinner .loading-text {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === SKELETON LOADING === */
/* Skeleton responsivo - mesmo comportamento dos cards de produto */
#woo-loading-skeleton {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 12px;
  background: #f6f7f8;
  border-radius: 12px;
  animation: pulse 1.4s infinite ease-in-out;
  width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Tablet: 2 colunas */
@media (min-width: 501px) {
  .skeleton-card {
    width: calc(50% - 8px);
  }
}

/* Desktop: 4 colunas */
@media (min-width: 1024px) {
  .skeleton-card {
    width: calc(25% - 12px);
    min-height: 380px !important; /* altura mínima fixa */
  }
}

.skeleton-image {
  width: 160px;
  height: 160px;
  background: #e0e0e0;
  border-radius: 8px;
}

/* Bloco de texto (título, SKU, preço) */
.skeleton-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.skeleton-line {
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
}

.skeleton-title {
  width: 80%;
}
.skeleton-sku {
  width: 60%;
}
.skeleton-price {
  width: 40%;
}

/* Quantidade e subtotal */
.skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 60%;
  gap: 8px;
  margin-top: 12px;
}

.skeleton-qty {
  flex: 1;
  height: 40px;
  background: #e0e0e0;
  border-radius: 10px;
}

.skeleton-subtotal {
  width: 80px;
  height: 16px;
  background: #e0e0e0;
  border-radius: 6px;
}

/* Animação */
@keyframes pulse {
  0%, 100% {
    background-color: #eee;
  }
  50% {
    background-color: #ddd;
  }
}

/* === SKELETON MOBILE (≤767px) === */
@media (max-width: 767px) {
  .skeleton-card {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    min-height: 200px;
    background: #f6f7f8;
    border-radius: 12px;
    animation: pulse 1.4s infinite ease-in-out;
    align-items: flex-start;
    justify-content: space-between;
  }

  .skeleton-image {
    width: 130px;
    height: 130px;
    background: #e0e0e0;
    border-radius: 8px;
    flex-shrink: 0;
  }

   .skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start !important; /* força alinhamento à esquerda */
    text-align: left !important;        /* força alinhamento de texto à esquerda */
    gap: 4px;
    height: 100%;
    position: relative;
  }

  .skeleton-title,
  .skeleton-sku,
  .skeleton-price {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    margin: 0;
    padding: 0;
    text-align: left !important;  /* força texto à esquerda */
    align-self: flex-start !important; /* impede centralização individual */
  }

  .skeleton-title {
    width: 90%;
  }

  .skeleton-sku {
    width: 60%;
  }

  .skeleton-price {
    width: 40%;
  }
    
      .skeleton-footer {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 100px;
      height: 36px;
      background: #e0e0e0;
      border-radius: 10px;
    }
}



/* === DESKTOP: ocultar subtotal no skeleton === */
@media (min-width: 1024px) {
  .skeleton-subtotal {
    display: none !important;
  }
}

/* === BADGE PROMO === */
.custom-badge-promo {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #e63946;
    color: #fff;
    padding: 3px 8px;
    font-weight: bold;
    font-size: 11px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: max-content;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* === RESPONSIVO === */
@media (max-width: 500px) {
   .woo-pedido-personalizado-filtros {
    display: none !important;
  }

  #woo-filtro-categoria {
    flex: 0 0 35%;
    max-width: 35%;
    padding: 5px;
    margin-bottom: 10px;
    text-align: center;
    text-align-last: center; /* Para suportar Firefox e Edge */
    font-size: 14px;
    font-weight: 400;
    color: #000;
    border-radius: 8px;
    height: 44px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    appearance: none;
  }

  .campo-de-busca {
    flex: 1 1 auto;
    max-width: 100%;
    box-sizing: border-box;
  }

  .campo-de-busca input[type="text"] {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    height: 44px;
  }
  
  .campo-de-busca::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.29 14.29l4.7 4.7a1 1 0 001.41-1.41l-4.7-4.7A8 8 0 0010 2zm0 2a6 6 0 110 12A6 6 0 0110 4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
  }

    .woo-produto-card {
        min-height: 160px; /* uniformiza a altura dos cards */
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px;
        gap: 8px;
        text-align: left !important;
      }

  .product-thumb {
        width: 140px;
        height: 140px;
        max-width: 140px;
        max-height: 140px;
        object-fit: contain;
        object-position: center;
        flex-shrink: 0;
        background-color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px; /* opcional, centraliza imagens menores */
      }


    .woo-produto-listagem {
        margin-top: -10px;
    }
    .produto-info {
        min-height: 85px; /* ajustável conforme seu layout */
        align-items: flex-start !important; /* alinha blocos à esquerda */
        text-align: left !important;        /* alinha texto à esquerda */
    }
    .produto-info a{
        font-size: 12px;
    }
   .produto-info a,
   .produto-preco {
        text-align: left !important;        /* força os elementos a seguirem a esquerda */
    }
    .qty-wrapper {
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        margin-left: 150px;
    }
    .woo-subtotal {
        text-align: left;
        margin-top: -40px;
        margin-left: 10px;
    }
    
}
@media (min-width: 1024px) {
    .woo-pedido-personalizado-wrapper {
        display: flex;
        gap: 30px;
        align-items: flex-start;
    }
    .woo-pedido-personalizado-filtros {
    display: none !important;
}

.woo-pedido-personalizado-produtos {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}
    .filtro-desktop {
        display: block;
        list-style: none;
        padding: 0;
    }
    .filtro-desktop li {
        cursor: pointer;
        padding: 8px 12px;
        border: 1px solid #ddd;
        margin-bottom: 5px;
        background: #fff;
        border-radius: 4px;
    }
    .filtro-desktop li:hover {
        background: #f0f0f0;
    }
}
@media (max-width: 1023px) {
    .woo-pedido-personalizado-wrapper {
        display: block !important;
    }
    .woo-pedido-personalizado-filtros {
    display: none !important;
        
    }

    .filtro-mobile {
        display: block !important;
        flex: 1;
        border: 1px solid #ccc;
        padding: 10px;
        border-radius: 8px;
        font-size: 16px;
    }
    .filtro-desktop {
        display: none !important;
    }
}

/* === CATEGORIAS DESKTOP === */
@media (min-width: 880px) {
    #woo-filtro-categoria.filtro-mobile {
        display: none !important;
    }
}
.filtro-categorias-lista {
    display: flex;
    flex-direction: column;
    gap: 3px;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}
.filtro-categorias-lista li {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    color: #000;
    transition: all 0.25s ease;
}
.filtro-categorias-lista li:hover {
    background: #f2f2f2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.filtro-categorias-lista li.ativo {
    background: #f2f2f2;
    border-color: #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.filtro-categorias-lista li:first-child {
    text-transform: uppercase;
}
.filtro-categorias-lista.filtro-desktop li {
    position: relative;
    padding-right: 30px;
}
.filtro-categorias-lista.filtro-desktop li::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg fill='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}
