/* Plugin Kubo Add to Cart Standalone - CSS */

/* Contenedor principal */
.kubo-standalone-container {
    max-width: 400px;
    margin: 20px 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

/* Subtotal */
.kubo-standalone-subtotal {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 16px;
    text-align: left;
}

/* Presets */
.kubo-standalone-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.kubo-standalone-preset-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.kubo-standalone-preset-btn:hover {
    background-color: #fab000;
    color: #ffffff;
    border-color: #fab000;
}

/* Quantity Control */
.kubo-standalone-quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.kubo-standalone-quantity-input-wrapper {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
}

.kubo-standalone-quantity-input-wrapper::after {
    content: 'g';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1rem;
    font-weight: 400;
    pointer-events: none;
    z-index: 1;
    left: var(--suffix-left, 50%);
    opacity: 0; /* Ocultar inicialmente hasta que se calcule la posición */
    transition: opacity 0.2s ease;
}

/* Mostrar el sufijo cuando se ha calculado la posición */
.kubo-standalone-quantity-input-wrapper.suffix-positioned::after {
    opacity: 1;
}

.kubo-standalone-quantity-btn {
    background-color: #ffffff;
    border: 2px solid #ddd !important;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
}

/* Colores específicos para los botones */
.kubo-standalone-quantity-btn[data-action="decrease"] {
    color: #fa010a;
}

.kubo-standalone-quantity-btn[data-action="increase"] {
    color: #fab000;
}

.kubo-standalone-quantity-btn:hover[data-action="decrease"] {
    border-color: #fa010a !important;
}

.kubo-standalone-quantity-btn:hover[data-action="increase"] {
    border-color: #fab000 !important;
}

/* Estilos para botones deshabilitados */
.kubo-standalone-quantity-btn-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background-color: #f5f5f5 !important;
    border-color: #ddd !important;
}

.kubo-standalone-quantity-btn-disabled:hover {
    border-color: #ddd !important;
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
}

.kubo-standalone-quantity-input {
    text-align: center;
    width: 100%;
    height: 40px;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    text-align: center;
    padding-right: 0;
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    flex: 1;
    min-width: 0;
    background-color: #f8f9fa !important;
    cursor: default !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.kubo-standalone-quantity-input::-webkit-outer-spin-button,
.kubo-standalone-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botón agregar al carrito */
.kubo-standalone-add-to-cart-btn {
    background-color: #fab000;
    color: #ffffff;
    border: 2px solid #fab000;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.kubo-standalone-add-to-cart-btn:hover {
    background-color: #ffffff;
    color: #fab000;
}

.kubo-standalone-add-to-cart-btn:disabled,
.kubo-standalone-add-to-cart-btn.kubo-standalone-out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
}

.kubo-standalone-add-to-cart-btn.kubo-standalone-out-of-stock:hover {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
}

/* Estado de éxito del botón */
.kubo-standalone-add-to-cart-btn-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border-color: #28a745 !important;
    cursor: default !important;
    border: 2px solid #28a745 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    /* Mantener el mismo tamaño que el botón original */
    padding: 12px 24px !important;
    font-weight: 700 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.1rem !important;
    width: 100% !important;
    text-align: center !important;
}

.kubo-standalone-add-to-cart-btn-success:hover {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border-color: #28a745 !important;
}

/* Feedback visual del botón */
.kubo-standalone-add-to-cart-btn.kubo-standalone-btn-clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Notificaciones */
.kubo-standalone-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kubo-standalone-notification-show {
    transform: translateX(0);
}

.kubo-standalone-notification-success {
    background-color: #28a745;
    border-left: 4px solid #1e7e34;
}

.kubo-standalone-notification-error {
    background-color: #dc3545;
    border-left: 4px solid #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .kubo-standalone-container {
        margin: 10px 0;
        padding: 0;
    }
    
    .kubo-standalone-subtotal {
        font-size: 0.9rem;
    }
    
    .kubo-standalone-preset-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .kubo-standalone-quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }
    
    .kubo-standalone-quantity-input {
        height: 36px;
        font-size: 0.9rem;
    }
    
    .kubo-standalone-add-to-cart-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .kubo-standalone-add-to-cart-btn-success {
        padding: 10px 20px !important;
        font-size: 1rem !important;
    }
    
    .kubo-standalone-quantity-input-wrapper::after {
        top: 50%;
        font-size: 0.9rem;
        left: var(--suffix-left, 50%);
    }
}

/* Responsive para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .kubo-standalone-quantity-input-wrapper::after {
        top: 50%;
        font-size: 1rem;
        left: var(--suffix-left, 50%);
    }
}

/* Responsive para notificaciones */
@media (max-width: 767px) {
    .kubo-standalone-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .kubo-standalone-notification-show {
        transform: translateY(0);
    }
}
