/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */


/* REMOVE WHEN READY */
.woocommerce-billing-fields {
    display: none !important;
}

.delivery-collection button {
    background: #bcce00 !important;
    height: auto;
    display: flex !important;
    padding: 0.6rem 1rem !important;
    margin: 2px !important;
    border-radius: 6px !important;
}

.shop_table.woocommerce-checkout-review-order-table tbody,
h3#order_review_heading {
    display: none !important;
}






/* tr.woocommerce-shipping-totals.shipping {
    display: none;
}

tr.woocommerce-shipping-totals.shipping.shipping-chosen {
    display: none;
} */

/* Hide all shipping fields */
.shipping_address .woocommerce-shipping-fields__field-wrapper p {
    display: none !important;
}

/* #shipping_address_1_field,
#shipping_address_2_field,
#shipping_city_field,
#shipping_postcode_field {
    display: none !important;
} */






h3#ship-to-different-address {
    display: none;
}


.wcps-shipping-container {
    margin-bottom: 1rem;
    /* border-bottom: 1px solid #ccc;
    padding-bottom: 1rem; */
}


/* Loader + spinner (unchanged) */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
    width: 100%;
}

@keyframes spin {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(359deg);
    }
}

.spinner-box {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.circle-border {
    width: 50px;
    height: 50px;
    padding: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: linear-gradient(0deg,
            rgba(0, 44, 76, 0.1) 33%,
            rgba(0, 44, 76, 1) 100%);
    animation: spin 0.333s linear infinite;
}

.circle-core {
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 50%;
}

.loader-inline {
    display: flex;
    column-gap: 6px;
    font-size: 90%;
    align-items: center;
    min-height: 40px;
    padding-left: 1rem;
}

.loader-inline .spinner-box {
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.loader-inline .circle-border {
    width: 20px;
    height: 20px;
    padding: 1px;
}

.loader-inline p.loader-message {
    margin-bottom: 0;
}

.van-container {
    display: block;
    width: 24px;
    align-items: center;
    position: relative;
}

.van-container svg.van {
    width: 100%;
    position: absolute;
    left: 3px;
    top: 4px;
}

span.van-option {
    display: inline-block;
    padding-left: 34px;
}

.select2-selection .van-container svg.van {
    top: 7px;
}


.select2-results__option--highlighted svg.van path {
    fill: #fff;
}

a.add-new-address {
    font-size: 12px;
    font-weight: 600;
    line-height: 2;
    display: block;
    padding: 4px 14px 4px 27px;
    color: #0794ee;
    background-color: #f7f7f7;
    border-radius: 4px;
    background-image: url(../images/location-blue.svg);
    background-repeat: no-repeat;
    background-position: 7px center;
    background-size: auto 22px;
}

/* IPC suggestion container should match Select2 dropdown */
ul.ipc-suggestion-container.ipc-suggestion {
    position: absolute;
    z-index: 9999;
    width: calc(100% + 2px);
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
    background: #fff;
    border-radius: 0 0 4px 4px;
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
    border: 1px solid #d2d6dc;
    border-top: none;
    left: -1px;
    top: 55px;
}

/* Individual options inherit Select2 styles */
/* Individual items (no borders) */
ul.ipc-suggestion-container.ipc-suggestion li.ipc-address,
.select2-results__option {
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    /* default background */
}

/* Alternate row coloring */
ul.ipc-suggestion-container.ipc-suggestion li.ipc-address:nth-child(even),
.select2-results__option:nth-child(even) {
    background-color: #f7f7f7;
    /* light grey */
}

/* Hover effect matches Select2 */
ul.ipc-suggestion-container.ipc-suggestion li.ipc-address:hover,
ul.ipc-suggestion-container.ipc-suggestion li.ipc-address.select2-highlighted,
.select2-results__option:hover,
.select2-results__option.select2-highlighted,
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0e4bad !important;
    color: white;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 29px;
    padding-left: 10px;
    font-size: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 26px !important;
}








.carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.carousel .card,
.method-card .method {
    min-width: 180px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.method-card {
    margin-top: 10px;
}

.method-card.hide {
    display: none;
}



/* Carousel container */
#delivery-date-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 8px 0;
    padding-right: 1px;
}

/* Hide scrollbar but still scrollable */
#delivery-date-carousel::-webkit-scrollbar {
    display: none;
}

