/* ══════════════════════════════════════════
   ObraFácil — style.css
   ══════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange:       #e8570a;
  --orange-light: #f97316;
  --dark:         #1a1a1a;
  --mid:          #2d2d2d;
  --light:        #f5f0eb;
  --text:         #3d3d3d;
  --border:       #d8cfc5;
}

body {
  font-family: 'Georgia', serif;
  background: var(--light);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══ HEADER ══ */
header {
  background: var(--dark);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo img {
  height: 54px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name .title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-name .subtitle {
  font-size: 0.7rem;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-weight: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.82;
}

/* ══ NAV ══ */
nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-family: 'Arial', sans-serif;
  cursor: pointer;
}

nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ══ MAIN ══ */
main {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ══ CARDS ══ */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 1rem;
  font-family: 'Arial', sans-serif;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
}

/* ══ FORM ELEMENTS ══ */
select, input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--light);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Georgia', serif;
}

select:focus, input:focus {
  border-color: var(--orange);
}

.qty-unit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.qty-unit-row select,
.qty-unit-row input {
  margin-bottom: 0;
}

/* ══ BUTTONS ══ */
button {
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'Arial', sans-serif;
  transition: transform 0.1s, opacity 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

button:active { transform: scale(0.97); }

.btn-add {
  background: var(--orange);
  color: #fff;
  width: 100%;
}
.btn-add:hover { background: var(--orange-light); }

.btn-pdf {
  background: var(--dark);
  color: #fff;
}
.btn-pdf:hover { opacity: 0.85; }

.btn-clear {
  background: transparent;
  color: #999;
  border: 1px solid var(--border);
}
.btn-clear:hover { color: #e00; border-color: #e00; }

/* ══ ITEM LIST ══ */
#list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #f9f6f2;
  border: 1px solid #e0d8cf;
  border-radius: 8px;
  font-size: 0.88rem;
}

.item-info { flex: 1; }

.item-name {
  font-weight: bold;
  color: #1a1a1a;
}

.item-category {
  color: #888;
  margin-left: 0.5rem;
}

.item-detail {
  color: #555;
  margin-top: 0.15rem;
}

.item-subtotal {
  color: var(--orange);
  font-weight: bold;
}

.btn-remove {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #bbb;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  margin-left: 0.75rem;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-remove:hover { color: #e00; border-color: #e00; }

.empty-msg {
  color: #aaa;
  font-size: 0.88rem;
}

/* ══ TOTAL ══ */
.total {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--orange);
  text-align: right;
}

/* ══ MODALS ══ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal h2 {
  font-size: 1.3rem;
  color: var(--dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--orange);
}

.modal p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #999;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.modal-close:hover { color: var(--dark); background: #f0f0f0; }

.modal input,
.modal textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--light);
  outline: none;
}
.modal input:focus,
.modal textarea:focus { border-color: var(--orange); }

.modal textarea { height: 100px; resize: vertical; }

.send-btn {
  background: var(--orange);
  color: #fff;
  width: 100%;
  padding: 0.7rem;
  font-size: 0.95rem;
}
.send-btn:hover { background: var(--orange-light); }

.modal a { color: var(--orange); }

/* ══ FOOTER ══ */
footer {
  background: var(--dark);
  color: #888;
  text-align: center;
  font-size: 0.78rem;
  padding: 1.2rem;
  font-family: 'Arial', sans-serif;
}

footer a {
  color: var(--orange);
  text-decoration: none;
  cursor: pointer;
}
footer a:hover { text-decoration: underline; }

/* ══ RESPONSIVO ══ */
@media (max-width: 540px) {
  nav a { font-size: 0.75rem; padding: 0.35rem 0.5rem; }
  .brand-name .title { font-size: 1rem; }
  .qty-unit-row { grid-template-columns: 1fr; }
}
.btn-clear-addr {
  background: transparent;
  color: #999;
  border: 1px solid var(--border);
  flex: 0.4; /* Menor que o botão de salvar */
}

.btn-clear-addr:hover {
  color: #e00;
  border-color: #e00;
  background: rgba(238, 0, 0, 0.05);
}