/**
 * Wall-it — układ edytora / koszyka
 * Wgraj jako: /css/order/wi-order-responsive.css
 * Podłącz PO css/order/wi-order.css
 *
 * Założenia:
 * - zdjęcie z kadrowaniem wyśrodkowane, kolumna max 700px
 * - opcje (wymiary, materiał, efekty, cena) POD zdjęciem
 * - nie ruszamy szerokości/wysokości #my-image-holder i .jcrop-holder
 *   (ustawia je JS — zmiana w CSS psuje kadr)
 */

.container_16 {
    width: 100% !important;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}

div[class^="container"]:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.container_16:nth-of-type(2),
.product-editor-layout {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-editor-layout .editor-col,
.product-editor-layout .options-col {
    float: none !important;
    display: block;
    width: 100% !important;
    max-width: 700px;
    margin: 0 auto;
}

.product-editor-layout .pattern-nr {
    text-align: center;
    margin: 10px 0 0;
}

.container_16 .grid_12,
.container_16 .grid_4,
.container_16 .grid_16,
.container_16 .grid_5,
.container_16 .grid_11,
.container_16 .grid_6,
.container_16 .grid_10 {
    float: none !important;
    display: block;
    width: 100% !important;
    margin-left: 0;
    margin-right: 0;
}

div[class^="container"]:first-child .grid_5,
div[class^="container"]:first-child .grid_11 {
    width: auto !important;
}

div[class^="container"]:first-child .grid_11 {
    text-align: right;
}

/* --- Podgląd + kadr: na środku, max 700px --- */
#my-image-editor {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#my-image-holder {
    display: block;
    position: relative;
    z-index: 2;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 700px;
}

.canvas-container {
    margin-left: auto;
    margin-right: auto;
}

/* --- Opcje pod zdjęciem --- */
.container_16 .grid_4.form,
#form-product {
    width: 100% !important;
    max-width: 700px;
    margin: 20px auto 0;
    float: none !important;
}

#form-product > div {
    margin-bottom: 8px;
}

#material-select {
    width: 100%;
    max-width: 700px;
}

#wi-btn-add-to-cart {
    width: 100%;
    max-width: 700px;
}

#form-product input[name="width"],
#form-product input[name="height"] {
    width: 110px;
}

#order-details label {
    width: auto;
    max-width: 100%;
}

/* Koszyk / podsumowanie */
.order-preview {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.order-preview img,
.image-thumb {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

.summary-table,
.order-preview table {
    width: 100%;
    max-width: 700px;
}

.summary-table td:first-child {
    width: 40%;
}

.container_16.footer {
    max-width: 700px;
    text-align: center;
}

.container_16.footer .grid_6,
.container_16.footer .grid_10 {
    text-align: center !important;
}

#add-to-cart-confirmation .dialog {
    width: min(600px, 94vw);
    height: auto;
    max-height: 90vh;
    overflow: auto;
}

@media screen and (max-width: 720px) {
    .logo {
        height: 80px;
        background-size: contain;
        background-position: left center;
    }

    #my-image-editor {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .summary-table td:first-child {
        width: auto;
    }

    td {
        width: auto;
    }
}
