/* Steag.ro product customization uploader.
   Palette matches the product page: navy #131a65 (theme primary), green #2e7d32
   (the price/success green from the steagpricerange feature), lavender card tones. */

.steag-upload {
    margin-top: 0.25rem;
}

/* The native input stays in the flow for form semantics but is visually hidden;
   the <label> zone is the visible control. Kept focusable so keyboard users see
   the focus ring on the zone via :focus-within. */
.steag-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.steag-upload__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 1.75rem 1rem;
    border: 2px dashed #c3c8e6;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
    cursor: pointer;
    margin-bottom: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.steag-upload__zone:hover,
.steag-upload__zone--over,
.steag-upload:focus-within .steag-upload__zone {
    border-color: #131a65;
    background: #f3f5fd;
}

.steag-upload__zone--over {
    border-style: solid;
}

.steag-upload__icon {
    color: #131a65;
}

.steag-upload__title {
    font-weight: 600;
    color: #232323;
}

.steag-upload__title em {
    font-style: normal;
    color: #131a65;
    text-decoration: underline;
}

.steag-upload__hint {
    font-size: 0.8125rem;
    color: #777777;
}

.steag-upload__optional {
    font-size: 0.75rem;
    color: #9a9a9a;
    text-transform: lowercase;
}

/* Chosen-file preview row (before saving) */
.steag-upload__preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #c3c8e6;
    border-radius: 12px;
    background: #ffffff;
}

.steag-upload__thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f0f1f6;
    overflow: hidden;
}

.steag-upload__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.steag-upload__thumb-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #131a65;
}

.steag-upload__fileinfo {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.steag-upload__filename {
    font-weight: 600;
    color: #232323;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.steag-upload__filesize {
    font-size: 0.8125rem;
    color: #777777;
}

.steag-upload__status {
    font-size: 0.8125rem;
    color: #131a65;
    font-weight: 600;
}

.steag-upload__progress {
    display: block;
    width: 100%;
    max-width: 260px;
    height: 6px;
    margin-top: 0.25rem;
    border-radius: 3px;
    background: #e4e6f2;
    overflow: hidden;
}

.steag-upload__progress-bar {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: 3px;
    background: #131a65;
    transition: width 0.15s ease;
}

.steag-upload__remove {
    margin-left: auto;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f0f1f6;
    color: #555555;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.steag-upload__remove:hover {
    background: #fdecea;
    color: #c62828;
}

.steag-upload__error {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #c62828;
}

/* Saved state (server-confirmed customization) */
.steag-upload__saved {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cde8d2;
    border-radius: 12px;
    background: #e6f4ea;
}

.steag-upload__saved-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
}

.steag-upload__saved-label {
    font-weight: 600;
    color: #1e7e34;
}

.steag-upload__saved-remove {
    margin-left: auto;
    color: #777777;
}

.steag-upload__saved-remove:hover {
    color: #c62828;
}

/* JS mode (class set by steag-upload.js): uploads are automatic on selection, so the
   manual save button is pure noise -- it stays in the DOM only for no-JS visitors. */
.steag-upload-js .product-customization-custom-steag-submit {
    display: none;
}

/* Footer add-to-cart while a print file is still in flight: the customization is not
   bound yet, adding now would create an order without its design. */
.steag-upload-cart-waiting {
    opacity: 0.55;
    cursor: wait !important;
}

.steag-cart-artwork { display: none; }
.steag-upload-js .steag-cart-artwork { display: block; margin: .75rem 0; }
.steag-cart-artwork-label { font-weight: 600; }
.steag-cart-artwork .steag-upload__zone { padding: .75rem; }
.steag-cart-artwork .steag-upload [hidden] { display: none !important; }
#steag-cart-upload-notice { margin: .5rem 0; font-weight: 600; }


