/* Fixed responsive image frame: preserve the full uploaded image without cropping or stretching. */
body.storefront-modern .item-image{
    width:100% !important;
    height:clamp(160px,16vw,215px) !important;
    aspect-ratio:auto !important;
    display:block !important;
    padding:10px !important;
    box-sizing:border-box !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#fff !important;
    border-bottom:1px solid var(--store-line) !important;
    transform:none !important;
    transition:none !important;
}
body.storefront-modern .item-card:hover .item-image{
    transform:none !important;
}
body.storefront-modern .item-card:not(:has(.item-image)) .item-summary::before{
    height:clamp(160px,16vw,215px) !important;
    aspect-ratio:auto !important;
    box-sizing:border-box !important;
    background:#fff !important;
}
body.storefront-modern .item-card.open .item-image{
    height:220px !important;
    aspect-ratio:auto !important;
    object-fit:contain !important;
}
@media(max-width:800px){
    body.storefront-modern .item-image,
    body.storefront-modern .item-card:not(:has(.item-image)) .item-summary::before{
        height:clamp(125px,34vw,170px) !important;
        aspect-ratio:auto !important;
        padding:7px !important;
    }
    body.storefront-modern .item-card.open .item-image{
        height:180px !important;
    }
}
@media(max-width:420px){
    body.storefront-modern .item-image,
    body.storefront-modern .item-card:not(:has(.item-image)) .item-summary::before{
        height:128px !important;
        padding:6px !important;
    }
}

/* Clean catalog detail modal: cards open preview instead of adding directly */
.item-card.customer-search-card .item-body,
.item-card.customer-search-card .item-caret,
.item-card.customer-search-card .quick-price-line .qty-controls{display:none!important}
.item-card.customer-search-card .item-summary{cursor:pointer!important}
.item-card.customer-search-card.open{grid-column:auto!important}
.catalog-detail-backdrop{position:fixed;inset:0;z-index:99995;display:none;align-items:center;justify-content:center;padding:10px;background:rgba(15,23,42,.64);backdrop-filter:blur(8px)}
.catalog-detail-backdrop.open{display:flex}
.catalog-detail-card{width:min(430px,94vw);max-height:88vh;overflow:auto;border:1px solid #e5e7eb;border-radius:22px;background:#fff;box-shadow:0 26px 80px rgba(15,23,42,.34)}
.catalog-detail-head{position:sticky;top:0;z-index:4;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#fff}
.catalog-detail-head h3{margin:0;color:#0f172a;font-size:18px;line-height:1.2}
.catalog-detail-close{width:34px;height:34px;flex:0 0 auto;border:0;border-radius:50%;background:#fee2e2;color:#991b1b;font-size:20px;font-weight:1000;cursor:pointer}
.catalog-detail-body{padding:12px;background:linear-gradient(180deg,#fff,#f8fafc)}
.catalog-detail-image-frame{width:100%;aspect-ratio:16/10;max-height:165px;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid #e5e7eb;border-radius:18px;background:#fff}
.catalog-detail-image-frame img{width:100%;height:100%;display:block;object-fit:contain;object-position:center;padding:7px;box-sizing:border-box}
.catalog-detail-image-empty{font-size:52px;color:#94a3b8}
.catalog-detail-description{margin:10px 0 0;color:#475569;font-size:13px;font-weight:700;line-height:1.5;white-space:pre-line}
.catalog-detail-price{display:inline-flex;margin-top:9px;border-radius:999px;padding:7px 11px;background:#111827;color:#fff;font-size:13px;font-weight:1000}
.catalog-detail-options{display:grid;gap:7px;margin-top:10px}
/* Desktop floating card: keep normal products fully visible.
   No internal variation slider unless there are more than 4 options. */
@media(min-width:641px){
    .catalog-detail-backdrop{padding:18px}
    .catalog-detail-card{
        width:min(520px,94vw);
        max-height:calc(100vh - 36px);
        overflow:auto;
        display:flex;
        flex-direction:column;
    }
    .catalog-detail-head{flex:0 0 auto}
    .catalog-detail-body{
        flex:0 1 auto;
        overflow:visible;
        padding:12px 14px;
    }
    .catalog-detail-image-frame{
        aspect-ratio:16/8;
        max-height:140px;
        min-height:118px;
    }
    .catalog-detail-description{
        margin-top:8px;
        font-size:13px;
        line-height:1.42;
    }
    .catalog-detail-price{margin-top:7px}
    .catalog-detail-options{margin-top:9px;gap:7px;overflow:visible;max-height:none}
    .catalog-detail-option{padding:8px 9px}
    .catalog-detail-option strong{font-size:13.5px}
    .catalog-detail-option small{font-size:12px;line-height:1.25}
    .catalog-detail-footer{flex:0 0 auto}
    .catalog-detail-card.has-many-options .catalog-detail-options{
        max-height:260px;
        overflow-y:auto;
        overflow-x:hidden;
        padding-right:4px;
    }
}
@media(max-width:640px){
    .catalog-detail-card{
        max-height:92vh;
    }
    .catalog-detail-image-frame{
        max-height:135px;
        aspect-ratio:16/9;
    }
    .catalog-detail-description{
        font-size:12.5px;
        line-height:1.38;
        margin-top:8px;
    }
    .catalog-detail-options{
        overflow:visible;
        max-height:none;
    }
    .catalog-detail-card.has-mobile-many-options .catalog-detail-options{
        max-height:205px;
        overflow-y:auto;
        overflow-x:hidden;
        padding-right:4px;
        overscroll-behavior:contain;
    }
}
.catalog-detail-option{display:flex;align-items:center;gap:9px;border:1px solid #e2e8f0;border-radius:13px;background:#fff;padding:9px;cursor:pointer}
.catalog-detail-option.active{border-color:#2563eb;background:#eff6ff;box-shadow:0 8px 20px rgba(37,99,235,.10)}
.catalog-detail-option input{accent-color:#2563eb}
.catalog-detail-option strong{display:block;color:#0f172a;font-size:14px}
.catalog-detail-option small{display:block;margin-top:3px;color:#64748b;font-weight:800}
.catalog-detail-footer{position:sticky;bottom:0;z-index:4;display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid #e5e7eb;background:#fff}
.catalog-detail-qty{display:flex;align-items:center;gap:5px;padding:3px;border:1px solid #dbe3ef;border-radius:999px;background:#fff}
.catalog-detail-qty button{width:32px;height:32px;border:0;border-radius:50%;background:#111827;color:#fff;font-size:18px;font-weight:1000;cursor:pointer}
.catalog-detail-qty span{min-width:32px;text-align:center;font-weight:1000}
.catalog-detail-add{flex:1;min-height:39px;border:0;border-radius:13px;background:linear-gradient(135deg,#16a34a,#22c55e);color:#fff;font-weight:1000;cursor:pointer}
.catalog-detail-add:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:640px){.catalog-detail-backdrop{padding:9px}.catalog-detail-card{border-radius:22px;max-height:94vh}.catalog-detail-head h3{font-size:19px}.catalog-detail-body{padding:12px}.catalog-detail-footer{padding:10px 12px}}