#delivery-date-carousel {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Each delivery date card */
.delivery-date-option {
    flex: 0 0 calc(33.333% - 12px);
    /* 4 cards per view, minus gap */
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    /* text-align: center; */
    min-width: 200px;
    /* fallback width */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.delivery-date-option:hover {
    transform: translateY(-4px);
}

/* Shipping option inside each card */
.shipping-option {
    margin-top: 8px;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.shipping-option:hover {
    background: #e2e2e2;
    border-color: #819f75;
    cursor: pointer;
    /* color: #fff; */
}

.shipping-option p.shipping-code {
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
    margin-bottom: 10px;
    padding-left: 28px;
}

.shipping-option p.dispatch-date {
    color: inherit;
    font-size: 75%;
    font-style: italic;
}

p.spend-more {
    font-style: italic;
    font-size: 75%;
    font-weight: bold;
    margin-top: 10px;
}


.shipping-option h4 {
    display: flex;
    justify-content: space-between;
    line-height: 1 !important;
    font-size: 1rem;
}

.shipping-option p {
    line-height: 1;
    margin-bottom: 0;
}

#chosen-shipping span.discount:after {
    content: "";
}

/* #chosen-shipping span.fullprice::before,
#chosen-shipping span.price::before {
    content: "£";
} */

#chosen-shipping span::before {

    display: block;
    text-align: center;
    font-size: 70%;
    font-weight: 600;
    text-transform: uppercase;
    color: #479dde;
}

#chosen-shipping span.code::before {
    content: 'Shipping Code:';
}

#chosen-shipping span.description::before {
    content: 'Service:';
}

#chosen-shipping span.dispatch::before {
    content: 'Dispatch Date:';
}

#chosen-shipping span.delivery::before {
    content: 'Estimated Delivery';
}

#chosen-shipping span.price::before {
    content: 'Shipping Price:';
}


/* Carousel nav buttons (keep existing) */
.carousel-nav {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.carousel-nav button {
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
}

.carousel-nav button:hover {
    background: #005177;
}

/* Carousel container */
#delivery-date-carousel {
    display: flex;
    /* horizontal layout */
    overflow-x: auto;
    /* enable horizontal scrolling */
    scroll-behavior: smooth;
    /* smooth scrolling when clicking buttons */
    gap: 10px;
    /* spacing between cards */
    padding-bottom: 4px;
    /* optional, prevent scrollbar overlap */
}

/* Individual cards */
.delivery-date-option {
    flex: 0 0 calc((100% / 3) - 6.666px);
    /* 3 cards per view minus gap */
    box-sizing: border-box;
    /* include padding/border in width */
}


.shipping-option.van {
    background-color: #fffab9;
}

.shipping-option.van h4 {
    position: relative;
    padding-left: 25px;
}

.shipping-option.van h4::before {
    position: absolute;
    display: block;
    content: "";
    width: 20px;
    height: 20px;
    left: 0;
    background-image: url(../images/van.svg);
    background-repeat: no-repeat;
}



.shipping-summary-icons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: space-around;
    margin: 1rem 0;
    border: 1px solid #ccc;
    padding: 1rem 0rem 0.9rem;
    border-radius: 4px;
}

.shipping-summary-icons.hidden,
#chosen-shipping.hidden,
button#change_shipping.hidden,
button#get-delivery-options.hidden {
    display: none !important;
}

.shipping-summary-icons span {
    min-width: 24px;
    font-size: 85%;
    /* background-color: #e2e2e2; */
    background-repeat: no-repeat;
    background-size: 30px;
    background-position: top;
    padding: 20px 0 0;
}


.shipping-summary-icons span.icon-postcode {
    background-image: url(../images/location.svg);
}

.shipping-summary-icons span.icon-address-type {
    background-image: url(../images/shop.svg);
}

.shipping-summary-icons span.icon-address-type.residential {
    background-image: url(../images/house.svg);
}

.shipping-summary-icons span.icon-van,
#chosen-shipping .code.peregrine-van::before {
    background-image: url(../images/van.svg);
}

.shipping-summary-icons span.icon-weight {
    background-image: url(../images/weight.svg);
}

.shipping-summary-icons span.icon-max-dimension {
    background-image: url(../images/size.svg);
}

.shipping-summary-icons span.icon-animal {
    background-image: url(../images/frog.svg);
}

.shipping-summary-icons span.icon-frozen {
    background-image: url(../images/frozen.svg);
}

.shipping-summary-icons span.icon-livefood {
    background-image: url(../images/cricket.svg);
}

.shipping-summary-icons span.icon-hazardous {
    background-image: url(../images/hazardous.svg);
}

h3.delivery-date sup {
    font-size: 14px;
}

h3.delivery-date small {
    text-transform: uppercase;
    font-size: 50%;
    line-height: 1;
    margin: 0;
    font-weight: bold;
}


