/* =========================================
   Pocket Checkout
   Customer-facing scanner and basket
   ========================================= */


/* =========================================
   Remove normal WordPress shop chrome
   from Pocket Checkout only
   ========================================= */

body:has(#wooqr-scanner) .entry-title,
body:has(#wooqr-scanner) .wp-block-post-title,
body:has(#wooqr-scanner) h1.entry-title {
    display: none !important;
}


/*
 * Hide the normal website header and footer
 * on Pocket Checkout only.
 *
 * Customers should feel they are using
 * Pocket Checkout, not browsing the website.
 */

body:has(#wooqr-scanner) header.wp-block-template-part,
body:has(#wooqr-scanner) footer.wp-block-template-part,
body:has(#wooqr-scanner) .site-header,
body:has(#wooqr-scanner) .site-footer,
body:has(#wooqr-scanner) #masthead,
body:has(#wooqr-scanner) #colophon {
    display: none !important;
}


/* Reduce excess theme spacing */

body:has(#wooqr-scanner) {
    background: #fafafa;
}

body:has(#wooqr-scanner) main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* =========================================
   Main Pocket Checkout area
   ========================================= */

#wooqr-scanner {
    width: 100%;
    max-width: 440px;

    box-sizing: border-box;

    margin: 0 auto;
    padding: 24px 14px 28px;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    color: #1f1f1f;
}


/* =========================================
   Pocket Checkout introduction
   ========================================= */

.wooqr-intro {
    margin-bottom: 8px;
    text-align: center;
}

.wooqr-intro h2 {
    margin: 0;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;

    letter-spacing: -0.3px;
}

.wooqr-intro p {
    margin: 0;

    font-size: 15px;
    line-height: 1.4;

    color: #666666;
}


/* =========================================
   Scanner status
   ========================================= */

#wooqr-scanner-status {
    margin: 10px 0 10px;

    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;

    text-align: center;
}


/* =========================================
   Scanner instruction
   ========================================= */

.wooqr-scan-instruction {
    margin: 10px auto 14px;

    max-width: 320px;

    text-align: center;

    font-size: 13px;
    line-height: 1.45;

    color: #666666;
}


/* =========================================
   Camera
   ========================================= */

#wooqr-camera {
    width: 100%;
    max-width: 260px;

    margin: 0 auto 14px;

    overflow: hidden;

    border-radius: 18px;

    background: #f4f4f4;

    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.06);
}

#wooqr-camera video {
    display: block;

    width: 100% !important;
    height: 175px !important;

    object-fit: cover;

    border-radius: 18px;
}


/* =========================================
   Basket
   ========================================= */

#wooqr-basket-summary {
    width: 100%;
    box-sizing: border-box;

    padding: 12px 14px;

    background: #ffffff;

    border: 1px solid #e2e2e2;
    border-radius: 18px;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.05);
}


/* Empty basket */

#wooqr-basket-summary > p:only-child {
    margin: 12px 0;

    text-align: center;

    font-size: 14px;
    line-height: 1.4;

    color: #666666;
}


/* =========================================
   Basket item
   ========================================= */

.wooqr-basket-item {
    display: grid;

    grid-template-columns:
        52px
        minmax(0, 1fr)
        auto;

    gap: 10px;

    align-items: center;

    min-height: 66px;

    padding: 8px 0;

    border-bottom: 1px solid #eeeeee;
}

.wooqr-basket-item:last-of-type {
    border-bottom: none;
}


/* Product thumbnail */

.wooqr-product-thumb {
    width: 52px;
    height: 52px;
}

.wooqr-product-thumb img {
    display: block;

    width: 52px;
    height: 52px;

    object-fit: cover;

    border-radius: 10px;

    background: #f5f5f5;
}


/* Product details */

.wooqr-product-details {
    display: flex;
    flex-direction: column;

    gap: 3px;

    min-width: 0;
}

