

/*
.ag-mm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
*/

.ag-mm-filter-label {
  display:none;
}
.ag-mm-filter-cats {
  margin-left:-5px; margin-right:-5px;
}
body.page-id-1768 .ag-mm-filter-cats, body.page-id-1768 .ag-mm-category {
  display:none;
}
.ag-mm-filter-cats button {
  margin-bottom:5px; margin-top:5px;
}

/* the container that JS fills */
.ag-mm-list{
  display: block; 
  margin-bottom:2rem;
}

/* category headings */
.ag-mm-list > h2.ag-mm-category {
  padding: 1.5rem 0 .75rem;
  padding-top:2rem; padding-bottom:0px;
  background-color:#FFF;
  margin-bottom:0px; padding-left:40px;

  font-size: var(--h6_typography-font-size);
  font-weight: var(--h6_typography-font-weight);
    line-height: var(--h6_typography-line-height);
    letter-spacing: var(--h6_typography-letter-spacing);
    text-transform: var(--h6_typography-text-transform);
    font-style: var(--h6_typography-font-style, normal);
    font-weight:800 !important;
    height:30px; text-transform:uppercase;
}

/* grid per category */
.ag-mm-category-container{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 2rem; /* space after each category */
  background:#FFFFFF;
  padding-left:40px; padding-right:40px;
  padding-top:30px; padding-bottom:30px;
  padding-top:2rem; padding-bottom:2rem;
}

/* each card */
.ag-mm-item{
  background: #fff;
  /*
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border-radius: 4px; */
  /*  border:solid 1px #c7c8c7; */
}