#chosen-shipping {
    display: flex;
    justify-content: space-around;
    border: 1px solid #ccc;
    border-radius: 6px;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem 0;
}

#chosen-shipping span.code {
    font-size: 0.1px;
    color: #fff;
}

#chosen-shipping .code::before {
    content: "";
    display: inline-block;
    width: 100px;
    height: 46px;
    background-repeat: no-repeat;
    background-size: contain;
    margin-right: 0;
    background-position: center;
    margin-bottom: -4px;
}

button#change_shipping,
.carousel-nav button {
    background: #999999 !important;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem !important;
}

button#change_shipping {
    padding: 5px 10px !important;
    border-color: #479dde !important;
    background: #fff !important;
    color: #479dde;
    border-width: 1px;
    border-style: solid;
    border-radius: 6px;
    font-size: 10px;
    width: 8rem;
    max-width: 8rem;
    margin: 0 auto;
    display: block;
}

.shipping-option h4.shipping-method {
    background-repeat: no-repeat;
    background-size: auto 1rem;
    background-position: left;
    margin-bottom: 5px;
    padding-left: 28px;
}

h3.package,
h3.collection {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

h3.package::before,
h3.collection::before {
    content: "";
    display: inline-block;
    width: 60px;
    height: 60px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 1rem;
}


.delivery-collection {
    display: flex;
    column-gap: 5rem;
    justify-content: center;
}

.carousel-nav button {
    background-color: #999999 !important;
}

.delivery-collection button {
    background-color: #999999 !important;
    color: #fff;
    transition: all 0.2s ease;
    transform: scale(1);
}

.delivery-collection button:hover,
.delivery-collection button:active {
    transform: scale(1.1);
    background-color: #7ac143 !important;
    /* color: #3c3c3c; */
}

.delivery-collection button {
    position: relative;
}

#shipping-address {
    margin: 1rem 0;
}

/* Base checkmark positioning */
.delivery-collection button svg.checkmark {
    position: absolute;
    right: -10px;
    top: -10px;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    display: none;
}

/* When selected */


.delivery-collection button.selected {
    background-color: #3ab54a !important;
    /* color: #3c3c3c; */
}

.delivery-collection button.selected .checkmark {
    display: block;
    border-radius: 50%;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #bcce00;
    animation: fill 0.4s ease-in-out 0.4s forwards,
        scale 0.3s ease-in-out 0.9s both;
}

.delivery-collection button.selected .checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #7ac142;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.delivery-collection button.selected .checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

/* Animations (unchanged) */
@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #7ac142;
    }
}

/* Show only the first name field */
#shipping_first_name_field {
    display: block !important;
}

p#shipping_first_name_field {
    width: 100%;
}

@media (min-width: 993px) {
    body.page-template-template-fullwidth-php form.checkout .col2-set {
        /* max-width: 100% !important; */
        width: 100% !important;
    }
}

p#shipping_first_name_field {
    width: 100% !important;
}



.woocommerce-order ul.order_details {
    margin-bottom: 0;
}

#chosen-shipping.woocommerce-thankyou-order-details {
    align-items: center;
    border: none;
    border-radius: 0;
    margin: 0;
    padding-top: 0;
}

span.collection {
    text-align: center;
    display: block;
    padding: 1rem 0 0;
    font-weight: bold;
}

span.courier.collection {
    text-align: left;
    display: inline;
    padding-left: 3rem;
    font-weight: normal;
}

.collection-date-select {
    display: flex;
    justify-content: center;
    column-gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

select#collection-date {
    width: auto;
}

.woocommerce-checkout p.woocommerce-thankyou-order-received {
    color: #3ab54a !important;
}

.woocommerce-checkout p.woocommerce-thankyou-order-received:before {
    background: #3ab54a !important;
}

.woocommerce-order ul.order_details {
    background-color: transparent !important;
}

.no-delivery-options {
    /* text-align: center; */
    background: #e6f6f9;
    padding: 1rem;
    border-left: 3px solid #168bcd;
}

ul#shipping_method li label:before {
    display: none !important;
    content: "" !important;
}

span.courier {
    position: relative;
    padding-left: 0rem;
}

span.courier.collection,
span.courier.apc,
span.courier.royal-mail,
span.courier.kings,
span.courier.dx,
span.courier.peregrine-van {
    padding-left: 3rem;
}

span.courier:before {
    content: "";
    display: inline-block;
    margin-right: 1rem;
    width: 2rem;
    height: 2rem;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    bottom: -0.4rem;
    position: absolute;
    left: 0rem;
}

