/*
 * Phone layout for the Konva builder (loaded by index.php; not used by /ODB/).
 * Visual only: nothing here touches sections, legs, braces or prices.
 */
@media (max-width: 767px) {
    /* ---- header, step circles, sale banner: compact ---- */
    #header { height: 82px !important; min-height: 0 !important; padding: 0 10px !important; }
    #logo-group { height: 42px !important; }
    #logo { margin: 4px 0 0 !important; }
    #logo img { height: 36px !important; width: auto !important; }
    .form-bootstrapWizard { top: 46px !important; }
    .form-bootstrapWizard li .step,
    .bootstrapWizard li .step { display: inline-block !important; width: 30px !important; height: 30px !important; padding: 0 !important;
        line-height: 26px !important; font-size: 14px !important; text-align: center; box-sizing: border-box !important; }
    .sale-banner { font-size: 12.5px !important; padding: 4px 10px !important; line-height: 1.3 !important; }

    /* ---- choice steps (dock, decking, shoreline): less empty space, smaller pictures ---- */
    .step1_choose_docks h3 { font-size: 17px !important; margin: 14px 0 0 !important; }   /* header joins its box (rounded card) */
    .step1_choose_docks .well { padding: 8px !important; margin-bottom: 8px !important; }
    .step1_choose_docks .jumbotron { padding: 10px 12px !important; margin-bottom: 0 !important;
        height: auto !important; min-height: 0 !important; justify-content: flex-start !important; gap: 6px; }
    .step1_choose_docks .dock_builder_step1_img { padding: 4px !important; }
    .step1_choose_docks .jumbotron ul { margin-bottom: 6px !important; }
    .step1_choose_docks .jumbotron li { font-size: 14px !important; line-height: 1.45 !important; }
    .step1_choose_docks img { max-height: 150px !important; width: auto !important; max-width: 100% !important;
        display: block; margin: 6px auto !important; }
    .dock_builder_step1_img { margin: 4px 0 !important; min-height: 0 !important; height: auto !important; }
    .step1_choose_docks .btn { margin-top: 6px !important; }

    /* ---- design step ---- */
    /* toolbar: price on the left, 3D + Next on the right, on one line */
    .step4_designit_wraper .position-fixed { background: #e9e9e9; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
    /* two rows: price | Next, then decking choice | 3D View */
    .step4_designit_wraper .designit_leftwraper,
    .step4_designit_wraper .header-text-shw { float: none !important; width: auto !important; }
    .step4_designit_wraper #dockcomponents { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "price next" "deck threed";
        align-items: center; gap: 6px 8px; margin: 0 !important; padding: 6px 10px; }
    .step4_designit_wraper #dockcomponents > div,
    .step4_designit_wraper #dockcomponents .canvas_continue,
    .step4_designit_wraper #dockcomponents .canvas_continue > span { display: contents !important; }
    .step4_designit_wraper #dockcomponents > div:first-child > .doc_price { grid-area: price; }
    .step4_designit_wraper #dockcomponents .canvas_continue .btn { grid-area: next; justify-self: end; }
    .step4_designit_wraper #dockcomponents .deck-select-wrap { grid-area: deck; margin: 0 !important; min-width: 0; }
    .step4_designit_wraper #dockcomponents .deck-select-wrap span { font-size: 13px !important; }
    .step4_designit_wraper #dockcomponents .deck-select-wrap select { min-width: 0; max-width: 100%; padding: 5px 28px 5px 10px !important;
        font-size: 14px !important; height: auto !important; }
    .step4_designit_wraper #dockcomponents #dock3d_btn { grid-area: threed; justify-self: end; }
    .mobile-ramp-slot { clear: both; }
    .step4_designit_wraper .doc_price { font-size: 15px !important; line-height: 1.25 !important; margin: 0 !important; }
    .step4_designit_wraper .canvas_continue .btn,
    .step4_designit_wraper #dock3d_btn { padding: 7px 12px !important; font-size: 14px !important; line-height: 1.2 !important;
        margin: 0 !important; width: auto !important; height: auto !important; white-space: nowrap; }
    .step4_designit_wraper .designit_leftwraper { padding: 0 !important; }
    /* the ramp notice: one small full-width line under the toolbar */
    .mobile-ramp-slot .ramp-notice { margin: 0 8px 6px !important; padding: 5px 9px !important; font-size: 12px !important;
        line-height: 1.35 !important; max-width: none !important; }

    /* dock parts menu: a bar along the bottom instead of a box over the canvas */
    .dropdown:not(.hide) { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        top: auto !important; width: auto !important; height: auto !important; }
    .dropbtn { display: none !important; }
    #myDropdown { display: flex !important; flex-wrap: wrap; position: fixed !important; left: 0 !important; right: 0 !important;
        bottom: 0 !important; top: auto !important; width: auto !important; height: auto !important; max-height: 45vh;
        overflow-y: auto; margin: 0 !important; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) !important;
        background: #fff; box-shadow: 0 -2px 8px rgba(0, 0, 0, .2); z-index: 2200 !important; }
    #myDropdown li { list-style: none; margin: 2px !important; padding: 11px 4px !important; font-size: 13.5px !important;
        line-height: 1.2 !important; text-align: center; border-radius: 4px; width: auto !important; height: auto !important;
        min-width: 0; box-sizing: border-box; }
    #myDropdown li.need_help_li_menu,
    #myDropdown li.header_li_menu { order: 0; flex: 1 1 30%; }
    #myDropdown li[class^="body_"] { order: 1; flex: 1 1 22%; background: #eef2f7 !important; color: #0b2e5c !important;
        border: 1px solid #c9d3e0; }
    body.mobile-design { padding-bottom: 120px !important; }
    #preview { display: none !important; }                  /* hover previews are for mouse use */

    /* full-screen button stays clear of the toolbar (top set by mobile.js) */
    #btn-fullscreen { width: 34px !important; height: 34px !important; }
}

