/* ===== Reseturi & tranzitii ===== */
* { transition: all 0.2s linear; }

/* ===== Modal (unic) ===== */
.mp-modal {
  position: fixed;
  inset: 0;
  display: none;                /* vizibil controlat din JS */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  z-index: 9999;
}
.mp-modal-inner {
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  width: min(92vw, 420px);
  display: grid;
  gap: 10px;
}
.mp-create-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.mp-modal-actions { display: flex; justify-content: flex-end; }
.mp-modal-inner input[type="text"] {
  padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px;
}
.mp-modal-inner button {
  appearance: none; border: 1px solid #e5e7eb; background: #f9fafb; padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.mp-modal-inner button:hover { background: #f3f4f6; border-color: #d1d5db; }

/* ===== Layout general ===== */
.mp-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 60px;
}
.mp-header h3 { 
  margin: 0; 
  font-size: 40px;
  font-family: "ITCAvantGardeStd-Demi", Sans-serif !important;
  width: 100%;
}

.mp-modal{
    color: #7a5330 !important;
}

.mp-projects-dashboard h3, .mp-projects-dashboard h4, .mp-projects-dashboard h4 a, .mp-project-view h3, .mp-project-view h4, .mp-project-view h4 a, .mp-inline-add h3, .mp-inline-add h4, .mp-inline-add h4 a{
    font-family: "ITCAvantGardeStd-Demi", Sans-serif !important;
    text-transform: uppercase !important;
    color: #000;
}

.mp-projects-dashboard a, .mp-projects-dashboard p, .mp-projects-dashboard div, .mp-projects-dashboard span, .mp-projects-dashboard button, .mp-projects-dashboard input, .mp-project-view a, .mp-project-view p, .mp-project-view div, .mp-project-view span, .mp-project-view button, .mp-project-view input, .mp-inline-add a, .mp-inline-add p, .mp-inline-add div, .mp-inline-add span, .mp-inline-add button, .mp-inline-add input, .mp-notice{
    font-family: "Montserrat", Sans-serif !important;
}

/* ===== Dashboard proiecte ===== */
.mp-projects-dashboard .mp-projects-list { list-style: none; padding-left: 0; }
.mp-projects-dashboard .mp-projects-list li {
  padding: 8px; border-bottom: 1px solid #eee;
}

/* ===== Grid proiecte ===== */
.mp-projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 80px 30px;
  margin-top: 16px;
}

/* ===== Card proiect ===== */
.mp-card {
  position: relative;           /* pentru butoane overlay */
  border: 1px solid #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
}
.mp-card-body {
  padding: 30px 12px 12px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; z-index: 2;       /* peste thumbnail link */
  justify-content: space-between;
        height: 100%;
}
.mp-title {
  font-size: 21px; font-weight: 600; margin: 0; line-height: 1.3; color: #111827;
}
.mp-title a {
  text-decoration: none; color: inherit; font-family: "Montserrat", Sans-serif; font-weight: 300; font-size: 21px !important; }
.mp-title a:hover { opacity: .7; }

/* ===== Colaj 2×2 thumbnails ===== */
.mp-thumb-link { display: block; position: relative; z-index: 1; text-decoration: none; }
.mp-thumb-link:hover { filter: brightness(.7); }
.mp-thumb-link .mp-thumb-grid { cursor: pointer; }

.mp-thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #f3f4f6;
  aspect-ratio: 1 / 1;
}
.mp-thumb-grid .mp-thumb {
  background: #fff;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.mp-thumb-grid .mp-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mp-thumb-grid .mp-thumb--placeholder { background: #e5e7eb; }

/* Overlay +x pe a 4-a imagine când sunt >4 produse */
.mp-thumb--has-overlay::before {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.5);
}
.mp-thumb-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: #fff; letter-spacing: .5px;
}

/* ===== Actions ===== */
.mp-actions {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; align-items: center;
}
.mp-actions button {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 6px 10px;
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.mp-actions button:hover { background: #f3f4f6; border-color: #d1d5db; }
.mp-actions .mp-icon-btn { pointer-events: auto; }
.mp-actions .mp-icon-btn:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1) !important; }

