/* Azonos kosárablak a terméklistában és a terméklapon. */
#fancybox-wrap:has(.agrostore-popup-quote-info) {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(600px, calc(100vw - 20px)) !important;
    max-height: calc(100vh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}
#fancybox-wrap:has(.agrostore-popup-quote-info) #fancybox-outer {
    width: 100% !important;
    max-height: calc(100vh - 40px) !important;
    max-height: calc(100dvh - 40px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box;
}
#fancybox-wrap:has(.agrostore-popup-quote-info) #fancybox-content {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
#fancybox-wrap:has(.agrostore-popup-quote-info) #fancybox-content > * {
    max-width: 100%;
    box-sizing: border-box;
}
#fancybox-wrap:has(.agrostore-popup-quote-info) #fancybox-close {
    top: 0 !important;
    right: 0 !important;
}
.agrostore-popup-quote-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #b9e3c8;
    border-radius: 10px;
    background: #eef9f2;
    color: #145c2e;
    text-align: left;
    box-sizing: border-box;
}
.agrostore-popup-quote-info strong,
.agrostore-popup-quote-info small { display: block; }
.agrostore-popup-quote-info strong { font-size: 14px; line-height: 1.3; }
.agrostore-popup-quote-info small { margin-top: 3px; font-size: 12px; line-height: 1.35; color: #3d654c; }
.agrostore-popup-quote-info.has-error { border-color: #efb0b0; background: #fff4f4; color: #8e1e1e; }
.agrostore-popup-quote-error { color: #b42318 !important; font-weight: 600; margin-top: 5px !important; }
.agrostore-popup-quote-info-icon,
.agrostore-popup-quote-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.agrostore-popup-quote-info-icon svg { width: 28px; height: 28px; }
.agrostore-popup-quote-icon svg { width: 19px; height: 19px; }
.agrostore-popup-quote-info-icon svg,
.agrostore-popup-quote-icon svg {
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.agrostore-popup-actions-enhanced {
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) minmax(0, 1.35fr);
    align-items: stretch;
    gap: 10px;
    width: 100%;
}
.agrostore-popup-actions-enhanced > a,
.agrostore-popup-actions-enhanced > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px;
    margin: 0 !important;
    box-sizing: border-box;
    white-space: normal !important;
    line-height: 1.2;
}
.agrostore-popup-continue-btn { grid-column: 1; }
.agrostore-popup-quote-btn { grid-column: 2; }
.agrostore-popup-cart-btn { grid-column: 3; }
.agrostore-popup-quote-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid #159447 !important;
    border-radius: 7px;
    background: #fff !important;
    color: #087a37 !important;
    font: inherit;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}
.agrostore-popup-quote-btn:hover,
.agrostore-popup-quote-btn:focus-visible {
    background: #eef9f2 !important;
    border-color: #087a37 !important;
    color: #08642f !important;
    outline: 0;
}
.agrostore-popup-quote-btn:disabled { opacity: .72; cursor: wait; }
.agrostore-popup-quote-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: agroQuoteSpin .7s linear infinite;
    flex: 0 0 auto;
}
@keyframes agroQuoteSpin { to { transform: rotate(360deg); } }

/* A VirtueMart kapcsolódó termékeinek hosszú listája helyett kompakt ajánló.
   A rövid terméknév a tévesen társított képeknél is azonosíthatóvá teszi a cikket. */
