/**
 * Sample cart drawer and header count.
 *
 * Only what makes the drawer work: a right-hand panel over an overlay, the tile grid
 * and the count on the header link. The look is left to the theme.
 *
 * @package EchelonCore
 */

/* Header Samples link count. */
.request-sample-cart a,
.request-sample-cart .kt-blocks-info-box-media-container {
    position: relative;
}

.request-sample-cart__count {
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--global-palette1);
    color: #050505;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

@media screen and (min-width: 1025px) {
    .request-sample-cart__count {
        right: 14px;
    }
}

.request-sample-cart__count[hidden] {
    display: none;
}

/* Drawer. */
.sample-cart[hidden],
.sample-cart__view[hidden],
.sample-cart__empty[hidden],
.sample-cart__footer[hidden] {
    display: none;
}

.sample-cart {
    position: fixed;
    inset: 0;
    z-index: 100001;
}

.sample-cart__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.sample-cart__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 480px);
    background: var(--global-palette9);
}

.sample-cart__view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sample-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 32px;
    padding: 24px 0;
    border-bottom: 1px solid rgba(33, 36, 34, 0.20);
}

.sample-cart__title {
    margin: 0;
}

.sample-cart__close,
.sample-cart__back {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.sample-cart__close {
    font-size: 2.5rem;
    line-height: 1;
    padding: 0 12px;
}

.sample-cart__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 32px 24px;
}

.sample-cart__group {
    padding: 24px 0;
    border-bottom: 1px solid rgba(33, 36, 34, 0.20);
}

.sample-cart__product {
    margin: 0 0 16px;
}

.sample-cart__product a {
    color: inherit;
    text-decoration: none;
}

.sample-cart__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sample-cart__tile {
    position: relative;
    width: 88px;
}

.sample-cart__chip {
    display: block;
    width: 88px;
    height: 88px;
    padding: 3px;
    border: 1px solid var(--global-palette4);
    background-clip: content-box;
    background-origin: content-box;
    background-position: center;
    background-size: cover;
}

.sample-cart__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: none;
    color: var(--global-palette5);
}

.sample-cart__remove:hover,
.sample-cart__remove:focus {
    border-color: var(--global-palette3);
}

.sample-cart__remove:hover circle,
.sample-cart__remove:focus circle  {
    fill: var(--global-palette3);
}

.sample-cart__remove:hover path,
.sample-cart__remove:focus path {
    color: var(--global-palette9);
}

.sample-cart__color {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

/* Empty cart: the message and Browse Products in the middle of the panel. */
.sample-cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: auto 0;
    text-align: center;
}

.sample-cart__empty p {
    margin: 0;
}

.sample-cart__footer {
    padding: 24px 32px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.sample-cart .sample-cart__request {
    width: 100%;
    background-color: var(--global-palette2) !important;
    color: var(--global-palette3) !important;
    border-color: var(--global-palette2);
    box-shadow: none !important;
    text-align: center;
}

.sample-cart .sample-cart__request:hover,
.sample-cart .sample-cart__request:focus {
    background-color: var(--global-palette1) !important;
    color: var(--global-palette9) !important;
    border-color: var(--global-palette1);
}

.sample-cart__request[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

html.sample-cart-open,
html.sample-cart-open body {
    overflow: hidden;
}

/* Short viewport height (e.g. phone landscape or high zoom): scroll the whole panel. */
@media screen and (min-aspect-ratio: 2 / 3) and (max-width: 767px) {
    .sample-cart__panel {
        overflow-y: auto;
    }

    .sample-cart__view {
        height: auto;
        min-height: 100%;
    }

    .sample-cart__body {
        flex: 1 1 auto;
        overflow-y: visible;
    }
}

@media (max-width: 480px) {
    .sample-cart__header,
    .sample-cart__body,
    .sample-cart__footer {
        margin-right: 16px;
        margin-left: 16px;
        padding-right: 0;
        padding-left: 0;
    }
}

/* The Requested Samples form field reuses the drawer's list markup. */
.echelon-sample-requests .sample-cart__group:first-child {
    padding-top: 0;
}

.echelon-sample-requests .sample-cart__empty {
    align-items: flex-start;
    margin: 0;
    text-align: left;
}

.echelon-sample-requests .sample-cart__empty[hidden] {
    display: none;
}
