/* Responsive breakpoints organizados:
   - Escritorio: >1200px
   - Tablet grande: 1024px - 1199px  
   - Tablet: 768px - 1023px
   - Móvil grande: 480px - 767px
   - Móvil: <480px
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 8px;
    font-size: 14px; /* Reducir el tamaño de fuente base */
    font-weight: 400;
    letter-spacing: 0.01em;
}

.container {
    max-width: 1200px; /* Reducir el ancho máximo */
    width: 98%;
    margin: 0 auto;
    background: white;
    border-radius: 8px; /* Reducir radio de borde */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); /* Sombra más sutil */
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #e83282 0%, #8a1e81 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: bold;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.calculator-modes {
    display: flex;
    background: #ecf0f1;
    border-bottom: 1px solid #ddd;
}

.mode-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: white;
    color: #2c3e50;
    border-bottom: 3px solid #e83282;
}

.mode-btn:hover {
    background: #d5d8dc;
}

.calculator-section {
    padding: 15px; /* Reducir padding a la mitad */
}

.hidden {
    display: none;
}

/* Calculadora Básica */
.basic-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1em;
}

.input-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Company Information */
.company-info {
    background: linear-gradient(135deg, #e83282 0%, #8a1e81 100%);
    color: white;
    padding: 1rem; /* Reducir padding a la mitad */
    margin: -15px -15px 1rem -15px; /* Reducir margen inferior */
    position: relative;
    overflow: hidden;
}

.company-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(232, 50, 130, 0.1);
}

.company-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem; /* Reducir espacio entre logo y detalles */
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.company-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem; /* Reducir espacio */
    flex-shrink: 0;
    margin-top: 0.5rem; /* Reducir margen superior */
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: #e83282;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(232, 50, 130, 0.3);
    border: 3px solid rgba(255,255,255,0.2);
}

.logo-initials {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.company-logo-img {
    width: 70px; /* Reducir tamaño */
    height: 70px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(232, 50, 130, 0.2); /* Sombra más pequeña */
}

.company-name h2 {
    margin: 0;
    font-size: 2rem; /* Reducir tamaño de fuente */
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    text-align: center;
}

.company-tagline {
    margin: 0.1rem 0 0 0;
    font-size: 0.9rem; /* Reducir tamaño de fuente */
    opacity: 0.9;
    font-weight: 600; /* Semi bold */
    text-align: center;
    letter-spacing: 0.05em;
}

.company-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Mantener 3 columnas */
    gap: 0.5rem; /* Reducir el espacio */
    position: relative;
    z-index: 2;
    flex: 1;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reducir espacio */
    background: #fff;
    padding: 0.5rem; /* Reducir padding */
    border-radius: 8px; /* Reducir bordes */
    border: 1px solid #e0e0e0;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    min-width: 0;
    font-size: 0.9em; /* Reducir tamaño general */
}

.detail-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(232, 50, 130, 0.10);
}

.detail-icon {
    font-size: 1rem; /* Más pequeño */
    width: 28px; /* Más pequeño */
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.05rem; /* Reducir espacio */
    min-width: 0;
    overflow: hidden;
}

.detail-label {
    font-size: 0.65rem; /* Más pequeño */
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Client Section */
.quotation-section {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 1rem; /* Reducir padding a la mitad */
    border-radius: 8px; /* Reducir bordes */
    margin-bottom: 1rem; /* Reducir margen inferior */
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Sombra más sutil */
    position: relative;
    overflow: hidden;
}

.quotation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* Más delgada */
    background: #e83282;
}

.quotation-section > h3 {
    margin: 0 0 0.8rem 0; /* Menos margen inferior */
    color: #2c3e50;
    font-size: 1.1rem; /* Reducir tamaño de fuente */
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem; /* Menos padding */
    font-weight: 600;
    letter-spacing: 0.03em;
}

.quotation-section > h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #e83282;
    border-radius: 2px;
}

.client-details {
    background: #ffffff;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.form-grid-client {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.8rem;
}

    @media (max-width: 992px) {
        .form-grid-client {
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto auto auto auto;
        }
        .form-group:nth-child(1),
        .form-group:nth-child(2) {
            grid-column: 1 / 3;
        }
        .form-group:nth-child(3),
        .form-group:nth-child(4) {
            grid-column: 1;
        }
        .form-group:nth-child(5) {
            grid-column: 1;
        }
        .form-group:nth-child(6) {
            grid-column: 2;
        }
    }

    @media (max-width: 600px) {
        .form-grid-client {
            grid-template-columns: 1fr;
            grid-template-rows: auto auto auto auto auto auto;
        }
        .form-group {
            grid-column: 1;
        }
    }

