/* Mercado y hogar: capture first, details when needed. */
.grocery-catalog-items{display:grid;gap:12px;max-height:48vh;overflow-y:auto;overscroll-behavior:contain;padding:2px}
.grocery-catalog-item{border:1px solid #cedbef;border-radius:12px;padding:14px;min-width:0;overflow-wrap:anywhere}
.grocery-catalog-item>.check{min-height:44px;align-items:center}
.grocery-catalog-item input[type=checkbox]{width:22px;height:22px;flex-shrink:0}
.grocery-catalog-item small{display:block;color:var(--muted)}
.grocery-catalog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:white;padding:12px 0}
#groceryCatalog{margin-top:12px;min-height:44px}
.grocery-catalog-items [hidden],.grocery-catalog-item[hidden]{display:none!important}
.grocery-origin{display:block;font-size:12px;font-weight:600;color:#315487;margin-bottom:8px}
.grocery-origin:empty{display:none}
#groceryForm .grocery-actions{flex-wrap:wrap}
#groceryForm .grocery-actions #groceryRunning{display:grid;gap:3px;margin-right:auto;min-width:0}
#groceryRunning strong{font-size:26px;overflow-wrap:anywhere}
#groceryRunning span,#groceryRunning small{font-size:12px;color:var(--muted)}
.grocery-recap{background:#f7faff;border:1px solid #c6d8ef;border-radius:16px;padding:20px;margin-bottom:20px;overflow-wrap:anywhere}
.grocery-recap h2{font-size:22px;line-height:1.4}
.grocery-recap .money-expense{color:#b42318}
.grocery-recap .money-income{color:#067647}
.grocery-recap li{margin:8px 0}
#groceryForm input[readonly]{background:#f5f7fb;border-color:transparent}
@media(max-width:760px){
 #groceryForm.is-shopping .grocery-actions{display:grid;grid-template-columns:1fr 1fr;bottom:calc(72px + env(safe-area-inset-bottom));gap:8px}
 #groceryForm.is-shopping .grocery-actions #groceryRunning{grid-column:1/-1;width:100%;grid-template-columns:1fr auto;align-items:center}
 #groceryRunning small{grid-column:1/-1}
 #groceryForm.is-shopping .grocery-actions>div:not(#groceryRunning):not(#grocerySaveFeedback){grid-column:1/-1;grid-row:3;flex-wrap:wrap}
 #groceryForm.is-shopping .grocery-actions #grocerySaveState{max-width:none;flex:1;overflow-wrap:anywhere}
 #groceryForm.is-shopping .grocery-actions button{font-size:12px;padding:10px;min-width:0}
 .grocery-recap{padding:14px}
}
.grocery-home,.grocery-welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;background:#f0f7ff;border:1px solid #bed7fa;border-radius:18px;padding:24px;margin-bottom:24px}
.grocery-home h2,.grocery-welcome h2{margin:6px 0 10px;font-size:22px;color:#012268}
.grocery-home p,.grocery-welcome p{max-width:650px;line-height:1.6}
.grocery-home-actions{display:grid;gap:10px;flex-shrink:0}
.grocery-welcome>a{flex-shrink:0}
.grocery-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:0;list-style:none;margin:0 0 24px}
.grocery-steps li{display:flex;gap:10px;align-items:flex-start;font-size:14px;font-weight:700;line-height:1.4}
.grocery-steps b{display:grid;place-items:center;background:#eaf2ff;color:#012268;border-radius:50%;width:28px;height:28px;flex-shrink:0}
.grocery-steps small{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:4px}
.grocery-capture{margin-bottom:0!important;border-color:#96b9ed;background:#f7faff}
.grocery-capture>label{font-weight:700;font-size:18px}
.grocery-quick{display:flex;gap:10px;margin-top:12px}
.grocery-quick input{min-width:0;flex:1;font-size:16px;min-height:46px}
.grocery-quick button{flex-shrink:0}
#groceryAdded:empty{display:none}
.grocery-settings{margin-bottom:0!important;padding:16px 20px!important}
.grocery-settings summary,.grocery-item-details summary,.grocery-history summary{cursor:pointer;font-size:14px;font-weight:600;color:#012268;padding:6px 0}
.grocery-settings .grocery-fields,.grocery-item-details .grocery-fields{margin-top:18px}
.grocery-mode{display:flex;align-items:center;justify-content:space-between;gap:18px}
.grocery-mode h2{margin:4px 0}
.grocery-mode button{flex-shrink:0}
#groceryMode[aria-pressed=true]{background:#e9f2ff;border-color:#5d88c5}
.grocery-budget{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px}
.grocery-budget>div{padding:16px 20px;border:1px solid var(--line);border-radius:14px;background:white;display:grid;gap:6px}
.grocery-budget span,.grocery-budget small{font-size:12px;color:var(--muted)}
.grocery-budget strong{font-size:23px}
.grocery-empty{padding:24px;border:1px dashed #b9cbe3;border-radius:14px;color:var(--muted);line-height:1.6}
#groceryItems{display:grid;gap:12px}
#groceryForm .grocery-item{min-width:0;margin:0;padding:18px;background:white;border-radius:14px}
.grocery-item-top{display:flex;align-items:center;gap:12px}
.grocery-item-top>.field{flex:1;min-width:0}
.grocery-item-top .field input{font-weight:600}
.grocery-item-top button{flex-shrink:0;min-height:44px}
.grocery-item-details{margin-top:12px}
.grocery-item-details summary span{display:block;font-size:12px;font-weight:400;color:var(--muted);margin:4px 0 0 16px}
#groceryForm:not(.is-shopping) .grocery-cart{display:none}
#groceryForm .grocery-cart{margin:16px 0 0;min-height:44px}
#groceryForm .grocery-cart input{width:20px;height:20px;accent-color:#012268}
#groceryForm .grocery-actual{margin-top:12px;padding-top:12px}
#groceryForm [data-line-total]:empty{display:none}
#groceryForm .grocery-item.in-cart{border-color:#80a5d7}
#groceryForm .grocery-actions{position:sticky;bottom:16px;z-index:3;border:1px solid #c6d8ef;background:#fff;padding:14px 18px;border-radius:16px;box-shadow:0 6px 24px #01226818;justify-content:space-between;align-items:center}
.grocery-actions>div{display:flex;align-items:center;gap:14px}
#grocerySaveState{font-size:12px;color:var(--muted)}
.grocery-actions [hidden],#groceryForm [hidden]{display:none!important}
.grocery-list-card h3{font-size:20px;overflow-wrap:anywhere;margin:16px 0 8px}
.grocery-list-card>strong{display:block;font-size:23px;margin-top:16px}
.grocery-preview{overflow-wrap:anywhere}
.grocery-history>.grocery-lists{margin-top:20px}
.grocery-list-card .row{flex-wrap:wrap}
@media(max-width:760px){
 .layout:not(.guest) .sidebar nav{grid-template-columns:repeat(6,minmax(0,1fr))}
 .layout:not(.guest) .sidebar .nav-link{font-size:9px;overflow-wrap:normal}
 .grocery-home,.grocery-welcome{display:block;padding:20px}
 .grocery-home-actions{margin-top:16px}
 .grocery-welcome>a{display:inline-flex;margin-top:10px}
 .grocery-steps{gap:10px}
 .grocery-steps li{font-size:11px;display:block}
 .grocery-steps b{margin-bottom:8px}
 .grocery-steps small{font-size:10px}
 .grocery-mode{display:block}
 .grocery-mode button{width:100%;margin:8px 0}
 .grocery-quick{flex-wrap:wrap}
 .grocery-quick input{flex-basis:190px}
 .grocery-quick button{flex-grow:1}
 #groceryForm .grocery-actions{bottom:calc(78px + env(safe-area-inset-bottom));padding:12px;gap:10px;flex-direction:column;align-items:stretch}
 .grocery-actions>div{justify-content:space-between}
 .grocery-actions button{min-height:44px}
 #grocerySaveState{max-width:110px}
 #groceryForm .grocery-item{padding:14px}
 .grocery-item-top{gap:6px}
 .grocery-item-top>.quiet{padding:8px}
}


.grocery-name .field{margin:0}.grocery-name p{margin:10px 0 0}.grocery-name input{font-size:18px;font-weight:600;max-width:100%;min-width:0}.grocery-name{margin-bottom:0!important}.grocery-name input:focus{outline:2px solid #0480fa;outline-offset:2px}

.grocery-list-title{overflow-wrap:anywhere}
.grocery-save-feedback{flex:1 0 100%;display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid #b2dec6;border-radius:12px;background:#edf9f1;color:#155e38;min-width:0}.grocery-save-feedback[hidden]{display:none!important}.grocery-save-feedback>div{min-width:0}.grocery-save-feedback strong{display:block;font-size:17px;line-height:1.4;color:#155e38}.grocery-save-feedback span:not(.grocery-save-check){display:block;margin-top:3px;font-size:12px;overflow-wrap:anywhere}.grocery-save-check{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;border-radius:50%;background:#167447;color:#fff;font-weight:800}.grocery-actions .grocery-is-saved{background:#167447;border-color:#167447;color:#fff}.grocery-actions .grocery-is-saved:hover{background:#105b35}#grocerySaveState{overflow-wrap:anywhere}
.grocery-actions>.grocery-save-feedback{justify-content:flex-start;width:100%;grid-column:1/-1;grid-row:1}
@media(max-width:760px){.grocery-actions>.grocery-save-feedback{flex:none}}
