/**
 * Libidi B2B - Frontend Styles
 */

/* Informações do Cliente no Dashboard */
.libidi-customer-info {
    background: rgba(34, 113, 177, 0.08);
    border: 1px solid rgba(34, 113, 177, 0.2);
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.libidi-customer-info h2 {
    margin-top: 0;
    font-size: 20px;
    color: inherit;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.libidi-customer-info p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    color: inherit;
}

.libidi-customer-info strong {
    color: inherit;
    font-weight: 600;
    opacity: 0.9;
}

/* Campos de Registro e Conta */
.libidi-b2b-account-fields {
    border: 1px solid rgba(34, 113, 177, 0.2);
    padding: 25px;
    margin: 25px 0;
    background: rgba(34, 113, 177, 0.05);
    border-radius: 6px;
}

.libidi-b2b-account-fields legend {
    font-size: 18px;
    font-weight: 600;
    padding: 0 10px;
    color: inherit;
    background: transparent;
}

/* Logomarcas */
.libidi-logomarca-protese,
.libidi-logomarca-embalagem {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

/* Estilo para produtos personalizados */
.product-marca-info {
    background: rgba(34, 113, 177, 0.08);
    border: 1px solid rgba(34, 113, 177, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.product-marca-info .marca-label {
    font-weight: 600;
    color: inherit;
    opacity: 0.85;
    display: block;
    margin-bottom: 5px;
}

.product-marca-info .marca-value {
    color: inherit;
    font-size: 16px;
}

/* Responsivo */
@media screen and (max-width: 768px) {
    .libidi-customer-info {
        padding: 15px;
    }
    
    .libidi-customer-info h2 {
        font-size: 18px;
    }
    
    .libidi-b2b-account-fields {
        padding: 15px;
    }
}

/* Formulário de Registro */
.woocommerce-form-row.libidi-field {
    margin-bottom: 20px;
}

.woocommerce-form-row.libidi-field label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.woocommerce-form-row.libidi-field input[type="text"],
.woocommerce-form-row.libidi-field input[type="tel"],
.woocommerce-form-row.libidi-field input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.woocommerce-form-row.libidi-field input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Shortcodes em Produtos */
.libidi-marca-text {
    display: inline-block;
    font-weight: 600;
    color: #2271b1;
}

.libidi-marca-highlight {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* WhatsApp Link */
a.libidi-whatsapp-link {
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
}

a.libidi-whatsapp-link:hover {
    color: #128c7e;
    text-decoration: underline;
}

/* Site/Instagram Link */
a.libidi-site-link {
    color: #2271b1;
    text-decoration: none;
}

a.libidi-site-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Badge personalizado */
.libidi-custom-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 5px 0;
}

.libidi-custom-badge.badge-success {
    background: #46b450;
}

.libidi-custom-badge.badge-warning {
    background: #ffb900;
}

.libidi-custom-badge.badge-danger {
    background: #dc3232;
}

/* ===================================
   CAMPOS DE PREÇO PERSONALIZADO (PEDIDOS) - Discreto Dark
   =================================== */

/* Container de Preço no Pedido - Ultra Compacto Inline */
.libidi-custom-price-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin: 8px 0;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 12px;
}

.libidi-price-label {
    font-weight: 500;
    opacity: 0.7;
    white-space: nowrap;
}

.price-prefix {
    opacity: 0.5;
    font-size: 11px;
}

.libidi-price-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    color: inherit;
    transition: all 0.2s ease;
}

.libidi-price-input:focus {
    border-color: rgba(129, 199, 132, 0.5);
    outline: none;
    background: rgba(0, 0, 0, 0.4);
}

.libidi-save-price-btn {
    padding: 4px 10px;
    background: rgba(129, 199, 132, 0.1);
    color: #81c784;
    border: 1px solid rgba(129, 199, 132, 0.3);
    border-radius: 3px;
    font-weight: 500;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.libidi-save-price-btn:hover {
    background: rgba(129, 199, 132, 0.2);
    border-color: rgba(129, 199, 132, 0.5);
}

.libidi-save-price-btn:active {
    transform: scale(0.96);
}

.libidi-save-price-btn.loading {
    opacity: 0.5;
    cursor: wait;
}

.libidi-price-status {
    font-size: 10px;
    font-weight: 500;
    margin-left: 6px;
}

.libidi-price-status.success {
    color: #81c784;
}

.libidi-price-status.error {
    color: #e57373;
}

/* Box de Preços na Página do Produto - Alto Contraste */
.libidi-pricing-box {
    background: rgba(25, 25, 25, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 16px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.libidi-pricing-box h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
    color: #ffffff !important;
    opacity: 1 !important;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.price-row:last-of-type {
    border-bottom: none;
}

.price-row.custom-price-row {
    background: rgba(76, 175, 80, 0.15);
    margin: 8px -12px;
    padding: 10px 12px;
    border-radius: 4px;
    border-bottom: none;
}

.price-label strong {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff !important;
    opacity: 1 !important;
}

.price-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.libidi-price-display {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff !important;
}

.libidi-price-display.custom-price {
    color: #a5d6a7 !important;
    font-size: 17px;
}

.libidi-copy-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.libidi-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.libidi-copy-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.libidi-copy-btn.copied {
    background: rgba(46, 125, 50, 0.2);
    border-color: #81c784;
    color: #81c784;
    opacity: 1;
}

/* Cálculo de Margem */
.price-calculation {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    border-left: 3px solid rgba(165, 214, 167, 0.6);
}

.margin-info {
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #ffffff !important;
}

.margin-value {
    font-size: 16px;
    font-weight: 700;
}

.margin-info.positive .margin-value {
    color: #a5d6a7 !important;
}

.margin-info.negative .margin-value {
    color: #ff8a80 !important;
}

.margin-amount {
    font-size: 12px;
    opacity: 0.95;
    color: #ffffff !important;
}

.no-custom-price {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    margin-top: 8px;
}

.no-custom-price em {
    font-style: normal;
    color: #ffffff;
    opacity: 0.75;
    font-size: 12px;
}

/* ===================================
   BOTÕES DE AÇÃO DO PRODUTO - Discreto Dark
   =================================== */

.libidi-product-actions {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 15px 0;
}

.libidi-product-actions h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.75;
    border: none;
    color: rgba(255, 255, 255, 0.85);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.libidi-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.libidi-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.95);
}

.libidi-action-btn:active {
    transform: scale(0.98);
}

.libidi-action-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.libidi-action-btn.copied {
    background: rgba(46, 125, 50, 0.15);
    border-color: rgba(129, 199, 132, 0.4);
    color: #81c784;
    opacity: 1;
}

.libidi-action-btn.copied .dashicons {
    opacity: 1;
}

.image-count {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 3px;
    opacity: 0.6;
}

.action-feedback {
    text-align: center;
    padding: 8px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: none;
}

.action-feedback.show {
    display: block;
}

.action-feedback.success {
    background: rgba(46, 125, 50, 0.15);
    color: #81c784;
    border: 1px solid rgba(129, 199, 132, 0.3);
}

.action-feedback.error {
    background: rgba(211, 47, 47, 0.15);
    color: #e57373;
    border: 1px solid rgba(229, 115, 115, 0.3);
}

/* ===================================
   RESPONSIVO
   =================================== */

@media screen and (max-width: 768px) {
    .price-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .libidi-save-price-btn {
        width: 100%;
    }
    
    .price-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .price-value {
        width: 100%;
        justify-content: space-between;
    }
    
    .libidi-pricing-box {
        padding: 12px 16px;
    }
    
    .libidi-product-actions {
        padding: 10px 12px;
    }
    
    .action-buttons {
        gap: 5px;
    }
    
    .libidi-action-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media screen and (max-width: 480px) {
    .libidi-price-display {
        font-size: 15px;
    }
    
    .libidi-price-display.custom-price {
        font-size: 16px;
    }
    
    .margin-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .libidi-pricing-box h3,
    .libidi-product-actions h3 {
        font-size: 11px;
    }
}

/* ===================================
   SUPORTE PARA TEMAS LIGHT (OPCIONAL)
   =================================== */



/* ===================================
   MENSAGENS DE LOGIN PARA NÃO LOGADOS
   =================================== */

/* Box de Login na Página do Produto */
.libidi-login-message-box {
    background: linear-gradient(135deg, rgba(34, 113, 177, 0.1) 0%, rgba(25, 25, 25, 0.95) 100%);
    border: 2px solid rgba(34, 113, 177, 0.4);
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.libidi-login-icon {
    margin-bottom: 15px;
}

.libidi-login-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #2271b1;
    opacity: 0.8;
}

.libidi-login-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2271b1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.libidi-login-content p {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.libidi-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.libidi-login-btn:hover {
    background: linear-gradient(135deg, #135e96 0%, #0c4a75 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.5);
    color: #ffffff !important;
}

.libidi-login-btn:active {
    transform: translateY(0);
}

.libidi-login-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Mensagem de Login na Listagem (Shop/Categoria) */
.libidi-login-message-shop {
    margin: 10px 0;
    text-align: center;
}

.libidi-login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(34, 113, 177, 0.1);
    border: 1px solid rgba(34, 113, 177, 0.3);
    border-radius: 5px;
    color: #2271b1;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.libidi-login-link:hover {
    background: rgba(34, 113, 177, 0.2);
    border-color: rgba(34, 113, 177, 0.5);
    color: #135e96;
    transform: translateY(-1px);
}

.libidi-login-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Ocultar botão adicionar ao carrinho para não logados */
body:not(.logged-in) .single_add_to_cart_button,
body:not(.logged-in) .add_to_cart_button {
    display: none !important;
}

/* Responsivo - Mensagens de Login */
@media screen and (max-width: 768px) {
    .libidi-login-message-box {
        padding: 20px 15px;
    }
    
    .libidi-login-icon .dashicons {
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    .libidi-login-content h3 {
        font-size: 18px;
    }
    
    .libidi-login-content p {
        font-size: 14px;
    }
    
    .libidi-login-btn {
        padding: 10px 20px;
        font-size: 15px;
    }
}

@media screen and (max-width: 480px) {
    .libidi-login-message-box {
        padding: 15px 10px;
    }
    
    .libidi-login-content h3 {
        font-size: 16px;
    }
    
    .libidi-login-link {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Light Mode para Mensagens de Login */
@media (prefers-color-scheme: light) {
    .libidi-login-message-box {
        background: linear-gradient(135deg, rgba(34, 113, 177, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
        border-color: rgba(34, 113, 177, 0.3);
    }
    
    .libidi-login-content p {
        color: rgba(0, 0, 0, 0.75);
    }
}

/* ===================================
   SELETOR DE QUANTIDADE NA LISTAGEM
   =================================== */

/* Wrapper principal - layout horizontal */
.libidi-quantity-cart-wrapper {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    flex-wrap: nowrap;
}

/* Container do seletor de quantidade */
.libidi-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid;
    border-color: inherit;
    border-radius: 4px;
    overflow: hidden;
    height: 32px;
    background: transparent;
    flex-shrink: 0;
}

/* Botões de incrementar/decrementar */
.libidi-quantity-selector .qty-btn {
    width: 28px;
    height: 100%;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.libidi-quantity-selector .qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.libidi-quantity-selector .qty-btn:active {
    transform: scale(0.95);
}

.libidi-quantity-selector .qty-btn span {
    line-height: 1;
    display: block;
}

/* Input de quantidade */
.libidi-quantity-selector .qty-input {
    width: 38px;
    height: 100%;
    border: none;
    border-left: 1px solid;
    border-right: 1px solid;
    border-color: inherit;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    appearance: textfield;
    -moz-appearance: textfield;
    flex-shrink: 0;
}

.libidi-quantity-selector .qty-input::-webkit-outer-spin-button,
.libidi-quantity-selector .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.libidi-quantity-selector .qty-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.02);
}

/* Botão adicionar ao carrinho customizado */
.libidi-qty-btn,
.libidi-add-to-cart-btn {
    flex: 1;
    height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 12px !important;
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    min-width: 0;
    line-height: 1 !important;
}

/* Responsivo */
@media screen and (max-width: 768px) {
    .libidi-quantity-cart-wrapper {
        gap: 8px;
    }
    
    .libidi-quantity-selector {
        height: 30px;
    }
    
    .libidi-quantity-selector .qty-btn {
        width: 26px;
        font-size: 14px;
    }
    
    .libidi-quantity-selector .qty-input {
        width: 36px;
        font-size: 12px;
    }
    
    .libidi-qty-btn,
    .libidi-add-to-cart-btn {
        height: 30px !important;
        padding: 0 10px !important;
        font-size: 10px !important;
    }
}

@media screen and (max-width: 480px) {
    .libidi-quantity-cart-wrapper {
        gap: 6px;
    }
    
    .libidi-quantity-selector {
        height: 28px;
    }
    
    .libidi-quantity-selector .qty-btn {
        width: 24px;
        font-size: 13px;
    }
    
    .libidi-quantity-selector .qty-input {
        width: 34px;
        font-size: 11px;
    }
    
    .libidi-qty-btn,
    .libidi-add-to-cart-btn {
        height: 28px !important;
        padding: 0 8px !important;
        font-size: 10px !important;
    }
}