/* A product link and its artwork controls are siblings, so each action keeps its own target. */
.steag-cart-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
}
.steag-cart-title > a { min-width: 0; overflow-wrap: anywhere; }
.steag-upload-js .steag-cart-title .steag-cart-artwork { margin: 0; }
.steag-cart-artwork-mini { min-width: 0; max-width: 100%; }
.steag-upload--cart {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0;
    margin: 0;
    padding: 1px 2px;
    border: 1px solid #d5dce7;
    border-radius: 8px;
    background: #fafbfc;
    color: #213259;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}
.steag-upload--cart .steag-upload__attachment,
.steag-upload--cart .steag-upload__button,
.steag-upload--cart .steag-upload__delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    flex: none;
}
.steag-upload--cart .steag-upload__attachment { padding: 0 3px 0 2px; }
.steag-upload--cart .steag-upload__attachment::after {
    content: "";
    width: 1px;
    height: 17px;
    margin-left: 5px;
    background: #dce1ea;
}
.steag-upload--cart .steag-upload__saved-thumb {
    display: block;
    width: 22px;
    height: 29px;
    object-fit: contain;
    border-radius: 3px;
}
.steag-upload--cart .steag-upload__button,
.steag-upload--cart .steag-upload__delete {
    min-height: 32px;
    padding: 0 7px;
    gap: 5px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #213259;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}
.steag-upload--cart .steag-upload__attachment ~ .steag-upload__button,
.steag-upload--cart .steag-upload__delete { width: 32px; padding: 0; }
.steag-upload--cart .steag-upload__delete { color: #626d80; }
.steag-upload--cart .steag-upload__icon { width: 17px; height: 17px; }
.steag-upload--cart .steag-upload__button:hover { background: #eaf0f9; }
.steag-upload__input:focus-visible ~ .steag-upload__button,
.steag-upload--cart .steag-upload__delete:focus-visible {
    outline: 2px solid #1e6dad;
    outline-offset: 1px;
}
.steag-upload--cart .steag-upload__delete:hover { background: #fff0ee; color: #a52e34; }
.steag-upload--cart .steag-upload__preview,
.steag-upload--cart .steag-upload__error { flex-basis: 100%; min-width: 0; }
.steag-upload__saved-action {
    border: 0;
    padding: .375rem .5rem;
    color: #235575;
    background: transparent;
    text-decoration: underline;
    cursor: pointer;
}
.steag-bin-icon {
    display: inline-block;
    width: 17px;
    height: 17px;
    flex: none;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5h15m-12.8 0 .8 12.4a2 2 0 0 0 2 1.8h5a2 2 0 0 0 2-1.8l.8-12.4m-7.8-.1V4.8A1.5 1.5 0 0 1 11 3.3h2a1.5 1.5 0 0 1 1.5 1.5v1.6M10 10v6.2m4-6.2v6.2'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Warehouse otherwise fixes the product height and puts the price over the title. */
html body #blockcart-content .cart-products > li:has(.steag-mini-line.row) {
    height: auto !important;
    container-type: inline-size;
}
html body #blockcart-content .cart-products .steag-mini-line.row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas: "photo title" "photo details" "photo actions";
    align-items: center;
    gap: 3px 8px;
    margin: 0;
}
html body #blockcart-content .cart-products .steag-mini-line.row > .col-3 {
    grid-area: photo;
    align-self: start;
    max-width: 100% !important;
    padding: 0;
}
html body #blockcart-content .cart-products .steag-mini-line.row .product-image,
html body #blockcart-content .cart-products .steag-mini-line.row .product-image img {
    width: 40px !important;
    height: 49px !important;
}
html body #blockcart-content .cart-products .steag-mini-line.row .col-info { display: contents; }
html body #blockcart-content .cart-products .steag-mini-line.row .steag-cart-title {
    grid-area: title;
    margin: 0;
    padding: 0 !important;
    gap: 3px 7px;
}
html body #blockcart-content .cart-products .steag-mini-line.row .steag-cart-title > a {
    display: block;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #172354 !important;
}
html body #blockcart-content .steag-mini-line .product-attributes { grid-area: details; }
html body #blockcart-content .cart-products .steag-mini-line.row .col-info > .row {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
}
html body #blockcart-content .cart-products .steag-mini-line.row .col-info > .row > .col {
    position: static !important;
    flex: 0 0 auto;
    width: auto;
    padding: 0;
}
html body #blockcart-content .cart-products .steag-mini-line.row .col-info > .row > .col:nth-child(2) {
    margin-left: auto;
    white-space: nowrap;
}
@container (max-width: 335px) {
    html body #blockcart-content .cart-products .steag-mini-line.row {
        grid-template-areas: "title title" "photo details" "photo actions";
    }
}