.agrostore-popup-related-heading {
    margin: 14px 0 10px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3;
    text-align: left !important;
}
.agrostore-popup-related-section { margin: 0 0 14px !important; overflow: visible !important; }
.agrostore-popup-related-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px !important;
    margin: 0 !important;
    justify-content: center;
    align-items: stretch;
}
.agrostore-popup-related-card {
    float: none !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 225px !important;
    padding: 0 !important;
    justify-self: center;
}
.agrostore-popup-related-card .product-field-display,
.agrostore-popup-related-card .vm-related-product-container {
    width: 100%; height: 100% !important;
    min-width: 0;
}
.agrostore-popup-related-card .vm-related-product-container {
    display: flex !important;
    flex-direction: column;
    padding: 10px !important;
    border: 1px solid #d8e5dc;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 9px rgb(0 54 23 / 5%);
    box-sizing: border-box;
}
.agrostore-popup-related-card .vm-product-media-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 120px;
    min-height: 0 !important;
    margin: 0 0 9px;
    padding: 8px;
    border-radius: 7px;
    background: #f6faf7;
    box-sizing: border-box;
}
.agrostore-popup-related-card .vm-product-media-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
}
.agrostore-popup-related-card .vm-product-media-container img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}
.agrostore-popup-related-card .vm-product-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 34px;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-align: center !important;
}
.agrostore-popup-related-card .vm-product-title a { color: #1b4530 !important; text-decoration: none !important; }
.agrostore-popup-related-card .vm-product-rating-container,
.agrostore-popup-related-card .product_s_desc,
.agrostore-popup-related-card .product-price,
.agrostore-popup-related-card .vm-related-product-container > .btn { display: none !important; }
.agrostore-popup-related-action {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 44px;
    margin: auto 0 0 !important;
    padding: 8px 10px !important;
    border: 1px solid #087a37 !important;
    border-radius: 7px;
    background: #fff !important;
    color: #087a37 !important;
    font: inherit;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
}
.agrostore-popup-related-action:hover,
.agrostore-popup-related-action:focus-visible {
    background: #edf8f0 !important;
    outline: 2px solid #087a37;
    outline-offset: 2px;
}
.agrostore-popup-related-action:disabled { opacity: .7; cursor: default; }
.agrostore-popup-related-status {
    display: block;
    color: #145c2e;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
}
.agrostore-popup-related-status:not(:empty) { margin-top: 5px; }

/* Kisebb laptop / tablet: az ajánlatkérés külön, teljes szélességű sor;
   alatta a két hagyományos VM művelet egymás mellett. */
@media (max-width: 760px) {
    .agrostore-popup-quote-info { margin: 10px 0; padding: 10px 11px; gap: 9px; }
    .agrostore-popup-quote-info-icon svg { width: 24px; height: 24px; }
    .agrostore-popup-actions-enhanced {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 8px !important;
    }
    .agrostore-popup-quote-btn { grid-column: 1 / -1 !important; grid-row: 1 !important; }
    .agrostore-popup-continue-btn { grid-column: 1 !important; grid-row: 2 !important; }
    .agrostore-popup-cart-btn { grid-column: 2 !important; grid-row: 2 !important; }
}

/* Telefon: minden művelet egy oszlopban, a fontos ajánlatkérés és kosárgomb
   kerül előre; a "Tovább vásárolok" utolsó, visszafogott művelet. */
@media (max-width: 480px) {
    .agrostore-popup-related-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding: 2px 1px 9px;
    }
    .agrostore-popup-related-card {
        flex: 0 0 min(165px, 70vw) !important;
        scroll-snap-align: start;
    }
    .agrostore-popup-related-card .vm-product-media-container { height: 105px; }
    #fancybox-wrap:has(.agrostore-popup-quote-info) {
        width: calc(100vw - 12px) !important;
        max-height: calc(100dvh - 12px) !important;
        padding: 6px !important;
    }
    #fancybox-wrap:has(.agrostore-popup-quote-info) #fancybox-outer {
        max-height: calc(100dvh - 24px) !important;
    }
    .agrostore-popup-quote-info {
        align-items: flex-start;
        padding: 9px 10px;
        border-radius: 8px;
    }
    .agrostore-popup-quote-info strong { font-size: 13px; }
    .agrostore-popup-quote-info small { font-size: 11px; }
    .agrostore-popup-actions-enhanced { grid-template-columns: 1fr !important; gap: 7px !important; }
    .agrostore-popup-quote-btn { grid-column: 1 !important; grid-row: 1 !important; }
    .agrostore-popup-cart-btn { grid-column: 1 !important; grid-row: 2 !important; }
    .agrostore-popup-continue-btn { grid-column: 1 !important; grid-row: 3 !important; }
    .agrostore-popup-actions-enhanced > a,
    .agrostore-popup-actions-enhanced > button { min-height: 42px; font-size: 14px !important; }
}
