/*
 * Printo_CartPanel - restyling of the product designer's upload popup.
 *
 * PRESENTATION ONLY. Nothing here changes markup, ids, names or behaviour:
 *   - textarea[name="design_comment"] keeps its name, because
 *     __poAppendDeliveryToComment() writes the delivery line into it by name
 *     when Add to Cart is pressed.
 *   - #upload-file-input keeps its id and data-url; the AJAX upload binding is
 *     untouched. Only the browser's own file button is skinned.
 *
 * Selectors lead with `body #upload-file-popup` (1,0,1) so they outrank
 * product.css's `#upload-file-popup` (1,0,0) regardless of load order.
 */

/* --- the card ------------------------------------------------------- */
body #upload-file-popup {
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: 88vh;
    overflow-y: auto;
    /* product.css centres with margin-left/-top:-180px, which assumes a 360px
       tall box and drifts as the content grows. Translate instead. */
    margin: 0;
    transform: translate(-50%, -50%);
    padding: 26px 26px 24px;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(17, 22, 28, .24);
    background: #fff;
}

body #upload-file-popup-overlay {
    background: rgba(17, 22, 28, .45);
}

/* --- close --- */
body #upload-file-popup > a.close {
    top: 14px;
    right: 14px;
}

/* --- section labels --- */
body #upload-file-popup .product-options {
    border: 0;
    padding: 0;
    margin: 0;
}

body #upload-file-popup .product-options .option {
    margin: 0 0 18px;
}

body #upload-file-popup .product-options dl,
body #upload-file-popup .product-options dt,
body #upload-file-popup .product-options dd {
    margin: 0;
    padding: 0;
    border: 0;
}

body #upload-file-popup .product-options dt label {
    display: block;
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #99a1a9;
}

/* --- file field ----------------------------------------------------- */
body #upload-file-popup #upload-file-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: #5b636c;
    background: #fff;
    border: 1px solid #d3d8dd;
    border-radius: 8px;
    cursor: pointer;
}

body #upload-file-popup #upload-file-input:focus {
    outline: none;
    border-color: #00bbd3;
}

/* The browser's own button inside the field. */
body #upload-file-popup #upload-file-input::file-selector-button {
    margin: -4px 12px -4px -4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #00bbd3;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

body #upload-file-popup #upload-file-input::-webkit-file-upload-button {
    margin: -4px 12px -4px -4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #00bbd3;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

body #upload-file-popup #upload-file-input::file-selector-button:hover,
body #upload-file-popup #upload-file-input::-webkit-file-upload-button:hover {
    background: #00a2ba;
}

/* uploaded file list */
body #upload-file-popup #uploaded-files p {
    margin: 8px 0 0;
    font-size: 12px;
}

body #upload-file-popup #uploaded-files a.delete {
    margin-left: 8px;
    color: #a0a7ae;
}

/* --- comment -------------------------------------------------------- */
body #upload-file-popup textarea[name="design_comment"] {
    display: block;
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 19px;
    color: #1b2027;
    background: #fff;
    border: 1px solid #d3d8dd;
    border-radius: 8px;
    resize: vertical;
}

body #upload-file-popup textarea[name="design_comment"]:focus {
    outline: none;
    border-color: #00bbd3;
}

/* --- add to cart ---------------------------------------------------- */
body #upload-file-popup .product-options-bottom {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

body #upload-file-popup .product-options-bottom .add-to-cart {
    display: block;
    margin: 0;
    padding: 0;
    float: none;
}

body #upload-file-popup .product-options-bottom button.btn-cart {
    display: block;
    width: 100%;
    float: none;
    margin: 4px 0 0;
    padding: 15px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    border: 0;
    border-radius: 8px;
    background: #00bbd3;
    color: #fff;
}

body #upload-file-popup .product-options-bottom button.btn-cart:hover {
    background: #00a2ba;
}

body #upload-file-popup .product-options-bottom button.btn-cart span,
body #upload-file-popup .product-options-bottom button.btn-cart span span {
    display: inline;
    float: none;
    padding: 0;
    background: none;
    line-height: inherit;
}

/*
 * The popup's own spinner is redundant now that the slide-in panel shows a
 * full-screen loader while the item is being added.
 */
body #upload-file-popup #upload-file-popup-loader {
    display: none !important;
}

/* --- footer bits ---------------------------------------------------- */
body #upload-file-popup #echoWait {
    margin: 10px 0 0;
    font-size: 12px;
}

body #upload-file-popup #progressBarflat {
    display: block;
    width: 100%;
    height: 4px;
    margin: 10px 0 0;
    border: 0;
    border-radius: 999px;
    background: #eef0f2;
    appearance: none;
    -webkit-appearance: none;
}

body #upload-file-popup #progressBarflat::-webkit-progress-bar {
    background: #eef0f2;
    border-radius: 999px;
}

body #upload-file-popup #progressBarflat::-webkit-progress-value {
    background: #00bbd3;
    border-radius: 999px;
}

body #upload-file-popup hr {
    margin: 18px 0 0;
    border: 0;
    border-top: 1px solid #eef0f2;
}

body #upload-file-popup .product-delivery-date-info {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 18px;
    color: #5b636c;
}

body #upload-file-popup .product-delivery-date-info:empty {
    display: none;
}

@media screen and (max-width: 480px) {
    body #upload-file-popup {
        width: calc(100vw - 24px);
        padding: 22px 18px 20px;
    }
}
