/* WooCommerce Custom Order - Estilos */

.quantity-selector input,
.custom-order-button-container input[type="number"],
input.qty {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}



/* Ocultar preços */
.price-hidden {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

/* Botão adicionar ao pedido */
.add-to-order {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    transition: all 0.3s ease;
}

.add-to-order:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px);
}

.add-to-order:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
    transform: none;
}

/* Container do botão personalizado */
.custom-order-button-container {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 0px;
   
}

.simple-product-button {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-selector label {
    font-weight: 600;
    color: #555;
    margin: 0;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.order-button-info {
    margin-top: 10px;
}

.order-info-text {
    margin: 0;
    color: #666;
}

/* Contador de pedidos flutuante */
.custom-order-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #eed46f;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.custom-order-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.counter-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.counter-icon {
    font-size: 1.2em;
}

.counter-number {
    background: #abc5d0;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

/* Menu item contador */
.menu-item-custom-order .order-count {
    background: #abc5d0;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Botões na página da loja */
.add-to-order-loop {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    font-size: 0.9em;
    padding: 8px 16px;
}

.add-to-order-loop:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Mensagens de feedback */
.order-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
}

.order-message {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.order-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.order-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.order-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ocultar elementos do WooCommerce padrão */
.woocommerce .single_add_to_cart_button:not(.add-to-order) {
    display: none !important;
}

.woocommerce-loop-product__link .button:not(.add-to-order-loop) {
    display: none !important;
}

/* Responsivo */
@media (max-width: 768px) {
    .custom-order-counter {
        bottom: 15px;
        right: 15px;
    }
    
    .counter-link {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .counter-text {
        display: none;
    }
    
    .simple-product-button {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quantity-selector {
        justify-content: center;
    }
    
    .order-messages {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .custom-order-button-container {
        padding: 5px;
        margin: 10px 0;
    }
    
    .add-to-order {
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }
}

/* ===== Meus Pedidos — mobile (cards + Remover abaixo da qty) ===== */
@media (max-width: 768px){

  /* --- Botão nos produtos (fora da tabela) --- */
  .custom-order-button-container,
  .my-custom-order-button,
  .product .summary .custom-order-button-container{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    padding:12px;
  }
  .custom-order-button-container .quantity,
  .custom-order-button-container input[type="number"],
  .custom-order-button-container .qty{
    width:100% !important; max-width:100%; height:44px; font-size:16px;
  }
  .add-to-order,
  .custom-order-button-container .add-to-order,
  .my-custom-order-button .add-to-order{
    width:100%; padding:14px 16px; font-size:16px; line-height:1.2; border-radius:10px;
  }
  .products .product img, .product .images img{ max-width:100%; height:auto; }

  /* --- Tabela "Itens do Pedido" como cards --- */
  .order-items-table thead{ display:none !important; }

  .order-items-table tbody tr{
    display:block !important;
    padding:14px 10px;
    border-bottom:1px solid #eee;
  }

  /* cada célula ocupa a largura toda */
  .order-items-table td,
  .order-items-table th{
    display:block !important;
    width:100% !important;
    border:0 !important;
  }

  /* produto: thumb + título lado a lado */
  .order-items-table td.product-info{
    display:grid !important;
    grid-template-columns:80px 1fr;
    gap:12px;
    align-items:center;
    margin-bottom:10px;
  }
  .order-items-table .product-thumbnail img{
    width:80px; height:auto; display:block; border-radius:8px;
  }
  .order-items-table .product-details h4{
    font-size:1rem; line-height:1.25; margin:0; word-break:break-word;
  }

  /* quantidade */
  .order-items-table td.quantity{ margin-bottom:8px; }
  .order-items-table td.quantity input[type="number"],
  .order-items-table .quantity-input{
    width:100% !important; max-width:100%; height:46px; font-size:16px;
  }

  /* ações (Remover) – logo abaixo da quantidade, 100% */
  .order-items-table td.actions{ margin-top:4px; }
  .order-items-table td.actions .button,
  .order-items-table td.actions .button-secondary{
    width:100%; height:44px; font-size:16px;
  }

  /* formulário */
  .custom-order-form .form-row{ margin-bottom:12px; }
  .custom-order-form .form-row input,
  .custom-order-form .form-row textarea,
  .custom-order-form .form-row select{
    width:100%; max-width:100%; height:44px; font-size:16px;
  }
  .custom-order-form .form-row textarea{ height:auto; min-height:110px; }
  .custom-order-form .form-actions .button{
    width:100%; height:46px; font-size:16px; margin:0 0 8px 0;
  }

  /* widget flutuante */
  .custom-order-counter{ right:12px !important; bottom:12px !important; transform:none !important; }
}

/* Telefones muito pequenos */
@media (max-width:360px){
  .order-items-table td.product-info{ grid-template-columns:68px 1fr; }
  .order-items-table .product-thumbnail img{ width:68px; }
}



/* === Custom layout: Endereço 70/15/15 === */
.custom-order-form .row-endereco { display:flex; gap:12px; align-items:flex-start; }
.custom-order-form .row-endereco .field-address { flex: 0 0 70%; }
.custom-order-form .row-endereco .field-number { flex: 0 0 15%; }
.custom-order-form .row-endereco .field-complement { flex: 0 0 15%; }
.custom-order-form .row-endereco input{ width:100%; }
@media (max-width: 768px){
  .custom-order-form .row-endereco { flex-direction:column; }
  .custom-order-form .row-endereco .field-address,
  .custom-order-form .row-endereco .field-number,
  .custom-order-form .row-endereco .field-complement { flex:0 0 100%; }
}

/* === Custom-order-counter: show full button with label === */
#custom-order-counter { min-width: 220px; }
#custom-order-counter .counter-link { display:flex; align-items:center; gap:10px; padding:10px 16px; }
#custom-order-counter .counter-text { display:inline-block; color:#000; font-weight:600; }