span.courier.collection:before,
h3.collection::before {
    background-image: url(../images/box.png);
}

.shipping-option.apc h4.shipping-method,
#chosen-shipping .code.apc::before,
h3.package.apc::before,
span.courier.apc:before {
    background-image: url(../images/apc.png);
}

.shipping-option.royal-mail h4.shipping-method,
#chosen-shipping .code.royal-mail::before,
h3.package.royal-mail::before,
span.courier.royal-mail:before {
    background-image: url(../images/rm.svg);
}

.shipping-option.kings h4.shipping-method,
#chosen-shipping .code.kings::before,
h3.package.kings::before,
span.courier.kings:before {
    background-image: url(../images/kings.png);
}

.shipping-option.dx h4.shipping-method,
#chosen-shipping .code.dx::before,
h3.package.dx::before,
span.courier.dx:before {
    background-image: url(../images/dx.png);
}

h3.package.peregrine-van::before,
span.courier.peregrine-van:before {
    background-image: url(../images/van.svg);
}

table.woocommerce-table--order-details tfoot tr td,
table.woocommerce-table--order-details tfoot tr th {
    padding: 0.5rem 0;
    border-top: 1px solid #eeeeee;
}

.woocommerce-order-details p.order-again {
    display: none;
    ;
}

table.woocommerce-table--order-details tfoot tr:last-child td,
table.woocommerce-table--order-details tfoot tr:last-child th {
    padding-top: .5rem;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

/* Mobile-only */

@media (max-width: 500px) {
    .woocommerce-checkout .checkout-wrap {
        margin-bottom: 40px !important;
    }

}

@media (max-width: 992px) {

    .select2-results__option {
        padding: 14px 6px !important;
        font-size: 10px !important;
    }

    .shipping-summary-icons span {
        font-size: 10px;
    }

    h3,
    .wp-block-heading h3 {
        font-size: 16px !important;
    }

    .shipping-option h4 {
        font-size: 12px !important;
        padding-left: 32px !important;
    }

    p.shipping-code {
        font-size: 10px !important;
        padding-left: 32px !important;
        padding-top: 4px !important;
    }

    .loader-inline,
    .loader {
        font-size: 12px;
    }


    form.checkout {
        padding-top: 0 !important;
    }

    .select2-results__option {
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.4;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .delivery-collection {
        column-gap: 2rem;
    }

    #chosen-shipping {
        display: block;
    }

    /* Shipping code full width and centered */
    #chosen-shipping span.code {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
        /* spacing below code */
    }

    #chosen-shipping span.description,
    #chosen-shipping span.dispatch,
    #chosen-shipping span.delivery,
    #chosen-shipping span.price {
        display: grid;
        grid-template-columns: 49% 49%;
        gap: 5px 2%;
        align-items: center;
        margin-bottom: 5px;
        font-size: 12px;
    }

    /* Consistent styling for labels */
    #chosen-shipping span.description::before,
    #chosen-shipping span.dispatch::before,
    #chosen-shipping span.delivery::before,
    #chosen-shipping span.price::before {
        display: block;
        text-align: right;
        font-size: 70%;
        font-weight: 600;
        text-transform: uppercase;
        color: #479dde;
        white-space: normal;
        /* wrap if needed */
    }

    /* Ensure values wrap nicely */
    #chosen-shipping span.description,
    #chosen-shipping span.dispatch,
    #chosen-shipping span.delivery,
    #chosen-shipping span.price {
        white-space: normal;
        word-break: break-word;
    }

    ul.ipc-suggestion-container.ipc-suggestion li.ipc-address,
    .select2-results__option {
        padding: 12px 6px;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
        line-height: 1.5;
        color: #333;
    }
}

.delivery-collection {
    position: relative;
}

.delivery-collection:before {
    content: " or ";
    position: absolute;
    top: 6px;
    left: calc(50% - 0.9rem);
}

#get_addresses.selected,
#collection.selected {
    pointer-events: none;
}


#customer_details,
#order_review {
    opacity: 0.2;
    transition: all 0.2s ease;
    pointer-events: none;
}

#customer_details.valid,
#order_review.valid {
    opacity: 1;
    pointer-events: auto;

}

div#order_review {
    margin-top: 2rem;
}

a.back-to-basket {
    background: #446367;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 80%;
    margin-left: 0.2rem;
    top: -2px;
    position: relative;
    transition: all 0.2s ease;
    transform: scale(0.9);
}

a.back-to-basket:hover {
    color: #fff;
    transform: scale(1);
}