/* responsive: collapse to 2 then 1 */
@media (max-width: 960px){
  .ag-mm-category-container{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){
  .ag-mm-category-container{
    grid-template-columns: 1fr;
  }
}





  
  /* Four columns, all with background */
  .ag-mm-item {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0rem;
    /* overflow:hidden; */
    position: relative;  
    height: 100%;
  min-height: clamp(360px, 40vw, 520px);
    /* background-color:#e6e6e3; */
    background-color:#e8e2db;
  }

  /* reimburseement */
  body.page-id-1768 .ag-mm-item {
    min-height: clamp(250px, 20vw, 520px);
  }
  
  .ag-mm-thumb{
    width: 100%;
    aspect-ratio: 4 / 5;          
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 20px 20px 0 20px; /* left, right, top = 20px */
  }
  
  .ag-mm-thumb img{
    display: block;
    /*
    width: 100%;
    height: 100%;                
    object-fit: contain;            
    border:solid 1px #c7c8c7; */
    max-width: calc(100% - 2px);   /* subtract border so it won't overflow */
    max-height: calc(100% - 2px);
    width: auto;
    height: auto;
    border: 1px solid #c7c8c7;
    object-fit: unset;             /* or remove it */
    cursor:pointer;
  }
  
  .ag-mm-desc {
    padding:1rem; 
    min-height: 0; 
    overflow:hidden; 
  }
  .ag-mm-desc span.oro {
    display:block; font-size:smaller;
  }
  .ag-mm-desc h2 {
    margin-top:0px;
    line-height:1.3;
  }
  /* reimbursement */
  body.page-id-1768 .ag-mm-desc h2 {
    margin-bottom:8px;
  }
  .ag-mm-code {
    font-size:smaller; 
    margin-bottom:var(--h2_typography-margin-bottom);
  }
  /* reimbursement */
  body.page-id-1768 .ag-mm-code {
    font-weight:bold;
  }

  .ag-mm-actionwrapper{
    padding: 0 1rem 1rem; /* optional, keeps buttons off the edges */
  }

  /* Download & action sections */
  .ag-mm-download,
  .ag-mm-action {
    display: flex;
    flex-direction: row; /* column; */
    gap: 0.5rem;
  }
  
  /* Base button style */
  .ag-mm-btn {
    width: max-content;
    line-height: 1.375;
    font-weight: 400;
    text-decoration: none;
    color: #14706A;
    text-transform: capitalize;
    text-align: center;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.3125rem;
    background-color: #F1FAF3;
    outline-color: #F1FAF3;
    border: none;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
  }
  
  /* Primary actions (download, external, print) */
  .ag-mm-btn-download,
  .ag-mm-btn-external,
  .ag-mm-btn-print {
    background-color: #14706A;
    color: #D8EEDA;
    font-size:20px; text-decoration:none !important;
    border:solid 1px #14706A !important; 
  }
  
  /* Hover state */
  .ag-mm-btn:hover {
    color: #14706A !important;
  }
  
  /* Print form */
  .ag-mm-print-form {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ddd;
  }
  
  .ag-mm-field {
    margin-bottom: 0.5rem;
  }
  
  .ag-mm-field label {
    display: block;
    margin-bottom: 0.25rem;
  }
  
  .ag-mm-field select,
  .ag-mm-field input[type="text"] {
    width: 100%;
    max-width: 220px;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #ccc;
  }

  .ag-mm-qty-other {
    margin-top: 0.25rem;
  }

  .ag-mm-actions input {
    padding-left:10px !important; padding-right:10px !important;
  }
  

  /* Mobile stacking */
  @media (max-width: 768px) {
    .ag-mm-item {
      grid-template-columns: 1fr;
    }
  
    .ag-mm-download,
    .ag-mm-action {
      flex-direction: row;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
  
    .ag-mm-print-form {
      flex-basis: 100%;
    }
  }
  
  /* Filter containers */
  /*
.ag-mm-filters {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
} */
/*
.ag-mm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
*/

.ag-mm-filter-label {
  font-weight: 600;
  color: #14706A;
  margin-right: 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}


/* --- FILTER BUTTONS --- */
/*
.ag-mm-filter-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #C7E5D1;
  background-color: #FFFFFF;
  color: #14706A;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.3;
  transition: all 0.25s ease;
  box-shadow: none;
}
.ag-mm-filter-btn:hover {
  background-color: #E9F7EC;
  border-color: #A7D4B7;
}
.ag-mm-filter-btn.is-active {
  background-color: #14706A;
  color: #D8EEDA;
  border-color: #14706A;
}
.ag-mm-filter-btn.is-active:hover {
  background-color: #0F5A56;
  border-color: #0F5A56;
}
*/
/* Make rows scrollable on tiny screens */
/*
@media (max-width: 480px) {
  .ag-mm-filter-row {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.25rem;
  }
}
*/



.ag-mm-logout-wrap {
  text-align: right;
  margin-bottom: 1rem;
  display:none;
}

.ag-mm-logout-btn{
  background: none;
  border: none;
  padding: 0;
  margin: 0;

  color: #7e8384;
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 2px;

  cursor: pointer;
}

.ag-mm-logout-btn:hover{
  color: #124b4f;
}



.ag-mm-login {
  max-width: 400px;
  margin: 0 auto 2rem auto;
  padding: 2rem;
  background-color: #FFFFFF;
}

.ag-mm-login h2 {
  /* color: #14706A; */
  text-align: center;
  margin-bottom: 1rem;
}

.ag-mm-login label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  /* color: #14706A; */
}

.ag-mm-login input[type="text"],
.ag-mm-login input[type="password"] {
  width: 100%;
  /* padding: 0.5rem;
  border: 1px solid #C7E5D1;
  background-color:#FFF;
  border-radius: 0.375rem; */
  margin-bottom: 1rem;
  font-size: 1rem;
}

.ag-mm-login input[type="submit"] {
  /* background-color: #14706A;
  color: #D8EEDA;
  border: 1px solid #14706A;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem; */
  cursor: pointer;
  /* width: 100%; */
  /* transition: all 0.3s ease;
  font-size: 1rem; */
}

.ag-mm-login p.login-submit {
  margin-bottom:0px !important; padding-bottom:0px !important;
}

.ag-mm-login input[type="submit"]:hover {
  /* background-color: #0F5A56;
  border-color: #0F5A56; */
}

.ag-mm-login-error {
  color: rgb(167, 74, 74) !important;
}

/* download button */


.ag-mm-actionwrapper{
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: .75rem;
  position: relative;
  z-index: 2;
}

.ag-mm-btn-download,.ag-mm-btn-external,.ag-mm-btn-print{
  font-size: 0;       /* nukes text size */
  line-height: 0;
  color:transparent;
}

.ag-mm-btn-download, .ag-mm-btn-external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* width: 24px;
  height: 30px; */
  width:17px;
  height:22px;
  background: url("download-icon-v2.png") no-repeat center / contain;
  color: transparent;          /* hides text */
  border:none !important; border-radius:0px;
}

.ag-mm-btn-download:hover, .ag-mm-btn-external:hover {
  background-image: url("download-icon-ro-v2.png");
}

/* Outlook / scheduling links */
.ag-mm-btn-external[href*="outlook.office.com"], .ag-mm-btn-download[href*="outlook.office.com"] { 
  background-image: url("schedule-icon-v3.png");
}

.ag-mm-btn-external[href*="outlook.office.com"]:hover, .ag-mm-btn-download[href*="outlook.office.com"]:hover {
  background-image: url("schedule-icon-ro-v3.png");
}


.ag-mm-customschedule {
  background-image:url("schedule-icon-v3.png");
  display:block;
  background-size:24px auto;
  background-repeat:no-repeat;
  margin-bottom:20px;
  padding:20px; padding-left:70px; padding-right:70px; padding-top:20px;
  margin:0 auto;
  background-color:#FFF;
  background-position-x:30px; background-position-y:45px;
  text-align:left;
  margin-top:1rem; margin-bottom:2.5rem;
}
.ag-mm-customschedule:hover {
  background-image:url("schedule-icon-ro-v3.png");
}
.ag-mm-customschedule label, .reimbursement_steps h6 {
  display:block; text-align:center;
  font-size: var(--h6_typography-font-size);
  font-weight: var(--h6_typography-font-weight);
    line-height: var(--h6_typography-line-height);
    letter-spacing: var(--h6_typography-letter-spacing);
    text-transform: var(--h6_typography-text-transform);
    font-style: var(--h6_typography-font-style, normal);
    font-weight:800 !important;
    height:30px; text-transform:uppercase;   
}

