/* Vime Compre Junto - Estilos base */

.vime-compre-junto-container {
    position: relative;
    display: block;
    width: 100%;
    margin: 20px 0;
}

.vime-widget-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.vime-products-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 30px;
}

.vime-product-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    background: #f5f5f5;
    border-radius: 8px;
    border: none;
    flex: 1 1 300px;
    max-width: 380px;
    overflow: hidden;
}

/* Checkbox de seleção de produto */
.vime-product-checkbox {
    position: absolute;
    z-index: 10;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
    top: 10px;
}

.vime-product-checkbox:checked {
    background-color: #00a32a;
    border-color: #00a32a;
}

.vime-product-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Alinhamento do checkbox */
.vime-checkbox-right .vime-product-checkbox {
    right: 10px;
}

.vime-checkbox-left .vime-product-checkbox {
    left: 10px;
}

/* Estado desabilitado quando checkbox desmarcado */
.vime-product-item.vime-product-disabled {
    opacity: 0.6;
    filter: grayscale(50%);
}


.vime-product-item.selected {
    border-color: #00a32a;
    background: #f0f8f0;
}

.vime-product-image {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vime-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0;
}

/* Proporções de imagem */
.elementor-widget-vime_compre_junto[data-image-ratio="square"] .vime-product-image {
    aspect-ratio: 1/1;
    height: auto;
}

.elementor-widget-vime_compre_junto[data-image-ratio="portrait"] .vime-product-image {
    aspect-ratio: 3/4;
    height: auto;
}

.elementor-widget-vime_compre_junto[data-image-ratio="landscape"] .vime-product-image {
    aspect-ratio: 4/3;
    height: auto;
}

.elementor-widget-vime_compre_junto[data-image-ratio="wide"] .vime-product-image {
    aspect-ratio: 16/9;
    height: auto;
}

.elementor-widget-vime_compre_junto[data-image-ratio="auto"] .vime-product-image {
    aspect-ratio: auto;
    height: auto;
}


.vime-product-details {
    padding: 15px;
    background: white;
}

.vime-product-title {
    font-size: 16px;
    font-weight: 400;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vime-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin: 5px 0;
}

.vime-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 16px;
    margin-left: 8px;
    text-decoration: line-through;
}

.vime-product-installments {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-weight: 400;
}

.vime-product-price .woocommerce-Price-amount {
    color: #27ae60;
}

.vime-plus-icon,
.vime-equals-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    font-weight: normal;
    transition: all 0.3s ease;
}

.vime-bundle-summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 20px;
    min-width: 250px;
    flex-shrink: 0;
    align-self: center;
}

.vime-bundle-text {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 400;
}

.vime-bundle-total {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.vime-buy-together-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 50px;
    background: #000;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 250px;
    position: relative;
    overflow: hidden;
    align-self: center;
    margin: 0 auto;
}

.vime-buy-together-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.vime-buy-together-btn:active {
    transform: translateY(0);
}

.vime-buy-together-btn.loading {
    background: #95a5a6;
    cursor: not-allowed;
    pointer-events: none;
}

.vime-buy-together-btn.success {
    background: #27ae60;
    cursor: not-allowed;
}

.vime-buy-together-btn.error {
    background: #e74c3c;
    cursor: not-allowed;
}

.vime-buy-together-btn.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.vime-buy-together-btn.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.button-icon {
    font-size: 18px;
}

.button-icon.svg-icon {
    width: 18px;
    height: 18px;
}

.vime-loading,
.vime-success,
.vime-error {
    display: inline-block;
    font-size: 18px;
}

.vime-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notificações */
.vime-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    z-index: 9999;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vime-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.vime-notification-success {
    background: #27ae60;
}

.vime-notification-error {
    background: #e74c3c;
}

.vime-notification-warning {
    background: #f39c12;
}

/* Responsividade */
@media (max-width: 768px) {
    .vime-products-grid {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .vime-plus-icon,
    .vime-equals-icon {
        display: none;
    }
    
    .vime-product-item {
        width: 100%;
        flex: 1 1 100%;
        max-width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
    }
    
    .vime-product-image {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
    }
    
    .vime-product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .vime-product-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0;
        background: transparent;
    }
    
    .vime-product-title {
        font-size: 16px;
        text-align: left !important;
        margin-bottom: 8px;
    }
    
    .vime-product-price {
        font-size: 18px;
        text-align: left !important;
    }
    
    .vime-bundle-summary {
        width: 100%;
        min-width: auto;
    }
    
    .vime-buy-together-btn {
        width: 100%;
        min-width: auto;
    }
    
    .vime-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .vime-compre-junto-container {
        padding: 10px;
        margin: 15px 0;
    }
    
    .vime-product-item {
        gap: 12px;
    }
    
    .vime-product-image {
        width: 80px;
        height: 80px;
    }
    
    .vime-product-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .vime-product-price {
        font-size: 16px;
    }
    
    .vime-product-installments {
        font-size: 12px;
    }
    
    .vime-bundle-total {
        font-size: 24px;
    }
    
    .vime-buy-together-btn {
        padding: 15px 30px;
        font-size: 16px;
        min-width: 200px;
    }
}


.vime-buy-together-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.vime-buy-together-btn:hover::before {
    left: 100%;
}

/* Mensagem abaixo do botão */
.vime-button-message {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.vime-button-message.show {
    opacity: 1;
    transform: translateY(0);
}

.vime-button-message.loading {
    color: #666;
}

.vime-button-message.success {
    color: #27ae60;
}

.vime-button-message.error {
    color: #e74c3c;
}

/* Estados de loading personalizados */
.vime-loading::before {
    content: '⟳';
    display: inline-block;
    animation: spin 1s linear infinite;
}

.vime-success::before {
    content: '✓';
    display: inline-block;
}

.vime-error::before {
    content: '✗';
    display: inline-block;
}

/* Compatibilidade com temas WordPress comuns */
.elementor-widget-vime_compre_junto {
    width: 100%;
}

.elementor-widget-vime_compre_junto .elementor-widget-container {
    width: 100%;
}

/* Suporte para controles de alinhamento do Elementor */
.elementor-widget-vime_compre_junto .vime-product-title {
    text-align: inherit !important;
}

.elementor-widget-vime_compre_junto .vime-product-price {
    text-align: inherit !important;
}

.elementor-widget-vime_compre_junto .vime-product-installments {
    text-align: inherit !important;
}

.elementor-widget-vime_compre_junto .vime-bundle-text {
    text-align: inherit !important;
}

.elementor-widget-vime_compre_junto .vime-bundle-total {
    text-align: inherit !important;
}

/* Garantir que alinhamentos do Elementor sejam aplicados */
.elementor-widget-vime_compre_junto .vime-bundle-summary {
    text-align: inherit;
}

/* Override de estilos de tema que podem conflitar */
.vime-compre-junto-container * {
    box-sizing: border-box;
}

.vime-compre-junto-container img {
    max-width: 100%;
    height: auto;
    border: none;
}

.vime-compre-junto-container button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

/* Acessibilidade */
.vime-buy-together-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.vime-product-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .vime-compre-junto-container {
        break-inside: avoid;
    }
    
    .vime-buy-together-btn {
        display: none;
    }
}