/* Cart + Express Checkout Block - Product Detail Page */

.cart-express-block {
    margin-top: 16px;
    padding: 20px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    width: 100%;
}

/* Quantity + Add to Cart row */
.cart-express-block .cart-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Quantity selector with +/- buttons */
.cart-express-block .qty-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid #d0d0d0;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    height: 48px;
    flex-shrink: 0;
}

.cart-express-block .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 48px;
    border: none;
    background: #fff;
    cursor: pointer;
    color: #555;
    transition: background-color 0.15s ease;
    padding: 0;
}

.cart-express-block .qty-btn:hover {
    background-color: #f0f0f0;
}

.cart-express-block .qty-btn:active {
    background-color: #e5e5e5;
}

.cart-express-block .qty-selector form {
    margin: 0;
    padding: 0;
}

.cart-express-block .qty-selector input.quantity {
    width: 36px;
    height: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
    background: #fff;
}

.cart-express-block .qty-selector input.quantity::-webkit-outer-spin-button,
.cart-express-block .qty-selector input.quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart button - full width */
.cart-express-block .pro-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: #53ab00;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease;
    padding: 0 20px;
    white-space: nowrap;
}

@media (hover: hover) {
    .cart-express-block .pro-cart:hover {
        background-color: #3f9800;
    }
}

.cart-express-block .pro-cart svg {
    flex-shrink: 0;
}

/* Divider between cart and express checkout */
.cart-express-block .express-checkout-wrapper {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    /* Reset the standalone wrapper styles when inside cart block */
    padding: 16px 0 0 0;
    border: none;
    border-top: 1px solid #e0e0e0;
    border-radius: 0;
    background: transparent;
}

/* Responsive */
@media (max-width: 575px) {
    .cart-express-block {
        padding: 16px;
    }

    .cart-express-block .qty-selector {
        height: 44px;
    }

    .cart-express-block .qty-btn {
        width: 30px;
        height: 44px;
    }

    .cart-express-block .qty-selector input.quantity {
        width: 32px;
        height: 44px;
        font-size: 14px;
    }

    .cart-express-block .pro-cart {
        height: 44px;
        font-size: 13px;
        padding: 0 12px;
    }
}

/* ---- Narrow cart row adjustments ---- */

/* Long addToCart shops (>17 chars): darbg, darpt, darit, dargr, darlt, darse, darbe, darno, dares, darfi, darfr */

/* 992–1199px: right column is narrow, compact qty for all; hide cart icon for long-text shops */
@media (min-width: 992px) and (max-width: 1199px) {
    .cart-express-block .qty-btn {
        width: 30px;
    }

    .cart-express-block .qty-selector input.quantity {
        width: 32px;
    }

    .darbg .cart-express-block .pro-cart svg,
    .darpt .cart-express-block .pro-cart svg,
    .darit .cart-express-block .pro-cart svg,
    .dargr .cart-express-block .pro-cart svg,
    .darlt .cart-express-block .pro-cart svg,
    .darse .cart-express-block .pro-cart svg,
    .darbe .cart-express-block .pro-cart svg,
    .darno .cart-express-block .pro-cart svg,
    .dares .cart-express-block .pro-cart svg,
    .darfi .cart-express-block .pro-cart svg,
    .darfr .cart-express-block .pro-cart svg {
        display: none;
    }
}

/* 768–991px: stack button below qty selector */
@media (min-width: 768px) and (max-width: 991px) {
    .cart-express-block .cart-row {
        flex-wrap: wrap;
    }

    .cart-express-block .pro-cart {
        width: 100%;
        flex: none;
    }
}

/* 421–575px: already handled by existing 575px breakpoint */

/* 375–420px: hide cart icon for long-text shops */
@media (max-width: 420px) {
    .darbg .cart-express-block .pro-cart svg,
    .darpt .cart-express-block .pro-cart svg,
    .darit .cart-express-block .pro-cart svg,
    .dargr .cart-express-block .pro-cart svg,
    .darlt .cart-express-block .pro-cart svg,
    .darse .cart-express-block .pro-cart svg,
    .darbe .cart-express-block .pro-cart svg,
    .darno .cart-express-block .pro-cart svg,
    .dares .cart-express-block .pro-cart svg,
    .darfi .cart-express-block .pro-cart svg,
    .darfr .cart-express-block .pro-cart svg {
        display: none;
    }
}

/* <340px: stack button below qty, show cart icon */
@media (max-width: 339px) {
    .cart-express-block .cart-row {
        flex-wrap: wrap;
    }

    .cart-express-block .pro-cart {
        width: 100%;
        flex: none;
    }

    /* Re-show cart icon since button has full width now */
    .cart-express-block .pro-cart svg {
        display: inline-block !important;
    }
}

/* Simple products have no accessories below — add bottom spacing before page footer */
.cart-express-block--simple {
    margin-bottom: 32px;
}

/* Ensure accessory dropdowns overlay express checkout buttons */
.additionalAccessories .nice-select .list,
.selectionBlock .nice-select .list {
    z-index: 110;
}

/* Express Checkout section */

.express-checkout-wrapper {
    margin-top: 24px;
    padding: 20px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    width: 100%;
    max-width: 100%;
}

/* Heading */
.express-checkout-heading {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0 0 16px 0;
    letter-spacing: 0.2px;
}