.wooqr-product-details strong {
    display: block;

    overflow: hidden;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;

    text-overflow: ellipsis;
}

.wooqr-product-price {
    display: block;

    font-size: 13px;
    line-height: 1.25;

    color: #555555;
}


/* =========================================
   Quantity controls
   ========================================= */

.wooqr-quantity-controls {
    display: flex;

    align-items: center;

    gap: 5px;

    white-space: nowrap;
}

.wooqr-plus,
.wooqr-minus {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 1px solid #d8d8d8;
    border-radius: 9px;

    background: #ffffff;
    color: #222222;

    font-size: 19px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.08s ease;
}

.wooqr-plus:hover,
.wooqr-minus:hover,
.wooqr-plus:focus,
.wooqr-minus:focus {
    background: #f5f5f5;
}

.wooqr-plus:active,
.wooqr-minus:active {
    transform: scale(0.95);
}

.wooqr-item-quantity {
    min-width: 18px;

    text-align: center;

    font-size: 14px;
    font-weight: 700;
}


/* =========================================
   Basket footer
   ========================================= */

.wooqr-basket-footer {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 10px;

    margin-top: 8px;
    padding: 12px 2px 3px;

    border-top: 1px solid #dddddd;

    font-size: 14px;
}

.wooqr-basket-footer div:last-child {
    font-size: 17px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================
   Checkout button
   ========================================= */

.wooqr-checkout-button {
    display: block;

    width: 100%;

    box-sizing: border-box;

    margin-top: 12px;
    padding: 15px 16px;

    border-radius: 12px;

    background: #171717;
    color: #ffffff !important;

    text-align: center;

    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;

    text-decoration: none !important;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.10);

    transition:
        background 0.15s ease,
        transform 0.08s ease;
}

.wooqr-checkout-button:hover,
.wooqr-checkout-button:focus {
    background: #000000;
    color: #ffffff !important;

    text-decoration: none !important;
}

.wooqr-checkout-button:active {
    transform: scale(0.99);
}


/* =========================================
   Mobile
   ========================================= */

@media (max-width: 480px) {

    #wooqr-scanner {
        max-width: 100%;

        padding:
            22px
            14px
            24px;
    }


    .wooqr-intro h2 {
        font-size: 28px;
    }


    .wooqr-intro p {
        font-size: 14px;
    }


    #wooqr-scanner-status {
        margin:
            10px
            0
            9px;

        font-size: 14px;
    }


    .wooqr-scan-instruction {
        margin:
            9px
            auto
            12px;

        max-width: 290px;

        font-size: 12.5px;
    }


    #wooqr-camera {
        max-width: 245px;

        margin-bottom: 12px;
    }


    #wooqr-camera video {
        height: 165px !important;
    }


    #wooqr-basket-summary {
        padding: 10px 12px;

        border-radius: 16px;
    }


    #wooqr-basket-summary > p:only-child {
        margin: 12px 0;

        font-size: 14px;
    }


    .wooqr-basket-item {
        grid-template-columns:
            48px
            minmax(0, 1fr)
            auto;

        gap: 8px;

        min-height: 62px;

        padding: 7px 0;
    }


    .wooqr-product-thumb,
    .wooqr-product-thumb img {
        width: 48px;
        height: 48px;
    }


    .wooqr-product-details strong {
        font-size: 13.5px;
    }


    .wooqr-product-price {
        font-size: 12.5px;
    }


    .wooqr-plus,
    .wooqr-minus {
        width: 32px;
        height: 32px;

        font-size: 18px;
    }


    .wooqr-item-quantity {
        min-width: 17px;

        font-size: 13.5px;
    }


    .wooqr-basket-footer {
        margin-top: 7px;
        padding-top: 10px;

        font-size: 14px;
    }


    .wooqr-basket-footer div:last-child {
        font-size: 16px;
    }


    .wooqr-checkout-button {
        margin-top: 11px;
        padding: 14px 14px;

        font-size: 15px;
    }
}