/* Icon buttons (trash & edit) – dimensiuni unificate */
.mp-trash-icon,
.mp-edit-icon,
.mp-trash-icon:active,
.mp-edit-icon:active,
.mp-trash-icon:focus,
.mp-edit-icon:focus{
  width: 36px !important; 
  height: 36px !important;
  border-radius: 8px !important;
  display: inline-flex !important; 
  align-items: center; 
  justify-content: center;
  padding: 0 !important; 
  margin: 0 !important; 
  cursor: pointer;
}

.mp-open-create, .mp-open-create:focus, .mp-open-create:active, .mp-back:focus, .mp-back, .mp-back:active, .mp-btn, .mp-btn:active, .mp-btn:focus{
    height: 36px;
    border-radius: 8px !important;
  display: inline-flex !important; 
  align-items: center; 
  justify-content: center;
  padding: 20px !important; 
  margin: 0 !important; 
  cursor: pointer;
}

.mp-open-select, .mp-open-select:active, .mp-open-select:focus{
    border: 1px solid #000 !important;
    background-color: #fff !important;
    color: #000 !important;
    border-radius: 50px !important;
    height: 56px;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.mp-open-select:hover{
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Trash (overlay, dreapta-sus) */
.mp-trash-icon {
  border: 1px solid #eb2626 !important;
  background: rgba(255,255,255,.6) !important;
  color: #eb2626 !important;
}
.mp-trash-icon:hover { 
    background: rgba(255,255,255,.9) !important; }
.mp-trash-icon:focus { 
    outline: 2px solid #111827 !important; 
    outline-offset: 2px; }
.mp-delete-icon { pointer-events: auto; }

/* Edit (icon-only) */
.mp-edit-icon {
  border: 1px solid #735643 !important;
  background: rgba(255,255,255,.6) !important;
  color: #735643 !important;
  transition: all .15s ease;
}
.mp-edit-icon:hover,
.mp-edit-icon:active,
.mp-edit-icon:focus {
  background: rgba(255,255,255,.6) !important;
  color: #2e1a0d !important;
  border: 1px solid #2e1a0d !important;
}

/* Inline widget pe pagina de produs */
.mp-inline-add { display: grid; gap: 8px; width: 100% !important; }
.mp-inline-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.mp-select-wrap select {
  width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; font-size: 14px; height: 56px;
}
.mp-inline-add .mp-save, .mp-create {
  appearance: none;
  border: 1px solid #7F604B !important;
  background: #7F604B !important;
  color: #fff !important;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  height: 56px;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.mp-inline-add .mp-save:hover , .mp-create:hover{ opacity: .7; }
.mp-inline-row .mp-open-create { grid-column: 2; grid-row: 2; justify-self: end; height: 50px; border-radius: 10px; }

.mp-open-create, .mp-back, .mp-btn {
  border: 1px solid #e5e7eb !important;
  background: #f9fafb !important;
  color: #0D0D0D !important;
}
.mp-open-create:hover, .mp-back:hover, .mp-btn { background: #f3f4f6 !important; border-color: #d1d5db !important; color: #0D0D0D !important; }

.mp-status { font-size: 13px; color: #374151; }

/* ===== Container pentru iteme injectate din JS ===== */
.mp-items { padding: 12px; border-top: 1px dashed #eee; }

/* ===== View proiect: listă produse ===== */
.mp-project-head { display: flex;     flex-direction: column;
    align-items: flex-start; gap: 12px; margin-bottom: 12px; margin-top: 60px;}
.mp-back {
  text-decoration: none; font-size: 14px; padding: 6px 10px;
  border: 1px solid #e5e7eb; border-radius: 0; background: #f9fafb;
}
.mp-project-title { margin: 0; font-size: 40px; color: #7F604B; width: 100%; text-align: center; margin-top: 30px; margin-bottom: 30px;}

/* Grid produse */
.mp-products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 80px 30px;
}
.mp-prod-card {
  border: 1px solid #e5e7eb; border-radius: 0; overflow: hidden; background: #fff; display: flex; flex-direction: column;
}
.mp-prod-thumb { display: block; background: #f3f4f6; aspect-ratio: 1 / 1; }
.mp-prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1 / 1; }
.mp-thumb-placeholder { width: 100%; height: 100%; background: #e5e7eb; display: block; }
.mp-prod-title { font-size: 21px; font-weight: 600; margin: 20px 12px; }
.mp-prod-title a { color: #111827; text-decoration: none; font-size: 21px !important;}
.mp-prod-title a:hover { opacity: 0.7; }
.mp-prod-actions { margin: 0 12px 12px; }
.mp-prod-actions .mp-remove-item {
  appearance: none; border: 1px solid #e5e7eb; background: #f9fafb; padding: 6px 10px; border-radius: 0; font-size: 13px; cursor: pointer;
}
.mp-prod-actions .mp-remove-item:hover { background: #f3f4f6; border-color: #d1d5db; }

/* ===== Media queries ===== */
@media (max-width: 1200px) {
  .mp-projects-grid { grid-template-columns: repeat(3, 1fr); }
  .mp-products-grid  { grid-template-columns: repeat(3, 1fr); }
}

/* asigură context pentru poziționare + loc pentru X */
.mp-modal-inner {
  position: relative !important;
  padding: 16px 16px 16px 16px !important; /* spațiu în dreapta pentru X */
}

/* butonul X în colțul dreapta-sus */
.mp-close-x {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--mp-border) !important;
  background: var(--mp-gray-50) !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--mp-black) !important;
  cursor: pointer !important;
  z-index: 2 !important;
}
.mp-close-x:hover {
  background: var(--mp-gray-100) !important;
  border-color: #d1d5db !important;
}
.mp-close-x svg { pointer-events: none !important; }


/* Layout modal select: 
   rând 1 -> [select] [salvează]
   rând 2 -> [— sau —] (span 2)
   rând 3 -> [Adaugă proiect] (span 2, centrat)
*/
.mp-select-grid {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 10px !important;
  align-items: center !important;
}

/* rând 1 */
.mp-select-grid .mp-select-wrap { grid-column: 1 !important; }
.mp-select-grid .mp-save { grid-column: 2 !important; }

/* rând 2: separator */
.mp-select-grid .mp-or {
  grid-column: 1 / -1 !important;
  text-align: center !important;
  color: #000 !important;
  opacity: .65 !important;
  font-size: 13px !important;
}

/* rând 3: buton Adaugă proiect */
.mp-select-grid .mp-open-create {
  grid-column: 1 / -1 !important;
  justify-self: center !important;
}

/* cartea trebuie să fie context de poziționare */
.mp-prod-card { position: relative !important; }

/* buton „coș” peste imagine (dreapta-sus) */
.mp-remove-icon {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 5 !important;

  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: 1px solid #EB2626 !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.85) !important;
  color: #EB2626 !important;
  cursor: pointer !important;
  padding: 0 !important;
}

.mp-remove-icon:hover {
  background: rgba(255,255,255,0.95) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.08) !important;
}
.mp-remove-icon svg { pointer-events: none !important; }

/* container butoane sub titlu */
/* butoanele sub titlu pe UN SINGUR RÂND */
.mp-prod-cta {
  display: flex !important;
  gap: 8px !important;
  margin: 0 12px 12px !important;
  flex-wrap: nowrap !important;     /* <— nu mai permite wrap */
  align-items: stretch !important;
}

.mp-prod-cta .mp-btn {
  flex: 1 1 0 !important;           /* ambele ocupă 50% din lățime */
  min-width: 0 !important;          /* permite micșorarea */
  text-align: center !important;
  white-space: nowrap !important;   /* nu rupe pe două rânduri */
  overflow: hidden !important;      /* dacă e prea lung pe ecrane mici… */
  text-overflow: ellipsis !important; /* …arată „…” */
  box-sizing: border-box !important;
}

/* opțional: pe ecrane foarte înguste, micșorează fontul puțin */
@media (max-width: 360px) {
  .mp-prod-cta .mp-btn { font-size: 12px !important; padding: 7px 10px !important; }
}


/* buton base */
.mp-btn {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
}

/* accent (brand) */
.mp-btn--accent {
  background: #bfa793 !important;
  border-color: #bfa793 !important;
  color: #fff !important;
}
.mp-btn:hover { opacity: .7 !important; }

/* ghost (outlined) */
.mp-btn--ghost {
  background: #fff !important;
  border-color: #000 !important;
  color: #000 !important;
}
.mp-btn--ghost:hover {
  background: #000 !important;
  color: #fff !important;
}

/* disabled */
.mp-btn--disabled {
  background: #f3f4f6 !important;
  border-color: #e5e7eb !important;
  color: #9ca3af !important;
}

/* Mesaje de status (success / error) */
.mp-status,
.mp-modal-status {
  display: block !important;
  padding: 8px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  margin-top: 6px !important;
  color: #111 !important; /* default neutru */
  background: transparent !important;
  border-color: transparent !important;
}

/* SUCCES (verde) */
.mp-status.is-success,
.mp-modal-status.is-success {
  color: #065f46 !important;            /* verde închis */
  background: #ecfdf5 !important;       /* verde pal */
  border-color: #a7f3d0 !important;     /* contur verde */
}

/* EROARE (roșu) */
.mp-status.is-error,
.mp-modal-status.is-error {
  color: #991b1b !important;            /* roșu închis */
  background: #fef2f2 !important;       /* roșu pal */
  border-color: #fecaca !important;     /* contur roșu */
}


/* status bar în modale: text stânga, link dreapta */
.mp-modal-status {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

/* link „Vezi proiectele →” */
a.mp-status-link {
  margin-left: auto !important;
  text-decoration: none !important;
  color: #000 !important;
  font-weight: 600 !important;
  font-size: 13px !important; 
  white-space: nowrap !important;
}
a.mp-status-link:hover { opacity: .85 !important; }

.mp-notice.mp-notice--auth{padding:12px 14px;border:1px solid #e5e7eb;border-radius:8px;background:#f9fafb;font-size:14px}
.mp-notice.mp-notice--auth .mp-link{font-weight:600;color:#7F604B;text-decoration:none; font-size: 14px;}
.mp-notice.mp-notice--auth .mp-link:hover{opacity:.85}

/* Pagination */
.mp-pagination{
  display:flex !important;
  gap:8px !important;
  align-items:center !important;
  justify-content:center !important;
  margin-top:24px !important;
  flex-wrap:wrap !important;
}
.mp-pagination .mp-page,
.mp-pagination .mp-page.active,
.mp-pagination .mp-page.disabled {
  min-width:36px !important;
  padding:8px 10px !important;
  border:1px solid #e5e7eb !important;
  border-radius:8px !important;
  background:#fff !important;
  color:#000 !important;
  text-decoration:none !important;
  text-align:center !important;
  font-size:13px !important;
  line-height:1 !important;
}
.mp-pagination .mp-page:hover{
  background:#f3f4f6 !important;
  border-color:#d1d5db !important;
}
.mp-pagination .mp-page.active{
  background:#7F604B !important;
  border-color:#7F604B !important;
  color:#fff !important;
  pointer-events:none !important;
}
.mp-pagination .mp-page.disabled{
  opacity:.5 !important;
  pointer-events:none !important;
}
.mp-pagination .mp-ellipsis{ padding:0 4px !important; }


.mp-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-direction: column;}
.mp-header-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content: end; width: 100%;}
.mp-search { display:flex; gap:0px; align-items:center; }
.mp-search input[type="text"]{
  padding: 8px 10px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px 0px 0px 8px !important;
  min-width: 220px !important;
  background: #fff !important;
}

.mp-search input[type="text"]+button[type="submit"]{
    border-radius: 0px 8px 8px 0px !important;
}
.mp-btn--secondary{ background:#f9fafb !important; border:1px solid #e5e7eb !important; color:#000 !important; }


@media screen and (max-width: 768px){
    .mp-header{
        flex-direction: column;
    }
    
    .mp-projects-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 10px;
        
    }
    
    .mp-products-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 10px;
        width: 100% !important;
    }
    
    .mp-header h3{
        text-align: center;
    }
    
    .mp-header-actions{
        flex-direction: column;
    }
    
    
    .mp-title a, .mp-title, .mp-prod-title a, .mp-prod-title{
        font-size: 14px !important;
    }
    
    .mp-prod-title{
        margin: 10px !important;
    }
    
    .mp-project-head {
        flex-direction: column;
    }
    
    .mp-card-body{
        padding: 10px;
        justify-content: space-between;
        height: 100%;
    }
    
    .mp-prod-card{
        justify-content: space-between;
    }
    
    .mp-prod-cta{
        margin: 10px !important;
    }
    
    .mp-project-head, .mp-header{
        margin-top: 30px !important;
    }
}