@media (max-width: 767px) {
    #sandbox-badge { left: 4px !important; bottom: auto !important; top: 4px; font-size: 10px !important; padding: 4px 6px !important; opacity: .85; }
}

@media (max-width: 767px) {
    /* 16px text in fields: iPhones zoom the page in on smaller fields when tapped */
    input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input:not([type]), select, textarea {
        font-size: 16px !important; }
    /* completion form: one field per line */
    .dock_final_details .col-sm-6, .dock_final_details .col-xs-6, .dock_final_details .col-md-6 { width: 100% !important; float: none !important; }
}

@media (max-width: 767px) {
    .header-title.step_explanation { position: absolute !important; left: 0; right: 0; width: auto !important; z-index: 3 !important;
        padding: 8px 16px !important; font-size: 17px !important; text-align: center; }
    body.mobile-design .header-title.step_explanation { display: none !important; }   /* the design toolbar replaces it */
}

@media (max-width: 767px) {
    #logo-group, #logo { display: block !important; }
    #logo img { display: block !important; margin: 0 auto; }
    #logo-group { text-align: center; float: none !important; width: auto !important; }
    #logo { float: none !important; width: auto !important; }
}

/* Design step on phones: the canvas fills the screen between the toolbar and the parts bar (no full-screen button) */
@media (max-width: 767px) {
    body.mobile-design { padding-bottom: 0 !important; overflow: hidden !important; }
    body.mobile-design #logo-group { display: none !important; }
    body.mobile-design #header { height: 44px !important; }
    body.mobile-design .form-bootstrapWizard { top: 7px !important; }
    body.mobile-design #container { position: fixed !important; left: 0 !important; right: 0 !important;
        top: var(--mtop, 200px) !important; bottom: var(--mbot, 60px) !important; width: auto !important; height: auto !important;
        margin: 0 !important; overflow: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; z-index: 1; }
    body.mobile-design #btn-fullscreen { display: none !important; }
    body.mobile-design .shore_this_way { position: fixed !important; right: 8px !important; left: auto !important; top: auto !important;
        bottom: calc(var(--mbot, 60px) + 6px) !important; width: auto !important; margin: 0 !important; padding: 2px 9px !important;
        z-index: 5 !important; font-size: 12px !important; opacity: .9 !important; background: rgba(255, 255, 255, .85);
        border-radius: 10px; pointer-events: none; }
    body.mobile-design #sandbox-badge { top: auto !important; bottom: calc(var(--mbot, 60px) + 6px) !important; left: 6px !important; }
    .ramp-dismiss { float: right; border: 0; background: none; font-size: 20px; line-height: 1; padding: 0 0 0 10px; margin: -2px -2px 0 0;
        color: #5a4100; cursor: pointer; }
    .ramp-notice.mobile-dismissed { display: none !important; }
}
