:root {
    --primary-color: #4a2310;
    --accent-color: #8c5835;
    --bg-light: #fdfbf7;
    --text-dark: #2d1910;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
    color: var(--text-dark);
}

.cotizacion-container {
    background-color: var(--bg-light);
    max-width: 850px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 4px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.company-logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.company-info h1 {
    margin: 0;
    font-size: 22px;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.company-info p {
    margin: 5px 0 0 0;
    font-style: italic;
    font-size: 13px;
    color: var(--accent-color);
}

.contact-right {
    text-align: right;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.phones-row {
    gap: 10px;
}

.phone-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border-radius: 14px;
}

.phone-tag.tigo { background-color: #002f6c; }
.phone-tag.claro { background-color: #ef3123; }

.img-icon-inline {
    height: 14px;
    width: auto;
    object-fit: contain;
}

.title-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.title-main {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 3px;
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

.title-spacer {
    width: 80px; 
}

.doc-number-wrapper {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 15px;
    font-weight: bold;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 80px;
    box-sizing: border-box;
    justify-content: center;
}

.doc-number-wrapper label {
    font-size: 16px;
    user-select: none;
}

#num-cotizacion-input {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    width: 35px;
    text-align: left;
    padding: 0;
    margin: 0;
}

#num-cotizacion-input:focus {
    outline: none;
    border-bottom: 1px dashed white;
}

#num-cotizacion-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.metadata-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    background: #f7f3ed;
    padding: 15px;
    border-radius: 4px;
}

.field-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-group label {
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
}

.field-group input, .field-group select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--accent-color);
    padding: 5px;
    color: var(--text-dark);
    font-size: 15px;
}

.field-group input:focus, .field-group select:focus {
    outline: none;
    border-bottom-style: solid;
}

/* Estilo sutil para marcadores de posición de datos generales */
input::placeholder, textarea::placeholder {
    color: #a89a8e;
    font-style: italic;
    font-size: 13px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.items-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table td {
    border: 1px solid #dcd1c4;
    padding: 8px;
    vertical-align: middle;
}

.items-table input, .items-table textarea {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    resize: none;
}

.items-table input:focus, .items-table textarea:focus {
    background-color: #fffefb;
    outline: 1px solid var(--accent-color);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.total-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.total-box {
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
}

.total-box span {
    margin-left: 15px;
    font-size: 22px;
}

.observaciones {
    font-size: 13px;
    border-top: 1px solid #dcd1c4;
    padding-top: 15px;
    line-height: 1.6;
}

.observaciones h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    text-transform: uppercase;
}

.observaciones ul {
    margin: 0;
    padding-left: 20px;
}

.footer-design {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #dcd1c4;
    padding-top: 15px;
}

.footer-design .slogan {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 20px;
    color: var(--accent-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.footer-design .slogan::before,
.footer-design .slogan::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 50px;
    height: 1px;
    background-color: var(--accent-color);
}
.footer-design .slogan::before { right: 105%; }
.footer-design .slogan::after { left: 105%; }

.footer-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-icon {
    height: 18px;
    width: auto;
    object-fit: contain;
}

.ruc-text {
    font-size: 13px;
    color: #555;
    text-align: right;
    margin-top: 5px;
    font-weight: 500;
}

.toolbar {
    max-width: 850px;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary { background-color: #27ae60; color: white; }
.btn-primary:hover { background-color: #219653; }
.btn-secondary { background-color: var(--primary-color); color: white; }
.btn-secondary:hover { background-color: #33180a; }

.btn-danger {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

@media (max-width: 600px) {
    body { padding: 5px; }
    .cotizacion-container { padding: 15px; }
    .header { flex-direction: column; text-align: center; gap: 15px; }
    .contact-right { text-align: center; justify-content: center; align-items: center; }
    .metadata-grid { grid-template-columns: 1fr; }
    .items-table th:nth-child(1), .items-table td:nth-child(1) { display: none; }
    .title-spacer { display: none; }
    .footer-row { flex-direction: column; gap: 10px; }
}

@media print {
    html, body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background-color: #fdfbf7 !important;
    }
    body { padding: 0; }
    .toolbar, .btn-danger, .btn-add-row, th:last-child, td:last-child { display: none !important; }
    .cotizacion-container { box-shadow: none; padding: 0; max-width: 100%; }
    .field-group input, .field-group select { border: none; }
    input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
    .title-spacer { display: none; }
    #num-cotizacion-input { border: none !important; width: auto; }
    select { appearance: none; -webkit-appearance: none; -moz-appearance: none; }
    
    /* Ocultar textos sugeridos en la impresión final si se dejan vacíos */
    input::placeholder, textarea::placeholder {
        color: transparent !important;
    }
}