/* Primera fila: Empresa, Nombre del Solicitante, RUC, Teléfono */
.form-group:nth-child(1) {
    /* Empresa */
    grid-column: 1;
    grid-row: 1;
}

.form-group:nth-child(2) {
    /* Nombre del Solicitante */
    grid-column: 2;
    grid-row: 1;
}

.form-group:nth-child(3) {
    /* RUC/DNI */
    grid-column: 3;
    grid-row: 1;
}

.form-group:nth-child(4) {
    /* Teléfono */
    grid-column: 4;
    grid-row: 1;
}

/* Segunda fila: Email (más pequeño), Dirección (más larga) */
.form-group:nth-child(5) {
    /* Email - más pequeño */
    grid-column: 1;
    grid-row: 2;
}

.form-group:nth-child(6) {
    /* Dirección - más larga */
    grid-column: 2 / 5;
    grid-row: 2;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .company-details-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }
    
    .combined-final-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    body {
        padding: 10px;
    }
    
    .container {
        width: 100%;
        border-radius: 12px;
    }
    
    .company-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .detail-item {
        padding: 0.8rem;
    }
    
    .detail-label {
        font-size: 0.75rem;
    }
    
    .detail-value {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .company-details-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .detail-item {
        padding: 0.6rem;
        gap: 0.4rem;
        display: flex;
        align-items: center;
        flex-direction: row;
        text-align: left;
    }
    
    .detail-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    
    .detail-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .detail-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .detail-value {
        font-size: 0.8rem;
        word-break: break-word;
    }
    
    .company-logo {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .company-logo-img {
        max-width: 120px;
        height: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 2px;
    }
    
    .company-details-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .detail-item {
        padding: 0.5rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .detail-label {
        font-size: 0.65rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.8);
    }
    
    .detail-value {
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    .company-logo-img {
        max-width: 100px;
    }
    
    .form-grid-client {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }
    
    .form-group:nth-child(1),
    .form-group:nth-child(2),
    .form-group:nth-child(3),
    .form-group:nth-child(4),
    .form-group-address {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Form Groups Enhanced */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; /* Reducir espacio */
    position: relative;
    margin-bottom: 0; /* Eliminar margen inferior */
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.85rem; /* Reducir tamaño de fuente */
    margin-bottom: 0.2rem; /* Reducir margen */
    display: flex;
    align-items: center;
    gap: 0.3rem; /* Reducir espacio */
    letter-spacing: 0.02em;
}

.form-group label::before {
    content: '▶';
    color: #e83282;
    font-size: 0.7rem; /* Reducir tamaño */
    transition: all 0.3s ease;
}

.form-group:focus-within label::before {
    color: #8a1e81;
    transform: scale(1.1); /* Menos escala */
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem; /* Reducir padding */
    border: 1.5px solid #ced4da; /* Borde más grueso con color más oscuro y visible */
    border-radius: 6px; /* Menos redondeado */
    font-size: 0.95rem; /* Reducir tamaño de fuente */
    transition: all 0.3s ease;
    background: #ffffff;
    position: relative;
    height: auto; /* Ajustar altura automáticamente */
    min-height: 36px; /* Establecer altura mínima */
    font-family: 'Poppins', sans-serif;
    font-weight: 400; /* Peso medio para mejor legibilidad */
    color: rgba(44, 62, 80, 0.75); /* Color con menos transparencia */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
    background: #fafbfc;
    color: rgba(44, 62, 80, 0.95); /* Texto más oscuro cuando está en foco */
    font-weight: 500; /* Peso más visible al tener foco */
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #bbb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: rgba(44, 62, 80, 0.85); /* Color más visible en hover */
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

/* Estilos para placeholders con transparencia */
::placeholder {
    color: rgba(44, 62, 80, 0.35); /* Más transparente que el texto normal */
    font-weight: 300;
    opacity: 1; /* Necesario para Firefox */
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Input Validation States Enhanced */
.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: #27ae60;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2327ae60'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    padding-right: 3rem;
}

.form-group input:invalid:not(:placeholder-shown):not(:focus),
.form-group textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #e74c3c;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e74c3c'%3e%3cpath fill-rule='evenodd' d='M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    padding-right: 3rem;
}

/* Responsive adjustments for quotation section */
@media (max-width: 992px) {
    .quotation-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .quotation-details,
    .client-details {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .form-grid-quotation {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .form-grid-client {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .form-group-address {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .quotation-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .quotation-details,
    .client-details {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-grid-quotation,
    .form-grid-client {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quotation-section > h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .quotation-section {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .quotation-details,
    .client-details {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .quotation-section > h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
}

.company-form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: start;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo-section label {
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.logo-section input[type="file"] {
    display: none;
}

.logo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #3498db;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #3498db;
    font-weight: 600;
}

.logo-preview:hover {
    border-color: #2980b9;
    background: #ecf0f1;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.default-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
}

.logo-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #e91e63;
    margin-bottom: 2px;
}

.logo-creative {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    margin-bottom: 4px;
}

.logo-tagline {
    font-size: 0.8em;
    color: #e91e63;
    font-weight: 500;
}

.company-inputs,
.client-form,
.invoice-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Botones de Acción */
.action-buttons {
    display: flex;
    gap: 1rem; /* Menos espacio entre botones */
    justify-content: center;
    padding: 1rem; /* Menos padding */
    background: linear-gradient(135deg, #ecf0f1, #f8f9fa);
    border-top: 1px solid #3498db; /* Borde más delgado */
    flex-wrap: wrap;
    margin-top: 1rem; /* Menos margen */
}

.action-btn {
    padding: 0.8rem 1.5rem; /* Menos padding */
    border: none;
    border-radius: 6px; /* Menos redondeado */
    font-weight: 500;
    font-size: 0.95rem; /* Fuente más pequeña */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px; /* Menos espacio entre icono y texto */
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.03em;
}

.preview-btn {
    background: #3498db;
    color: white;
}

.preview-btn:hover {
    background: #2980b9;
}

.print-btn {
    background: linear-gradient(135deg, #e83282, #8a1e81);
    color: white;
    box-shadow: 0 2px 8px rgba(232, 50, 130, 0.2);
    min-width: 180px;
}

.print-btn:hover {
    background: linear-gradient(135deg, #d12970, #6b1865);
}

.download-btn {
    background: linear-gradient(135deg, #e83282, #8a1e81);
    color: white;
    box-shadow: 0 2px 8px rgba(232, 50, 130, 0.2);
    min-width: 180px;
}

.download-btn:hover {
    background: linear-gradient(135deg, #d12970, #6b1865);
}

.jpeg-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    min-width: 180px;
}

.jpeg-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
}

.save-btn {
    background: #f39c12;
    color: white;
}

.save-btn:hover {
    background: #d68910;
}

/* Estilos para el mensaje de procesamiento */
.processing-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.processing-message p {
    margin-top: 20px;
    font-size: 18px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.options {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-weight: 500;
    cursor: pointer;
    color: #2c3e50;
}

/* Items Section */
.items-section {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 8px; /* Más compacto */
    padding: 1rem; /* Menos padding */
    margin-bottom: 1rem; /* Menos margen */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Sombra más sutil */
    border: 1px solid #e8f5e8; /* Borde más delgado */
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem; /* Menos margen */
    padding-bottom: 0.5rem; /* Menos padding */
    border-bottom: 2px solid #27ae60; /* Borde más delgado */
}

.items-header h4 {
    color: #27ae60;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-tip {
    background: rgba(232, 50, 130, 0.1);
    border-left: 4px solid #e83282;
    padding: 8px 12px;
    margin: 8px 0 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #333;
}

.info-tip p {
    margin: 0;
}

.info-tip strong {
    color: #e83282;
}

.items-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.add-btn, .btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500; /* Ajustado para Poppins */
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.2);
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.02em;
}

.add-btn:hover, .btn:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
}

.btn-danger {
    background: linear-gradient(135deg, #8a1e81, #e83282);
    box-shadow: 0 2px 10px rgba(138, 30, 129, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #6b1865, #d12970);
    box-shadow: 0 3px 12px rgba(138, 30, 129, 0.3);
}

/* Items Table Styling */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.items-columns-header {
    display: grid;
    grid-template-columns: 100px 120px 8fr 120px 120px 80px; /* Columna U.M. aumentada a 120px */
    gap: 1rem;
    padding: 0 1.5rem;
    background: #e83282;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(232, 50, 130, 0.3);
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 36px; /* Misma altura que los inputs */
    align-items: center;
}

.items-columns-header div {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 36px;
    line-height: 36px;
    vertical-align: middle;
}

#price-header, #subtotal-header {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    height: 100%;
}

.item-row {
    display: grid;
    grid-template-columns: 100px 120px 8fr 120px 120px 80px; /* Columna U.M. aumentada a 120px */
    gap: 1rem; /* Mismo gap que el encabezado */
    align-items: center;
    padding: 0.6rem 1.5rem; /* Mismo padding horizontal que el encabezado */
    background: #ffffff;
    border: 1px solid #f1f3f4; /* Borde más delgado */
    border-radius: 6px; /* Bordes menos redondeados */
    box-shadow: 0 1px 4px rgba(0,0,0,0.04); /* Sombra más sutil */
    margin-bottom: 0.5rem; /* Menos espacio entre filas */
    position: relative;
}

.item-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.item-row input {
    padding: 0 0.5rem;
    border: 1.5px solid #ced4da; /* Borde más grueso y más oscuro */
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    height: 36px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 36px; /* Alineación vertical del texto */
    font-family: 'Poppins', sans-serif;
    font-weight: 400; /* Peso medio para mejor legibilidad */
    color: rgba(44, 62, 80, 0.75); /* Color con menos transparencia */
    transition: all 0.3s ease;
}

.item-row input.quantity-input {
    text-align: center;
}

.item-row select.unit-input {
    text-align: center;
    padding: 0 0.5rem;
    border: 1.5px solid #ced4da; /* Borde más grueso y más oscuro */
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500; /* Peso más visible para los selects */
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    height: 36px;
    background: white;
    cursor: pointer;
    color: rgba(44, 62, 80, 0.8); /* Color con menos transparencia */
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.item-row textarea.description-input {
    text-align: left;
    padding: 0.6rem; /* Más padding */
    border: 1.5px solid #ced4da; /* Borde más grueso y más oscuro */
    border-radius: 6px; /* Más redondeado */
    font-size: 0.9rem; /* Fuente un poco más grande */
    font-family: 'Poppins', sans-serif;
    resize: vertical; /* Permite redimensionar verticalmente */
    min-height: 80px; /* Altura mínima para 3-4 líneas */
    max-height: 200px; /* Limitar altura máxima */
    height: 85px; /* Altura inicial */
    width: 100%;
    line-height: 1.4; /* Mejor espaciado entre líneas */
    box-sizing: border-box;
    overflow-y: auto; /* Scroll vertical si el contenido excede */
    background: #f8f9fa; /* Fondo ligeramente diferente */
    font-weight: 400; /* Peso medio para mejor legibilidad */
    color: rgba(44, 62, 80, 0.75); /* Color con menos transparencia */
    transition: all 0.3s ease;
}

.item-row input.unit-price-input {
    text-align: right;
    height: 36px;
    padding-right: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Alineación a la derecha */
    vertical-align: middle;
    font-weight: 500; /* Peso más fuerte para precios */
    color: rgba(44, 62, 80, 0.85); /* Color más oscuro para precios */
}

.item-row input:focus,
.item-row textarea:focus,
.item-row select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
    color: rgba(44, 62, 80, 0.95); /* Color más oscuro en foco */
    font-weight: 500; /* Más peso en foco para mejor visibilidad */
}

.item-row input:hover,
.item-row textarea:hover,
.item-row select:hover {
    border-color: #ccc;
    color: rgba(44, 62, 80, 0.85); /* Color más visible en hover */
}

.item-row .item-total {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #27ae60;
    background: #f8f9fa;
    padding: 0.7rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    justify-content: flex-end;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}

.item-row .subtotal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0 0.8rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-row .subtotal:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #c1c9d0;
}

.item-row .subtotal-edit-input {
    background: #fff;
    color: #2c3e50;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid #e83282;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(232, 50, 130, 0.3);
    outline: none;
}

.item-row .remove-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.5rem;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.item-row .remove-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* Estilos específicos removidos para evitar conflictos */

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #c0392b;
}

.totals-section {
    background: #6c757d;
    color: white;
    padding: 1.5rem; /* Menos padding */
    border-radius: 8px; /* Menos redondeado */
    border: none;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.25); /* Sombra más sutil */
    margin-bottom: 1.5rem; /* Menos margen */
    position: relative;
    overflow: hidden;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem; /* Menos padding */
    font-size: 0.95rem; /* Fuente más pequeña */
    font-weight: 500; /* Peso medio para mejor legibilidad */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px; /* Menos redondeado */
    margin-bottom: 0.5rem; /* Menos margen */
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
    letter-spacing: 0.02em;
}

.total-row:hover {
    background: rgba(255, 255, 255, 0.15);
}

.total-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.total-final {
    font-size: 1.1rem;
    font-weight: 600; /* Ajustado para Poppins que es más pesada visualmente */
    color: white;
    border-top: 3px solid rgba(255, 255, 255, 0.3);
    margin-top: 1.5rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.03em;
}

.total-final span:last-child {
    font-size: 1.3rem;
    font-weight: 700; /* Ajustado para Poppins */
    letter-spacing: 0.04em;
}

.result-section {
    background: #ecf0f1;
    padding: 25px 30px;
    border-top: 1px solid #ddd;
}

.amount-words {
    margin-bottom: 15px;
}

.amount-words label,
.date-section label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

#amountInWords {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-weight: 500;
    color: #2c3e50;
}

#currentDate {
    font-weight: 500;
    color: #2c3e50;
}

.info-section {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.info-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.info-content h4 {
    color: #3498db;
    margin: 15px 0 10px 0;
    font-size: 1.1em;
}

.info-content p,
.info-content li {
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.info-content ul {
    margin-left: 20px;
}

footer {
    background: #1e2836;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        width: 98%;
        margin: 10px auto;
    }
    
    .items-columns-header,
    .item-row {
        grid-template-columns: 90px 85px 4fr 110px 110px 70px;
        gap: 0.8rem;
        padding: 0.5rem 1rem; /* Reducir padding vertical */
    }
}

@media (max-width: 1024px) {
    .container {
        width: 98%;
        margin: 10px auto;
        border-radius: 12px;
    }
    
    .items-columns-header,
    .item-row {
        grid-template-columns: 80px 75px 3fr 100px 100px 60px;
        gap: 0.6rem;
        padding: 0.5rem; /* Reducir padding vertical */
    }
    
    .calculator-section {
        padding: 25px 20px;
    }
    
    /* Optimización para tablets */
    .combined-final-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .items-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .items-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    body {
        background: white;
    }
    
    /* Headers más compactos */
    header {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.95em;
    }

    .calculator-section {
        padding: 15px;
    }

    /* Items section completamente redeseñada para móvil */
    .items-columns-header {
        display: none; /* Ocultar encabezados en móvil */
    }

    .item-row {
        display: block;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 10px;
        border: 1px solid #e9ecef;
        position: relative;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .item-row > * {
        width: 100%;
        margin-bottom: 15px;
        display: block;
    }

    .item-row > *:last-child {
        margin-bottom: 0;
    }

    /* Mostrar labels para cada campo en móvil usando data-label */
    .item-row input[data-label]::before,
    .item-row textarea[data-label]::before,
    .item-row div[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 8px;
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Estilos específicos para diferentes tipos de campos */
    .item-row .quantity-input {
        background: #fff3cd;
        border: 2px solid #ffeaa7;
    }

    .item-row .unit-input {
        background: #e8f5e5;
        border: 2px solid #28a745;
        font-size: 0.85rem;
        font-weight: 600;
    }

    .item-row .description-input {
        background: #e8f4fd;
        border: 2px solid #74b9ff;
        min-height: 80px; /* Altura mínima aumentada */
        max-height: 200px; /* Permitir más altura */
        height: 85px; /* Altura inicial */
        resize: vertical; /* Permitir redimensionamiento */
        overflow-y: auto;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .item-row .unit-price-input {
        background: #d1ecf1;
        border: 2px solid #17a2b8;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: normal;
    }

    .item-row .subtotal {
        background: #d4edda;
        border: 2px solid #28a745;
        padding: 12px;
        border-radius: 8px;
        font-weight: 600;
        text-align: center;
        color: #155724;
    }

    .item-row .subtotal {
        background: #f8d7da;
        border-color: #007bff;
        color: #721c24;
        font-size: 1.1em;
        font-weight: 700;
    }

    .remove-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        margin: 0;
        z-index: 10;
    }

    /* Controles de items */
    .items-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        margin-bottom: 20px;
    }

    .items-header h4 {
        text-align: center;
        margin-bottom: 0;
    }

    .items-controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .checkbox-inline {
        margin-bottom: 10px;
    }

    .add-btn {
        width: 100%;
        max-width: 300px;
        padding: 15px;
        font-size: 1.1em;
    }

    /* Sección de totales */
    .totals-section {
        padding: 20px;
        margin: 20px 0;
        background: #f8f9fa;
        border-radius: 10px;
        border: 2px solid #e9ecef;
    }

    .total-row {
        padding: 10px 0;
        font-size: 1.1em;
        border-bottom: 1px solid #dee2e6;
    }

    .total-final {
        font-size: 1.1em;
        font-weight: bold;
        border-bottom: none;
        padding-top: 15px;
        color: #e83282;
    }

    /* Botones de acción */
    .action-buttons {
        padding: 20px 15px;
        flex-direction: column;
        gap: 15px;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
        font-size: 1.1em;
    }

    /* Datos finales más compactos */
    .final-quotation-details {
        order: 2;
    }

    .form-grid-final {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    header {
        padding: 12px;
    }

    header h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .calculator-section {
        padding: 12px;
    }

    .quotation-section {
        margin-bottom: 15px;
    }

    .item-row {
        padding: 15px;
        margin-bottom: 12px;
    }

    .add-btn {
        padding: 12px 16px;
        font-size: 1em;
        width: 100%;
    }

    .totals-section {
        padding: 15px;
        margin: 15px 0;
    }

    .total-row {
        font-size: 1em;
        padding: 8px 0;
    }

    .total-final {
        font-size: 1.0em;
    }

    .action-buttons {
        padding: 15px 12px;
        flex-direction: column;
        gap: 12px;
    }

    .action-btn {
        padding: 16px;
        font-size: 1.1em;
        width: 100%;
        justify-content: center;
    }

    /* Formularios más compactos */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1em;
        height: 48px; /* Altura mayor para mejor toque en móvil */
    }

    .form-group label {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    /* Mejoras para firmas en móvil */
    .signatures-section {
        padding: 1.5rem 1rem;
    }
    
    .signature-box {
        min-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .signature-pad {
        height: 180px; /* Más alto en móvil para mejor firma */
    }
    
    .clear-signature {
        padding: 10px 20px;
        font-size: 1em;
        width: 80%;
    }
    
    /* Mejora de legibilidad */
    .items-header h4 {
        font-size: 1.5em;
        text-align: center;
        margin-bottom: 15px;
    }
    
    /* Botones de control más grandes y fáciles de tocar */
    input[type="checkbox"] {
        transform: scale(1.3);
        margin-right: 8px;
    }
    
    .checkbox-inline {
        font-size: 1.1em;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
    }
}

/* Mejoras específicas para dispositivos táctiles */
@media (max-width: 768px) {
    /* Inputs más grandes para mejor usabilidad táctil */
    input, textarea, select, button {
        min-height: 44px; /* Tamaño mínimo recomendado para táctil */
        font-size: 16px; /* Evita zoom automático en iOS */
    }
    
    /* Mejorar área de toque para botones */
    .remove-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }
    
    .add-btn {
        min-height: 50px;
        padding: 15px 20px;
    }
    
    /* Espaciado mejorado entre elementos */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Mejorar legibilidad de texto */
    body {
        line-height: 1.6;
    }
    
    /* Focus states más visibles en móvil */
    input:focus, textarea:focus, select:focus {
        outline: 3px solid #007bff;
        outline-offset: 2px;
        border-color: #007bff;
    }
    
    /* Mejorar contraste de texto en móvil */
    .detail-label {
        color: rgba(255, 255, 255, 0.9);
        font-weight: 700;
    }
    
    .detail-value {
        color: white;
        font-weight: 600;
    }
}

/* Optimizaciones específicas para móviles pequeños */
@media (max-width: 480px) {
    /* Reducir márgenes para aprovechar más espacio */
    .calculator-section {
        padding: 8px;
    }
    
    .quotation-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    /* Hacer títulos más compactos */
    .quotation-section h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
        padding: 0.5rem;
        background: linear-gradient(135deg, #e83282, #8a1e81);
        color: white;
        border-radius: 8px;
        text-align: center;
    }
    
    /* Hacer botones más accesibles */
    .action-btn {
        min-height: 50px;
        font-size: 1.1em;
        padding: 15px 20px;
        border-radius: 12px;
    }
    
    /* Mejorar área de las tarjetas de items */
    .item-row {
        padding: 15px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.15);
        border: 2px solid #e9ecef;
    }
    
    /* Optimizar totales para pantallas pequeñas */
    .totals-section {
        position: sticky;
        bottom: 0;
        background: #f8f9fa;
        border-top: 3px solid #6c757d;
        z-index: 100;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    }
    
    /* Mejorar información de empresa en móvil pequeño */
    .company-info {
        padding: 1rem;
    }
    
    .company-header {
        text-align: center;
    }
    
    .company-logo {
        margin-bottom: 1rem;
    }
    
    .company-logo-img {
        max-width: 80px;
        height: auto;
    }
    
    /* Formularios más espaciados */
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
        border: 2px solid #ddd;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }
    
    /* Datos finales más compactos */
    .final-quotation-details {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .form-grid-final {
        gap: 0.8rem;
    }
    
    /* Botón agregar item más prominente */
    .add-btn {
        background: linear-gradient(135deg, #e83282, #8a1e81);
        color: white;
        border: none;
        border-radius: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 15px rgba(232, 50, 130, 0.3);
        transition: all 0.3s ease;
    }
    
    .add-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(232, 50, 130, 0.4);
    }
}

/* Mejoras para landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .company-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .form-grid-client {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-group-address {
        grid-column: 1 / -1;
    }
}

/* Estilos para modo oscuro en dispositivos que lo soporten */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .item-row {
        background: #1a1a1a;
        border-color: #333;
        color: #fff;
    }
    
    .totals-section {
        background: #495057;
        border-color: #007bff;
        color: #fff;
    }
}
.summary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.3);
    position: relative;
    overflow: hidden;
}

.summary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
}

/* Shimmer animation removed for sobriety */

.summary h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.summary-item {
    background: rgba(255,255,255,0.15);
    padding: 1.2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-3px);
}

.summary-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.summary-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.amount-in-words {
    background: rgba(255,255,255,0.15);
    padding: 1.2rem;
    border-radius: 10px;
    font-style: italic;
    font-size: 1rem;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

/* Action Buttons Enhanced */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.actions .btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.actions .btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Responsive for Summary */
@media (max-width: 768px) {
    .summary {
        padding: 1.5rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Final Quotation Details - Enhanced Separation */
.final-quotation-details {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.8rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.final-quotation-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
}

.final-quotation-details h3 {
    margin: 0 0 0.6rem 0;
    color: #e83282;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e83282;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: relative;
}

/* Removed generic .form-grid-final - using .combined-final-section .form-grid-final instead */

/* All 6 fields in ONE single row */
.final-quotation-details .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Responsive for smaller screens */
@media (max-width: 1200px) {
    /* Responsive styles moved to combined-final-section media queries */
}

@media (max-width: 768px) {
    /* Responsive styles moved to combined-final-section media queries */
    
    .final-quotation-details {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .form-grid-final {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

.final-quotation-details .form-group label {
    font-weight: 500;
    color: #1976d2;
    font-size: 0.7rem;
    margin-bottom: 0.1rem;
}

.final-quotation-details .form-group input,
.final-quotation-details .form-group select {
    padding: 0.4rem 0.5rem;
    border: 1.5px solid #ced4da;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: #ffffff;
    height: 32px;
}

.final-quotation-details .form-group input:focus,
.final-quotation-details .form-group select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

@media (max-width: 768px) {
    .final-quotation-details h3 {
        font-size: 0.85rem;
    }
    
    .final-quotation-details .form-group label {
        font-size: 0.75rem;
    }
    
    .final-quotation-details .form-group input,
    .final-quotation-details .form-group select {
        font-size: 0.85rem;
        padding: 0.5rem;
        height: 36px;
    }
}

/* Advanced Animations and Effects - REMOVED FOR SOBRIETY */
/* All animations have been removed for a more professional look */

/* Enhanced Responsive Design for All Devices */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0.5rem;
        margin: 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .form-grid,
    .summary-grid,
    .quotation-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .company-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .company-logo {
        justify-self: center;
    }
    
    .section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .company-details h2 {
        font-size: 1.3rem;
    }
    
    .section {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* Print Styles */
@media print {
    .container {
        max-width: 100%;
        margin: 0;
        padding: 1cm;
        box-shadow: none;
    }
    
    .section {
        break-inside: avoid;
        margin-bottom: 1cm;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .add-item-form,
    .items-controls,
    .btn {
        display: none !important;
    }
    
    /* Print styles para combined-final-section */
    .combined-final-section {
        flex-direction: row;
        gap: 2rem;
        page-break-inside: avoid;
    }
    
    .combined-final-section .final-quotation-details {
        max-width: none !important;
        flex: 0 1 65%;
        width: 65%;
        padding: 0.8rem;
    }
    
    .combined-final-section .final-quotation-details h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .combined-final-section .totals-section {
        display: block !important;
        flex: 0 1 auto;
        width: auto;
        background: linear-gradient(135deg, #e83282 0%, #8a1e81 100%);
        color: white;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .combined-final-section .form-grid-final {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.8rem;
    }
    
    .combined-final-section .final-quotation-details .form-group label {
        font-size: 0.8rem !important;
        font-weight: 600;
        color: #1976d2;
    }
    
    .combined-final-section .final-quotation-details .form-group input,
    .combined-final-section .final-quotation-details .form-group select {
        font-size: 0.95rem !important;
        padding: 0.6rem !important;
        height: auto !important;
    }
    
    .total-row {
        font-size: 0.9rem !important;
        padding: 0.8rem !important;
    }
}

/* Combined Final Section - Side by Side Layout */
.combined-final-section {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    align-items: start;
    justify-content: space-between;
}

/* Final Quotation Details - Compact for side layout */
.combined-final-section .final-quotation-details {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    margin: 0;
    flex: 0 1 auto;
    max-width: 60%;
}

.combined-final-section .final-quotation-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e83282;
}

.combined-final-section .final-quotation-details h3 {
    margin: 0 0 0.8rem 0;
    color: #e83282;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e83282;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.combined-final-section .form-grid-final {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
    align-items: end;
}

.combined-final-section .form-grid-final .form-group:nth-child(1),
.combined-final-section .form-grid-final .form-group:nth-child(2),
.combined-final-section .form-grid-final .form-group:nth-child(3) {
    grid-column: auto;
}

.combined-final-section .form-grid-final .form-group:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

.combined-final-section .form-grid-final .form-group:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}

/* All 6 fields in column layout for the left section */
.combined-final-section .final-quotation-details .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.combined-final-section .final-quotation-details .form-group label {
    font-weight: 500;
    color: #1976d2;
    font-size: 0.7rem;
    margin-bottom: 0.1rem;
}

.combined-final-section .final-quotation-details .form-group input,
.combined-final-section .final-quotation-details .form-group select {
    padding: 0.4rem 0.5rem;
    border: 1.5px solid #ced4da;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: #ffffff;
    height: 32px;
}

.combined-final-section .final-quotation-details .form-group input:focus,
.combined-final-section .final-quotation-details .form-group select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Totals section adjustments for side layout */
.combined-final-section .totals-section {
    background: linear-gradient(135deg, #e83282 0%, #8a1e81 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(232, 50, 130, 0.2);
    margin: 0;
    position: relative;
    overflow: hidden;
    min-height: fit-content;
    flex: 0 0 auto;
    width: 250px;
}

/* Responsive para pantallas tablets */
@media (max-width: 1024px) {
    .combined-final-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .combined-final-section .final-quotation-details {
        max-width: 100%;
    }
    
    .combined-final-section .totals-section {
        width: 100%;
        flex: 1;
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .combined-final-section {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .combined-final-section .final-quotation-details {
        padding: 0.8rem;
        max-width: 100%;
    }
    
    .combined-final-section .totals-section {
        width: 100%;
        flex: 1;
    }
    
    .combined-final-section .form-grid-final {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .combined-final-section .final-quotation-details h3 {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .combined-final-section .form-grid-final {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .combined-final-section .form-grid-final .form-group:nth-child(4) {
        grid-column: span 1;
    }
    
    .combined-final-section .final-quotation-details .form-group label {
        font-size: 0.75rem;
    }
    
    .combined-final-section .final-quotation-details .form-group input,
    .combined-final-section .final-quotation-details .form-group select {
        font-size: 0.85rem;
        padding: 0.5rem;
        height: 36px;
    }
}

/* Estilos para la sección de firmas simplificadas */
.signatures-section-simple {
    margin: 0.8rem 0;
    padding: 0 1.5rem; /* Padding horizontal moderado */
}

.signatures-section-simple h3 {
    text-align: center;
    margin-bottom: 0.8rem; /* Espacio moderado debajo del título */
    color: #2c3e50;
    font-size: 1.1rem;
}

.signatures-container-simple {
    display: flex;
    justify-content: space-around; /* Distribuir espacio alrededor */
    flex-wrap: wrap;
    gap: 2.5rem; /* Espacio moderado entre firmas */
}

.signature-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 200px;
    max-width: 250px; /* Tamaño más balanceado */
}

.dotted-line {
    width: 100%;
    height: 1px;
    border-bottom: 2px dotted #6c757d;
    margin-bottom: 0.5rem;
    min-width: 200px; /* Ancho mínimo más apropiado */
}

.signature-name {
    font-weight: 500;
    color: #495057;
    text-align: center;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .signatures-container-simple {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .signature-line {
        width: 100%;
    }
}
/* Actualizado - Condiciones de Pago span 2 columnas */
