.store-scrollport, .store-contact-dock { display: contents; }
.quick-contact { position: fixed; right: 10px; top: 50%; z-index: 19; }
.quick-contact-desktop { display: grid; gap: 6px; width: 48px; }
.quick-contact a, .masthead-chat a, .masthead-chat summary { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 9px; text-decoration: none; border-radius: 8px; }
.quick-contact-desktop a, .masthead-chat summary { box-shadow: 0 2px 10px #38261c26; }
.quick-contact-desktop a { background: #fffdf8; border: 1px solid #ded6c8; }
.quick-contact-desktop a:hover { background: #f5efe5; }
.quick-contact-desktop img { display: block; object-fit: contain; }
.masthead-chat summary { background: #9e3924; color: #fff; }
:is(.quick-contact, .masthead-chat) :is(a, summary):focus-visible { outline: 2px solid #9e3924; outline-offset: 3px; }
.masthead-chat { display: none; }
.store-footer-details { display: block; margin-top: 4px; }

@media (min-width: 1001px) {
    .store-scrollport > main,
    .store-scrollport > .store-footer { padding-inline: 62px; }
    .quick-contact { translate: 0 var(--contact-shift, 0px); }
    .quick-contact-obstructed { visibility: hidden; }
}

@media (max-width: 1000px) {
    body:has(> .store-contact-dock) {
        --contact-bottom-space: max(31px, calc(7px + env(safe-area-inset-bottom)));
        position: relative;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        height: 100vh;
        height: var(--contact-viewport, 100dvh);
        min-height: 0;
        padding-bottom: 0;
        overflow: hidden;
    }

    body.store-keyboard-open:has(> .store-contact-dock) { --contact-bottom-space: 7px; }

    .store-scrollport :is(.checkout-form input, .checkout-form textarea, input[name="quantity"], #area-input, .price-request input:not([type="checkbox"]), .price-request select) { font-size: max(16px, 1em); }
    .store-scrollport { display: block; overflow: auto; min-width: 0; }
    .store-contact-dock { display: contents; }
    .quick-contact { display: none; }
    .masthead-chat { display: block; justify-self: end; }
    .masthead-chat summary { box-sizing: border-box; width: 44px; min-height: 44px; cursor: pointer; list-style: none; }
    .masthead-chat summary::-webkit-details-marker { display: none; }
    .quick-contact-panel {
        position: absolute;
        top: calc(100% + 4px);
        right: max(10px, env(safe-area-inset-right));
        width: 180px;
        box-sizing: border-box;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 6px;
        border: 1px solid #ded6c8;
        border-radius: 9px;
        background: #fffdf8;
        box-shadow: 0 3px 16px #0003;
    }
    .quick-contact-panel a { justify-content: flex-start; }
}

@media (max-width: 1000px) {
    .store-masthead { padding-top: env(safe-area-inset-top); }
    .store-contact-dock:has(.product-mobile-action) {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 7px max(14px, env(safe-area-inset-right)) var(--contact-bottom-space) 14px;
        border-top: 1px solid #ded6c8;
        background: #fffdf8;
    }
    .store-contact-dock .product-mobile-action {
        position: static;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 14px;
        font-weight: 650;
        flex: 1;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
    }
    .store-contact-dock .product-mobile-action span { min-width: 0; overflow-wrap: anywhere; }
    .store-contact-dock .product-mobile-action .primary { flex-shrink: 0; min-height: 44px; text-align: center; }
}

@media (max-width: 1000px) {
    .store-masthead .masthead-main { grid-template-columns: auto minmax(0, 1fr) auto auto; }
    .masthead-chat { grid-area: 1 / 4; }
    .store-masthead .masthead-search { grid-column: 2 / -1; }
}

@media (max-width: 1000px) and (max-height: 520px) {
    .store-masthead .masthead-utility { display: none; }
    .store-keyboard-open .store-masthead .masthead-search { display: none; }
    .store-keyboard-open .store-masthead .masthead-main { padding-block: 4px; }
}

@media (max-width: 1000px) and (max-height: 340px) {
    body:has(.store-scrollport :is(input, textarea):focus) .store-masthead .masthead-search { display: none; }
}