body#checkout #thecheckout-cart-summary .cart-item .steag-order-line {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) max-content;
    grid-template-areas: "photo title actions" "photo details actions";
    align-items: center;
    gap: 3px 12px;
}
body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-body {
    display: contents !important;
}
body#checkout #thecheckout-cart-summary .steag-order-line .product-line-image {
    grid-area: photo;
    align-self: start;
    max-width: 100%;
    padding: 0;
}
body#checkout #thecheckout-cart-summary .steag-order-line .product-line-image img {
    max-width: 100%;
    max-height: 68px;
    object-fit: contain;
}
body#checkout #thecheckout-cart-summary .steag-order-line .steag-cart-title {
    grid-area: title;
    display: flex;
    margin: 0;
}
body#checkout #thecheckout-cart-summary .steag-order-line .product-line-desc {
    grid-area: details;
    min-width: 0;
    margin: 0;
}
body#checkout #thecheckout-cart-summary .steag-order-line .product-line-desc > br { display: none; }
body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-actions {
    grid-area: actions;
    align-items: center;
    margin: 0;
}
body#checkout #thecheckout-cart-summary .steag-order-line .remove-from-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #58647b;
}
.steag-upload-js #thecheckout-cart-summary .steag-duplicate-preview,
.steag-upload-js #thecheckout-cart-summary .summary-customization:has(.steag-duplicate-preview):not(:has(.product-customization-line:not(.steag-duplicate-preview))) {
    display: none !important;
}
@media (max-width: 680px) {
    body#checkout #thecheckout-cart-summary .cart-item .steag-order-line {
        grid-template-columns: 36px minmax(0, 1fr);
        grid-template-areas: "title title" "photo details" "photo actions";
        gap: 3px 6px;
    }
    body#checkout #thecheckout-cart-summary .steag-order-line .steag-cart-title { gap: 4px 7px; }
    body#checkout #thecheckout-cart-summary .steag-order-line .steag-cart-title > a { font-size: 14px; }
    body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-actions {
        grid-template-columns: auto minmax(0,1fr) auto !important;
        justify-content: stretch;
        padding: 0;
    }
    body#checkout #thecheckout-cart-summary .steag-order-line .product-line-price { text-align: right; }
}
:is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title > a {
    flex: 0 1 auto;
    width: auto !important;
    padding: 0;
    text-align: left;
}
:is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title .steag-upload__button {
    width: auto;
    padding: 0 7px;
    font: 600 12px/1.25 Arial, sans-serif;
    color: #213259;
    text-align: center;
}
:is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title .steag-upload__attachment ~ .steag-upload__button {
    width: 32px;
    padding: 0;
}
@media (max-width: 360px) {
    body#checkout #thecheckout-cart-summary .steag-order-line .steag-cart-title,
    html body #blockcart-content .cart-products .steag-mini-line.row .steag-cart-title {
        flex-wrap: nowrap;
        column-gap: 4px;
    }
    body#checkout #thecheckout-cart-summary .steag-order-line .steag-cart-title > a,
    html body #blockcart-content .cart-products .steag-mini-line.row .steag-cart-title > a {
        font-size: 13px !important;
    }
    :is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title .steag-cart-artwork {
        flex: 0 0 auto;
    }
    .steag-upload--cart .steag-upload__attachment { padding-left: 0; }
    .steag-upload--cart .steag-upload__attachment::after { margin-left: 2px; }
    :is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title .steag-upload__attachment ~ .steag-upload__button,
    :is(#thecheckout-cart-summary, #blockcart-content) .steag-cart-title .steag-upload__delete {
        width: 28px;
    }
}

body#checkout #thecheckout-cart-summary .cart-summary-top .aeuc_scart,
html body #blockcart-content .cart-totals .steag-cart-tax {
    display: none !important;
}
body#checkout #thecheckout-cart-summary > .inner-area { padding-top: 21px !important; }
body#checkout #thecheckout-cart-summary .cart-items > .cart-item:first-child { padding-top: 4px !important; }
body#checkout #thecheckout-cart-summary .cart-item .product-line.steag-order-line {
    grid-template-columns: 52px minmax(0, 1fr) max-content !important;
    gap: 2px 6px !important;
}
body#checkout #thecheckout-cart-summary .steag-order-line .product-line-info.steag-cart-title { margin-bottom: 0 !important; }
body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-image,
body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-image .product-image,
body#checkout #thecheckout-cart-summary .cart-item .steag-order-line .product-line-image img {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
}
html body #blockcart-content .steag-cart-title .steag-mini-fallback-thumb { object-fit: contain; flex: none; }
html body #blockcart-content > .cart-title:first-child {
    min-height: 44px;
    margin-bottom: 2px !important;
    padding-bottom: 4px !important;
}
html body #blockcart-content .cart-products .steag-mini-line.row { column-gap: 6px; }
html body #blockcart-content .cart-products > li:has(.steag-mini-line.row) { min-height: 0; }
html body #blockcart-content .steag-mini-line .product-attributes {
    display: block !important;
    padding: 0 !important;
    font-size: 12px;
    line-height: 1.3;
}
@media (max-width: 680px) {
    body#checkout #thecheckout-cart-summary .cart-item .product-line.steag-order-line {
        grid-template-columns: 42px minmax(0, 1fr) !important;
    }
}