.reimbursement_steps {
  display:block;
  /* border:solid 1px #c7c8c7; */
  padding:20px; padding-top:20px;
  margin:0 auto;
  background-color:#FFF;
  margin-top:1rem; margin-bottom:2.5rem;
}
.reimbursement_steps h6 {
  margin-top:0px; padding-top:0px;
  height:auto;
  color: rgb(42, 117, 122) !important;
}
/* Container: stacked by default (mobile-first) */
.reimbursement_steps .reimb_small2{
  display: grid;
  grid-template-columns: 1fr;
  font-weight:800;
  gap:12px;
}

/* Each step box (your current structure has: .reimb_small > div > div) */
.reimbursement_steps .reimb_small2 > div > div{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon sizing:
   - default mobile: small-ish, scales down nicely
   - desktop: aim for 50px, but cap at 12.5% of the step width (1/8)
*/
.reimbursement_steps .reimb_small2 img{
  width: clamp(32px, 25%, 50px);
  height: auto;
  flex: 0 0 auto;
  display: block;
}

/* Text: keep it as one flowing block */
.reimbursement_steps .reimb_small2 > div > div{
  line-height: 1.25;
}

/* Desktop: 3 columns side-by-side */
@media (min-width: 960px){
  .reimbursement_steps .reimb_small2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
}


/* push schedule/outlook button to the left, keep others on the right */
/*
.ag-mm-actionwrapper .ag-mm-download:has(a[href*="outlook.office.com"]) {
  margin-right: auto;
}

.ag-mm-btn-download[href*="outlook.office.com"],
.ag-mm-btn-external[href*="outlook.office.com"] {
  width: auto;
  height: auto;
  min-height: 30px;
  background-position: left top;
  background-size: 24px 30px;
  background-repeat: no-repeat;
  padding-left: 34px;   
  color: transparent;   
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
}

.ag-mm-btn-download[href*="outlook.office.com"]::after,
.ag-mm-btn-external[href*="outlook.office.com"]::after {
  content: "Schedule Procedure Review";
  display: block;
  line-height: 1;
  width:50px;
  height:23px;
  font-size:10px;
  text-align:left;
  position: relative;
  transform: translateY(-5px);
}
*/



.ag-mm-btn-print{
  appearance: none;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;     /* touch-friendly */
  height: 30px;
  background: url("orderprints-icon-v2.png") no-repeat center / contain;
  color: transparent;     /* hide label visually */
  border: none !important;
  padding: 0;
  cursor: pointer;
  border-radius:0px;
}

.ag-mm-btn-print:hover{
  background-image: url("orderprints-icon-ro-v2.png");
}

.ag-mm-print-form{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;              /* anchor to bottom of card */
  z-index: 5;

  background: #fff;
  padding: 1rem;

  /* max-height: 70%;    */    /* prevents it from covering the whole card */
  overflow: auto;         /* scroll inside the form if needed */
}

.closeform{
  position: absolute;
  top: .5rem;
  right: .5rem;
}

.closeform a{
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
  cursor: pointer;
}

.closeform a::before,
.closeform a::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: #333;
  transform-origin: center;
}

.closeform a::before{
  transform: translate(-50%, -50%) rotate(45deg);
}

.closeform a::after{
  transform: translate(-50%, -50%) rotate(-45deg);
}

.closeform a:hover::before,
.closeform a:hover::after{
  background: #000;
}


.ag-mm-btn-copy{
  /* background: none;
  border: none;
  padding: 0;
  width: 24px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #7e8384; */

  appearance: none;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* width: 24px;    
  height: 30px; */ 
  width:18px;
  height:22px; 
  background: url("copy-link-icon.png") no-repeat center / contain;
  color: transparent;     /* hide label visually */
  border: none !important;
  padding: 0;
  cursor: pointer;
  border-radius:0px;
}

.ag-mm-btn-copy::before{
  /*
  content: "⧉";
  font-size: 42px;
  line-height: 1;
  */
}

.ag-mm-btn-copy:hover{
  color: #124b4f;
  background: none;
  background: url("copy-link-icon-ro.png") no-repeat center / contain;
}



.ag-mm-btn-copy.is-copied::before {
  content: "COPIED";
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transform: rotate(-45deg);
  display: inline-block;
}
.ag-mm-btn-copy.is-copied::before {
  transform-origin: 50% 50%;
}



.ag-mm-btn-copy.is-copied {
  transform: none; 
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}




.ag-mm-download-dropdown {
  position: relative;
}

.ag-mm-download-dropdown details {
  position: relative;
}

.ag-mm-download-dropdown summary {
  cursor: pointer;
  list-style: none;
}

.ag-mm-download-dropdown summary::-webkit-details-marker {
  display: none;
}

.ag-mm-download-menu {
  position: absolute;
  bottom:100%;
  right: 0;
  z-index: 50;
  min-width: 180px;
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  border-radius: 6px;
}

.ag-mm-download-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  white-space: nowrap;
}

.ag-mm-download-menu-item a {
  text-decoration: none;
}
