/**
 * Estilos para el sistema de cotización
 */

/* Contador en el navbar */
.lupa-c-count {
    border-radius: 50%;
    font-size: 14px !important;
    display: none;
    margin-left: 0 !important;
    min-width: 18px;
    text-align: center;
    background: none !important;
    color: inherit !important;
}

.lupa-c-count.has-items {
    display: inline-block;
}

/* Botón agregar a cotización */
.lupa-c-agregar {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lupa-c-agregar:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.lupa-c-agregar.lupa-c-added {
    background: #28a745;
}

/* Modal overlay */
.lupa-c-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Modal principal */
.lupa-c-modal {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Header del modal */
.lupa-c-modal-header {
    padding: 40px 20px 20px;
    border-radius: 40px 40px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
}

.lupa-c-modal-title {
    margin: 0;
    font-size: 36px;
    color: #333;
    font-family: "Gobold";
    text-align: center;
}

.lupa-c-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #A1DC17;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lupa-c-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

/* Indicador de pasos */
.lupa-c-steps-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 1rem;
}

.lupa-c-step-indicator {
    text-align: center;
    position: relative;
    background: #FFF2F9;
    color: #FF149333;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 18px;
    font-family: "Gobold";
}


.lupa-c-step-indicator.active {
    background: #FF1493;
    color: white;
}


/* Contenido del modal */
.lupa-c-modal-body {
    padding: 20px 40px 40px;
    font-family: "Geolica" !important;
}

.lupa-c-step {
    display: none;
}

.lupa-c-step.active {
    display: block;
}

.lupa-c-step-header h3 {
    margin: 0;
    color: #333;
}

.lupa-c-step-header p {
    margin: 0 0 20px 0;
    color: #666;
}

/* Paso 1: Carrito */
.lupa-c-cart-items {
    margin: 20px 0;
}

.lupa-c-cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f8f9fa;
    gap: 15px;
    transition: all 0.2s ease;
}

.lupa-c-cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lupa-c-cart-item-top {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.lupa-c-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lupa-c-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.lupa-c-item-image:hover img {
    transform: scale(1.05);
}

.lupa-c-no-image {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #6c757d;
    font-size: 24px;
}

.lupa-c-item-info {
    flex: 1;
    min-width: 0; /* Para permitir text-overflow */
}

.lupa-c-item-info h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lupa-c-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.lupa-c-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lupa-c-quantity-wrapper label {
    font-size: 14px;
    color: #666;
    margin: 0;
    white-space: nowrap;
}

.lupa-c-quantity-input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.lupa-c-quantity-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.lupa-c-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.lupa-c-remove-item:hover {
    background: #c82333;
    transform: scale(1.05);
}

.lupa-c-empty-cart {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 40px 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Paso 2: Formulario */
.lupa-c-contact-form {
    margin: 20px 0;
}

.lupa-c-form-row {
    margin-bottom: 20px;
}

.lupa-c-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.lupa-c-form-row input,
.lupa-c-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.lupa-c-form-row input:focus,
.lupa-c-form-row textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Paso 3: Resumen */
.lupa-c-summary {
    margin: 20px 0;
}

.lupa-c-summary-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #FF1493;
}

.lupa-c-summary-section h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.lupa-c-summary-section p {
    margin: 0px;
    color: #666;
}

.lupa-c-summary-products {
    margin: 0;
    padding-left: 20px;
}

.lupa-c-summary-products li {
    margin-bottom: 5px;
    color: #666;
}

/* Footer del modal */
.lupa-c-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.lupa-c-step-footer button {
    padding: 0.75rem 2rem;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-family: "Geolica";
}

.lupa-c-step-footer .button {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.lupa-c-step-footer .button:hover {
    background: #5a6268;
    border-color: #545b62;
}

.lupa-c-step-footer .button-primary {
    background: #FF1493;
    border-color: #FF1493;
}

.lupa-c-step-footer .button-primary:hover {
    background: #FF1493;
    border-color: #FF1493;
}

.lupa-c-step-footer .button:disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #e9ecef;
    cursor: not-allowed;
}

/* Toast Notifications */
.lupa-c-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #FF1493;
    z-index: 999998;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    min-width: 320px;
}

.lupa-c-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.lupa-c-toast-content {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    font-family: "Geolica";
}

.lupa-c-toast-icon {
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.lupa-c-toast-message {
    flex: 1;
    margin-right: 8px;
}

.lupa-c-toast-message strong {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}

.lupa-c-toast-count {
    color: #666;
    font-size: 12px;
    margin-bottom: 12px;
}

.lupa-c-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.lupa-c-toast-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: "Geolica";
}