/* Button container */
.express-checkout-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual button wrappers - unified height */
.express-checkout-btn {
    width: 100%;
    height: 48px;
    max-height: 48px;
    min-height: 48px;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
}

/* PayPal button */
.express-paypal-btn {
    background-color: #ffc439;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    height: 48px;
}

.express-paypal-btn:hover {
    background-color: #f0b830;
}

.express-paypal-btn svg {
    height: 22px;
    width: auto;
}

/* Force PayPal iframe to match container height */
.express-paypal-btn > div,
.express-paypal-btn iframe,
.express-paypal-btn .paypal-button,
.express-paypal-btn .paypal-buttons {
    height: 48px !important;
    max-height: 48px !important;
    min-height: 48px !important;
    overflow: hidden !important;
}

/* Google Pay button container - constrain outer height only */
.express-gpay-btn {
    border-radius: 5px;
    overflow: hidden;
    height: 48px;
    max-height: 48px;
    min-height: 48px;
}

/* Let Google Pay SDK control its own internal layout.
   Only set width and border-radius on the outer button. */
.express-gpay-btn button,
.express-gpay-btn .gpay-button {
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 5px !important;
    overflow: hidden !important;
}

/* Apple Pay button */
.express-applepay-btn {
    height: 48px;
}

.express-applepay-btn button {
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    -webkit-appearance: -apple-pay-button;
    -apple-pay-button-type: plain;
    -apple-pay-button-style: black;
}

.express-applepay-btn apple-pay-button {
    --apple-pay-button-width: 100%;
    --apple-pay-button-height: 48px;
    --apple-pay-button-border-radius: 5px;
    --apple-pay-button-padding: 0;
    display: block;
    width: 100%;
    height: 48px;
}

/* Skeleton loading placeholders - prevent CLS */
.express-checkout-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.express-skeleton-btn {
    width: 100%;
    height: 48px;
    border-radius: 5px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Note text below buttons */
.express-checkout-note {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Accepted payment methods strip */
.accepted-payments {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
}

.accepted-payments-heading {
    font-size: 13px;
    color: #999;
    margin: 0 0 8px;
    font-weight: 400;
}

.accepted-payments-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.accepted-payments-logos img {
    height: 25px;
    width: auto;
    flex-shrink: 1;
    min-width: 0;
}

/* Responsive adjustments */
@media (max-width: 575px) {
    .express-checkout-wrapper {
        margin-top: 20px;
        padding: 16px;
    }

    .express-checkout-btn {
        height: 44px;
        max-height: 44px;
        min-height: 44px;
    }

    .express-paypal-btn {
        height: 44px;
    }

    .express-paypal-btn > div,
    .express-paypal-btn iframe,
    .express-paypal-btn .paypal-button,
    .express-paypal-btn .paypal-buttons {
        height: 44px !important;
        max-height: 44px !important;
        min-height: 44px !important;
    }

    .express-gpay-btn {
        height: 44px;
        max-height: 44px;
        min-height: 44px;
    }

    .express-gpay-btn button,
    .express-gpay-btn .gpay-button {
        height: 44px !important;
        min-height: 44px !important;
    }

    .express-applepay-btn,
    .express-applepay-btn button {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
    }

    .express-applepay-btn apple-pay-button {
        --apple-pay-button-height: 44px;
        height: 44px;
    }

    .accepted-payments {
        margin-top: 16px;
    }

    .accepted-payments-logos {
        gap: 6px;
    }

    .accepted-payments-logos img {
        height: 18px;
    }

    .express-skeleton-btn {
        height: 44px;
    }
}

/* On touch devices, suppress :hover (which sticks on mobile) and rely on :active only */
@media (hover: none) {
    .cart-express-block .qty-btn:hover,
    .basket-qty-selector .qty-btn:hover {
        background-color: #fff;
    }
}

/* Basket qty-selector — reuses same component as product detail */
.basket-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #d0d0d0;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    height: 36px;
}

.basket-qty-selector .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 36px;
    border: none;
    background: #fff;
    cursor: pointer;
    color: #555;
    transition: background-color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.basket-qty-selector .qty-btn:hover {
    background-color: #f0f0f0;
}

.basket-qty-selector .qty-btn:active {
    background-color: #e5e5e5;
}

.basket-qty-selector input.quantity-change {
    width: 40px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
    background: #fff;
}

.basket-qty-selector input.quantity-change::-webkit-outer-spin-button,
.basket-qty-selector input.quantity-change::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Mobile sticky price bar ---- */
.sticky-price-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 8px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}

.sticky-price-bar.visible {
    transform: translateY(0);
}

.sticky-price-bar-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.sticky-price-bar .sticky-price {
    font-size: 21px;
    font-weight: 700;
    color: #ff4646;
    white-space: nowrap;
}

.sticky-price-bar .sticky-old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
}

.sticky-price-bar .sticky-delivery {
    font-size: 13px;
    font-weight: 600;
    color: #53ab00;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sticky-price-bar .sticky-delivery img {
    width: 21px;
    height: 21px;
}

@media (max-width: 767px) {
    .sticky-price-bar {
        display: flex;
    }
}

/* Product detail - sticky left column (images) when right column is taller */
@media (min-width: 992px) {
    .main-product-thumbnail > .container > .row {
        align-items: flex-start;
    }

    .main-product-thumbnail > .container > .row > .col-lg-7 {
        position: sticky;
        top: 20px;
    }
}
