/* Only structural adaptations for linked responsive photos and live option fields.
   R3 card/bar styling is scoped in r3.css; other controls use host.css and hosta-vadibas.css. */
.am-r3 .am-card-photo,.am-r3 .am-product-photo{position:relative;overflow:hidden;display:block;width:100%}
.am-r3 .am-product-photo{aspect-ratio:1/1;border-radius:17px}
.am-r3 .am-card-photo picture,.am-r3 .am-product-photo picture{display:block;position:absolute;inset:0}
.am-r3 .am-card-photo img,.am-r3 .am-product-photo img{display:block;position:absolute;max-width:none;max-height:none;border-radius:0;object-fit:cover}
.am-r3 .am-option-label{display:block;margin:18px 0;font-size:13px;font-weight:750}
.am-r3 .am-option-label select{display:block;width:100%;padding:12px;margin-top:7px;border:1px solid #b99c73;border-radius:8px;background:#fffaf2;font:inherit;color:#4d2f13}
.am-r3 .am-extra-options{border:0;margin:20px 0 10px;padding:0;min-width:0}
.am-r3 .am-extra-options legend{font-weight:750}
.am-r3 .am-extra-options label{display:flex;align-items:start;gap:10px;margin:14px 0;font-size:13px}
.am-r3 .am-extra-options label span{flex:1;min-width:0;overflow-wrap:anywhere}
.am-r3 .am-extra-options input{flex-shrink:0;margin-top:4px}
.am-r3 .am-extra-options small{display:block;margin-top:4px;color:var(--m-muted);font-size:12px}
.am-r3 .am-extra-options b{flex-shrink:0;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.am-r3 .am-full-actions{margin-top:24px;display:flex;flex-wrap:nowrap;gap:10px}
.am-r3 .am-full-actions>.button{display:inline-flex;align-items:center;justify-content:center;flex:1;min-width:0;white-space:nowrap;text-decoration:none}
.am-r3 .am-option-picker summary{display:flex;align-items:center;gap:14px}
.am-r3 .am-option-picker summary::before{content:'▸';font-size:.8em}
.am-r3 .am-option-picker[open] summary::before{content:'▾'}
.am-r3 .am-picked-option{margin-left:auto;font-weight:400;color:var(--m-muted)}
.am-r3 .am-option-picker .visually-hidden{position:absolute;width:1px;height:1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.am-r3 .am-config-error{color:#8b2e1b}
.am-r3 .m-photo-note{padding:20px;color:var(--m-muted)}
.am-r3 .m-food-grid .m-food{position:relative}
.am-r3 .m-food-grid .m-food h3>a{color:inherit;text-decoration:none}
.am-r3 .m-food-grid .m-food h3>a:hover{text-decoration:underline}
.am-r3 .m-food-grid .m-food h3>a::after{content:'';position:absolute;inset:0;border-radius:inherit}
.am-r3 .m-food-grid .m-food h3>a:focus-visible::after{outline:2px solid #6c451c;outline-offset:-3px}
.am-r3 .m-food-grid .m-food .m-item-actions{margin-top:auto}
.am-r3 .m-food-grid .m-food .m-save{position:relative;z-index:1}
.am-r3 .m-food-grid .m-food h3+.m-real-price{padding-top:0;margin:6px 0 8px!important}
.am-r3 .m-food-grid .m-food .r3-card-summary{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.am-r3 .am-product-photo[data-full-food-photo]{cursor:zoom-in}
.am-r3 .am-food-photo-dialog{max-width:94vw;max-height:94dvh;padding:8px;border:0;border-radius:12px;background:#fff9ed;color:#412b1a}
.am-r3 .am-food-photo-dialog::backdrop{background:#1b100de6}
.am-r3 .am-food-photo-dialog button{display:block;min-height:44px;margin:0 0 5px auto}
.am-r3 .am-food-photo-dialog img{display:block;width:auto;height:auto;max-width:calc(94vw - 16px);max-height:calc(94dvh - 65px);margin:auto;object-fit:contain}
.am-r3 .am-pairing{margin-top:16px;padding:14px;border:1px solid #e2d4c0;border-radius:12px}
.am-r3 .am-pairing .button{min-height:44px}
@media(max-width:700px){
 .am-r3 .am-mobile-product-order{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
 .am-r3 .am-mobile-product-order .r3-product-main{display:contents}
 .am-r3 .am-mobile-product-order .am-product-heading{grid-row:1}
 .am-r3 .am-mobile-product-order .am-product-heading .m-kicker{display:none}
 .am-r3 .am-mobile-product-order .am-product-heading h1{margin:0}
 .am-r3 .am-mobile-product-order .r3-price-row{grid-row:2;padding:8px 0 4px;gap:8px}
 .am-r3 .am-mobile-product-order .am-config-error{grid-row:3}
 .am-r3 .am-mobile-product-order .r3-product-photo{grid-row:4}
 .am-r3 .am-mobile-product-order .r3-product-description{grid-row:5;margin:0}
 .am-r3 .am-mobile-product-order .r3-choice-note{margin-block:0}
}

/* Food crops are separate from the full-size image viewer. */
.am-r3 .m-food > .am-card-photo[data-am-food-frame] {
  height:auto;
  aspect-ratio:4/3;
  background:#eee4d5;
}
.am-r3 figure.r3-product-photo:has([data-am-food-frame]) {
  align-self:start;
  display:grid;
  justify-items:center;
  align-content:start;
  min-width:0;
  background:transparent;
}
.am-r3 .am-product-photo[data-am-food-frame] {
  width:min(100%,var(--am-photo-limit));
  height:auto;
  aspect-ratio:var(--am-frame-ratio);
  border-radius:14px;
  background:#eee4d5;
}
.am-r3 .am-card-photo[data-am-food-frame] picture,
.am-r3 .am-product-photo[data-am-food-frame] picture {
  width:100%;
  height:100%;
}
.am-r3 [data-am-food-frame] picture img {
  display:block;
  position:absolute;
  inset:auto;
  left:var(--am-photo-x);
  top:var(--am-photo-y);
  width:var(--am-photo-w);
  height:var(--am-photo-h);
  max-width:none;
  max-height:none;
  object-fit:fill;
  margin:0;
  transform:translate(-50%,-50%) rotate(var(--am-photo-angle));
}
.am-r3 .am-food-photo-dialog picture[data-am-food-frame] {
  display:block;
  position:relative;
  overflow:hidden;
  width:min(calc(94vw - 16px),var(--am-zoom-limit));
  aspect-ratio:var(--am-frame-ratio);
}
.am-r3 .am-food-photo-dialog picture[data-am-food-frame] img {
  display:block;
  position:absolute;
  inset:auto;
  left:var(--am-photo-x);
  top:var(--am-photo-y);
  width:var(--am-photo-w);
  height:var(--am-photo-h);
  max-width:none;
  max-height:none;
  object-fit:fill;
  transform:translate(-50%,-50%) rotate(var(--am-photo-angle));
}
@media(max-width:700px) {
  .am-r3 .am-product-photo[data-am-food-frame="detail"] {
    width:100%;
    aspect-ratio:var(--am-stacked-frame-ratio);
  }
  .am-r3 .am-product-photo[data-am-food-frame="detail"] picture img {
    left:var(--am-stacked-photo-x);
    top:var(--am-stacked-photo-y);
    width:var(--am-stacked-photo-w);
    height:var(--am-stacked-photo-h);
    transform:translate(-50%,-50%) rotate(var(--am-stacked-photo-angle));
  }
  .am-r3 .am-mobile-product-order .r3-product-photo { margin-inline:0; }
}