.lupa-c-toast-view {
    background: #FF1493;
    color: white;
}

.lupa-c-toast-view:hover {
    background: #FF1493;
    transform: translateY(-1px);
}

.lupa-c-toast-continue {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.lupa-c-toast-continue:hover {
    background: #e9ecef;
    color: #333;
}

.lupa-c-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.lupa-c-toast-close:hover {
    background: #f8f9fa;
    color: #666;
}

/* Toast responsive */
@media (max-width: 768px) {
    .lupa-c-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        transform: translateY(-100px);
    }
    
    .lupa-c-toast-show {
        transform: translateY(0);
    }
    
    .lupa-c-toast-content {
        padding: 12px;
        gap: 8px;
    }
    
    .lupa-c-toast-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .lupa-c-toast-btn {
        width: 100%;
        text-align: center;
    }
}

/* Toast animations mejoradas */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.lupa-c-toast-entering {
    animation: slideInRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lupa-c-toast-leaving {
    animation: slideOutRight 0.3s ease-in;
}

.lupa-c-success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lupa-c-success-content {
    background: white;
    padding: 40px;
    border-radius: 40px;
    text-align: center;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.lupa-c-success-content h3 {
    color: #333333;
    margin: 0 0 15px 0;
    font-size: 46px;
    text-transform: uppercase;
    font-family: "Gobold";
    line-height: 1.25em;
}

.lupa-c-success-content h5 {
    font-family: "Southing";
    color: #9400D3;
    font-size: 48px;
    line-height: 0.8em;
}

.lupa-c-success-content p {
    margin: 0 0 25px 0;
    color: #333333;
    font-size: 16px;
    font-family: "Geolica";
    line-height: 1em;
}

.lupa-c-success-content button {
    background: #A1DC17;
    color: #614F9F;
    font-family: "Gobold";
    padding: 0.75rem 3rem;
    border-radius: 50px;
    font-size: 18px;
    border: none;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .lupa-c-modal {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .lupa-c-modal-header {
        padding: 15px;
    }
    
    .lupa-c-modal-body {
        padding: 15px;
    }
    
    .lupa-c-cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .lupa-c-cart-item-top {
        width: 100%;
    }
    
    .lupa-c-item-image {
        width: 60px;
        height: 60px;
    }
    
    .lupa-c-item-controls {
        width: 100%;
        justify-content: space-between;
        background: #fff;
        padding: 10px;
        border-radius: 6px;
        border: 1px solid #e9ecef;
    }
    
    .lupa-c-steps-indicator {
        padding: 0 10px;
    }
    
    .lupa-c-step-indicator {
        padding: 5px;
    }
    
    .lupa-c-step-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .lupa-c-step-text {
        font-size: 14px;
        line-height: 1.5em;
    }
    
    .lupa-c-step-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .lupa-c-step-footer button {
        width: 100%;
    }
}

/* Desktop: mantener layout horizontal */
@media (min-width: 769px) {
    .lupa-c-cart-item {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .lupa-c-cart-item-top {
        flex: 1;
        width: auto;
    }
    
    .lupa-c-item-controls {
        width: auto;
        flex-shrink: 0;
        background: none;
        padding: 0;
        border: none;
    }
    
    .lupa-c-quantity-wrapper {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .lupa-c-modal {
        width: 98%;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .lupa-c-modal-header {
        padding: 10px;
    }
    
    .lupa-c-modal-title {
        font-size: 28px;
    }
    
    .lupa-c-modal-body {
        padding: 10px;
    }
    
    .lupa-c-summary-section {
        padding: 15px;
    }
    
    .lupa-c-success-content {
        padding: 30px 20px;
    }

    .lupa-c-success-content {
        grid-template-columns: 1fr;
    }

    .lupa-c-success-content img {
        justify-self: center;
        width: 60%;
    }

    .lupa-c-success-content h3 {
        font-size: 32px;
    }

     .lupa-c-success-content h5 {
        font-size: 40px;
     }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lupa-c-modal-overlay.show .lupa-c-modal {
    animation: fadeIn 0.3s ease-out;
}

/* Estados de carga */
.lupa-c-loading {
    opacity: 0.6;
    pointer-events: none;
}

.lupa-c-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); }
}

/* Mejoras de accesibilidad */
.lupa-c-modal:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.button:focus,
.lupa-c-agregar:focus,
.lupa-c-remove-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Estilos para formularios */
.lupa-c-form-row input:invalid,
.lupa-c-form-row textarea:invalid {
    border-color: #dc3545;
}

.lupa-c-form-row input:valid,
.lupa-c-form-row textarea:valid {
    border-color: #28a745;
}

/* Tooltip básico */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 1000;
}