/* ========================================
   LAYOUT CORPORATIVO + RESPONSIVO CONSOLIDADO
   Página de Cotação Memory IT
   ======================================== */

:root {
  --primary: #0ea65a;
  --primary-dark: #0d9551;
  --primary-light: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

.mc-catalog {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========== HEADER ========== */
.mc-catalog-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--gray-100);
}

@media (min-width: 900px) {
  .mc-catalog-top {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.mc-title h1 {
  margin: 0;
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mc-title p {
  margin: 12px 0 0;
  font-size: 18px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ========== TOOLBAR (Busca + Ações) ========== */
.mc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mc-search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 520px;
  min-width: 280px;
  margin: 0;
}

.mc-search input {
  flex: 1 1 auto;
  min-width: 220px;
  height: 52px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0 20px;
  font-size: 16px;
  transition: all 0.2s ease;
  outline: none;
  background: white;
}

.mc-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 166, 90, 0.1);
}

/* Grupo de ações ao lado do buscar */
.mc-quote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Pill Cotação */
.mc-quote-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

/* Badge */
.mc-badge {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  padding: 0 10px;
  box-shadow: 0 2px 8px rgba(14, 166, 90, 0.3);
}

/* Login state */
.mc-login-state {
  width: 100%;
  margin-top: 6px;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
}

/* ========== BUTTONS ========== */
.mc-btn {
  height: 52px;
  border-radius: var(--radius-lg);
  padding: 0 24px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.mc-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mc-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.mc-btn-ghost {
  background: white;
  border-color: var(--gray-200);
  color: var(--gray-700);
}

.mc-btn-ghost:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.mc-btn-disabled,
.mc-btn.is-disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  border-color: var(--gray-200);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.35);
}

/* Botão Limpar: opaco quando busca vazia */
#mcClearQuote {
  opacity: 0.45;
  filter: grayscale(0.35);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

#mcClearQuote.is-search-active {
  opacity: 1;
  filter: none;
}

/* ========== SUBTITLE ========== */
.mc-subtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 32px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.mc-subtitle-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.mc-subtitle-left strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.mc-subtitle-left span {
  color: var(--gray-500);
  font-size: 16px;
}

.mc-note {
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

/* ========== GRID ========== */
.mc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .mc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .mc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .mc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========== CARDS ========== */
.mc-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.mc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.mc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.mc-card:hover::before {
  transform: scaleX(1);
}

/* Card selecionado */
.mc-card.is-selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl);
}

.mc-card.is-selected::after {
  content: "Selecionado";
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(14, 166, 90, 0.25);
}

.mc-card.is-selected .js-add {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.mc-card.is-selected .js-add::before {
  content: "✓ ";
}

.mc-card-media {
  height: 280px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.mc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mc-card:hover .mc-card-media img {
  transform: scale(1.05);
}

.mc-placeholder {
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.mc-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--gray-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mc-meta {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mc-desc {
  margin: 0;
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.mc-pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--gray-200);
}

.mc-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  gap: 10px;
}

.mc-actions .mc-btn {
  width: 100%;
}

/* ========== EMPTY STATE ========== */
.mc-empty {
  padding: 60px 24px;
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  color: var(--gray-500);
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

/* ========== MODAL ========== */
.mc-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.mc-modal.is-open {
  display: block;
}

.mc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mc-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(800px, calc(100% - 32px));
  max-height: 90vh;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--gray-200);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  z-index: 10000;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.mc-modal-header,
.mc-modal-footer {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--gray-100);
}

.mc-modal-footer {
  border-bottom: 0;
  border-top: 2px solid var(--gray-100);
}

.mc-modal-title {
  font-weight: 800;
  font-size: 20px;
  color: var(--gray-900);
}

.mc-modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow: auto;
}

.mc-quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
}

.mc-quote-row:last-child {
  border-bottom: 0;
}

.mc-quote-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--gray-900);
}

.mc-quote-sku,
.mc-quote-price {
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
}

/* ========== RESPONSIVO MOBILE ========== */
@media (max-width: 767px) {
  
  .mc-catalog {
    padding: 24px 16px;
  }
  
  /* Título */
  .mc-title h1 {
    font-size: 40px !important;
  }
  
  .mc-title p {
    font-size: 14px !important;
  }
  
  /* Toolbar: empilha verticalmente */
  .mc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mc-search {
    flex: 1 1 auto;
    width: 100%;
  }
  
  .mc-search input {
    width: 100%;
  }
  
  /* Botões de ação empilhados */
  .mc-quote-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .mc-quote-actions .mc-btn {
    width: 100%;
  }
  
  .mc-quote-pill {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Subtitle */
  .mc-subtitle {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  /* Grid: 1 coluna */
  .mc-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  /* Cards */
  .mc-card-media {
    height: 200px;
  }
  
  /* Modal */
  .mc-modal-panel {
    width: calc(100% - 32px);
  }
  
  .mc-modal-body {
    max-height: 70vh;
  }
  
  .mc-quote-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .mc-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Breadcrumb (se houver) */
.breadcrumb {
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
}
