@import "core.css";
@import "gallery.css";
@import "checkout.css";

:root {
    --product-height: 9em;
    --product-padding-block: 10px;
    --product-padding-inline: 15px;

    --cart-product-height: 7em;
    --cart-product-margin-block: 5px;
    --cart-product-margin-start: var(--cart-product-margin-block);
    --cart-product-margin-end: var(--cart-product-margin-block);
}
#cart-button::after {
    content: attr(data-counter);
    line-height: 0;
    font-size: x-small;
    font-weight: 600;
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: var(--color-accent);
    padding: 6px;
    border-radius: 999em;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}
#cart-button[data-counter="0"]::after {
    transform: translateX(-50%) scale(0);
    opacity: 0;
}
header {
    background-color: var(--color-background-primary);
}
#top-bar {
    margin-inline-end: 50px;
}
#checkout-button:focus-visible,
#checkout-button:hover {
    color: var(--color-accent) !important;
    background-color: var(--color-background-secondary);
}
#search-bar {
    position: fixed;
    left: 25px;
    display: flex;
    align-items: flex-end;
    width: 260px;
    height: calc(var(--title-height) + 1px /* (1px = height of the bottom border) */);
    padding-top: var(--header-height);
    background-color: var(--color-background-primary);
    z-index: 6;
}
#search-term {
    width: 100%;
    height: 100%;
    padding: 0 28px 0 4px;
    background: var(--color-background-primary);
    border: none;
    border-bottom: 1px solid var(--color-foreground-primary);
    font-family: inherit;
    font-size: x-large;
    box-sizing: border-box;
}
#search-bar > ul {
    position: absolute;
    min-width: 180px;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    border: 1px solid black;
    background-color: var(--color-background-primary);
    list-style: none;
    padding: 0;
    margin: 0;
}
#search-bar li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 5px 8px;
    cursor: pointer;
}
#search-bar li:hover {
    background-color: var(--color-background-tertiary);
}
#search-bar .product-thumbnail,
#search-bar .product-thumbnail img,
#conflict-table .product-thumbnail,
#conflict-table .product-thumbnail img {
    width: 3em;
    height: 3em;
}
#search-bar span {
    word-break: break-word;
    hyphens: auto;
}
#category-button,
#search-button {
    height: 100%;
    width: 28px;
    margin-top: 2px;
    padding: 6px;
    border: none;
    cursor: pointer;
    background: transparent;
    z-index: 1;
}
#search-button {
    margin-left: -28px;
}
#category-button {
    display: none;
    margin-bottom: 2px;
    flex: 0 0 auto;
}
#cart-title {
    flex-shrink: 0;
    height: var(--title-height);
    right: var(--site-padding);
    margin-bottom: -20px;
    font-size: x-large;
}
#cart-button {
    position: fixed;
    top: 20px;
    right: var(--site-padding);
    z-index: 8;
}
.products {
    max-height: 100%;
    border: solid black 1px;
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-bottom: 20px;
}
#products {
    max-width: 700px;
}
#products:has(#loading-text),
#products:has(#empty-category-text),
#products:has(#empty-search-text),
#products:has(#no-favorites-text),
#products:has(#no-category-content),
#products:has(#marketing-hero) {
    max-width: inherit;
    border: none;
    overflow-y: hidden;
    transition: max-width 0.3s ease, border 0.1s ease;
}
#products:has(#marketing-hero) {
    width: fit-content;
    height: 100%;
    margin-inline: auto;
    padding: 0;
}
#products > .product {
    height: unset;
    min-height: var(--product-height);
}
#products > .product > .product-details {
    height: var(--product-height);
}
.loading-text,
#loading-text,
#empty-category-text,
#empty-search-text,
#no-favorites-text,
#no-category-content {
    padding-top: 20px;
    text-align: center;
}
.product {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    column-gap: 15px;
    margin: -1px;
    border: 1px solid black;
    height: var(--product-height);
    padding: var(--product-padding-block) var(--product-padding-inline);
    overflow: hidden;
    container-type: inline-size;
    container-name: product;
}
.product input,
.product button {
    width: 25px;
    height: 25px;
    border: none;
    padding: 0;
    color: var(--color-foreground-primary);
    background-color: var(--color-background-secondary);
}
.product .product-thumbnail {
    flex-basis: 0;
    width: 6em;
    height: 6em;
    align-self: center;
}
.product-thumbnail img {
    width: 6em;
    height: 6em;
}
.product-thumbnail.gallery-available {
    cursor: pointer;
}
.product-details {
    display: flex;
    position: relative;
    flex-direction: column;
    flex-basis: 0;
    flex-grow: 1;
}
.product h3 {
    width: calc(100% - 30px);
    margin: 5px 0;
}
.product p {
    margin: 5px 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.product-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    position: absolute;
    bottom: 0;
    right: 0;
}
.product-pricing {
    font-size: 1.2em;
}
.counter {
    height: 25px;
    display: flex;
    gap: 3px;
    position: relative;
}
.counter::before {
    font-size: 14px;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%, 0);
}
.counter:lang(de)::before {
    content: "Menge";
}
.counter:lang(en)::before {
    content: "Amount";
}
.counter-button {
    font-size: 20px;
    line-height: 0;
}
.counter-input {
    font-family: inherit;
    font-size: 15px;
    text-align: center;
}
.details-button {
    display: none;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
}
:root[data-view-only] .product .remove-button,
:root[data-view-only] .product .counter-button {
    display: none;
}
:root[data-view-only] .product .counter-input {
    font-size: 1.2em;
    background-color: transparent;
    font-weight: 600;
}
#products > .product.removed {
    border-width: 0;
    transition: border-width 0.1s ease;
    animation: remove-product 0.4s ease forwards;
}
@keyframes remove-product {
    0% {
        height: var(--product-height);
        min-height: var(--product-height);
        padding-block: var(--product-padding-block);
        margin: -1px;
    }
    100% {
        height: 0;
        min-height: 0;
        padding-block: 0;
        margin-top: 1px;
    }
}
.recommendations-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    flex-basis: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: grid-template-rows 0.3s ease, margin 0.3s ease;
}
.recommendations-wrapper.visible {
    margin-top: 10px;
    grid-template-rows: 1fr;
}
.recommendations-wrapper.visible .recommendations {
    margin-bottom: 0;
}
.recommendations {
    border: solid black 1px;
    margin-block: -1px;
    overflow: hidden;
}
.recommendations::before {
    display: block;
    line-height: 2;
    text-align: center;
    border-top: solid black 1px;
}
.recommendations:lang(de)::before {
    content: "Empfohlenes Zubehör";
}
.recommendations:lang(en)::before {
    content: "Recommended Add-ons";
}
.side-bar.right {
    display: none;
    height: 0;
    max-height: unset;
    padding-bottom: 0;
}
.side-bar.right.visible {
    animation: 0.5s ease-in-out side-bar-right-appear;
    height: calc(100% - var(--header-height) - var(--footer-height) - var(--site-padding));
    padding-bottom: var(--site-padding);
}
.side-bar:not(.visible) {
    transition: height 0.5s ease-in-out, padding-bottom 0.5s ease-in-out;
}
@keyframes side-bar-right-appear {
    0% {
        height: 0;
        padding-bottom: 0;
    }
    100% {
        height: calc(100% - var(--header-height) - var(--footer-height) - var(--site-padding));
    }
}
#cart {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    background-color: var(--color-background-primary);
}
#cart label {
    display: block;
    width: 100%;
    height: auto;
    font-size: small;
    text-indent: 2px;
    color: var(--color-foreground-primary);
}
#cart select {
    width: 100%;
    height: 30px;
    padding-inline-start: 5px;
    font-size: medium;
    border: 1px solid var(--color-foreground-primary);
}
#cart-selector,
#cart-contact {
    width: 100%;
}
#cart-selector .select-with-actions {
    width: 100%;
}
#cart-selector button {
    width: 30px;
    height: 30px;
    font-size: 20px;
}
#cart-products {
    min-height: 260px;
    max-height: 100%;
    width: 100%;
}
.select-with-actions > select {
    z-index: 1;
}
#products-not-webshop,
#products-not-available {
    padding: 10px;
    background-color: color-mix(in srgb, var(--color-accent) 20%, white);
}
#products-not-webshop li,
#products-not-available li {
    list-style: unset;
}
#cart-products > .product {
    transform-origin: bottom;
    height: 0;
    padding-block: 0;
    gap: 15px;
    overflow: hidden;
    font-size: 0.85rem;
    transition: height 0.3s ease, padding 0.3s ease;
}
#cart-products > .product.visible {
    padding-block: var(--product-padding-block);
    animation: insert-cart-product 0.3s ease;
    height: var(--cart-product-height);
}
@keyframes insert-cart-product {
    0% {
        height: 0;
        padding-block: 0;
    }
    100% {
        height: var(--cart-product-height);
        padding-block: var(--product-padding-block);
    }
}
#cart-products > .highlight {
    position: relative;
}
.side-bar.right.visible #cart-products > .highlight::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: highlight-cart-products 1.5s ease;
}
@keyframes highlight-cart-products {
    0% { border: transparent solid 4px }
    25% { border: var(--color-accent) solid 4px }
    75% { border: var(--color-accent) solid 4px }
    100% { border: transparent solid 4px }
}
#cart-products .product-thumbnail,
#cart-products .product-thumbnail img {
    height: 3.2em;
    width: 3.2em;
}
#cart-products .counter::before {
    /*content: "";*/
}
#cart-products .remove-button {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 18px;
    line-height: 0;
}
.totals {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.totals p {
    padding-inline: 10px;
    text-align: right;
    line-height: 1.3;
}
#cart-total {
    height: 100px;
    width: 100%;
    flex: 0 0 auto;
}
#cart-total ::before {
    position: absolute;
    left: 10px;
}
.total-gross,
.total-gross-all-days {
    font-weight: 600;
}
.total-net::before {
    content: "Netto (pro Tag):";
}
.total-net-rent-daily::before {
    content: "Netto Miete (pro Tag):";
}
.total-net-rent-all-days::before {
    content: "Netto Miete (Gesamtzeitraum):";
}
.total-discount::before,
.total-discount-all-days::before {
    content: "Rabatt:";
}
.total-taxes::before {
    content: "Mehrwertsteuer (19%):";
}
.total-net-insurance::before {
    content: "Versicherung der Miete (6%):";
}
.total-net-sale::before {
    content: "Netto Verkauf:";
}
.total-gross::before {
    content: "Brutto (pro Tag):";
}
.total-net-all-days::before {
    content: "Zwischensumme:";
}
.total-net-discounted-all-days::before {
    content: "Nettosumme:";
}
.total-gross-all-days::before {
    content: "Bruttosumme:";
}
#checkout-button {
    flex-shrink: 0;
    width: 100%;
    height: 40px;
    font-family: inherit;
    font-weight: 600;
    font-size: 18px;
    padding: 0;
    border: none;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#checkout-button:enabled {
    color: white;
    background-color: var(--color-accent);
    cursor: pointer;
}
#checkout-button:enabled:focus-visible,
#checkout-button:enabled:hover {
    color: var(--color-accent) !important;
    background-color: var(--color-background-secondary);
}
#checkout-button:disabled {
    transition: none;
}
#conflict-table {
    width: 100%;
    border-collapse: collapse;
}
#conflict-table thead {
    background: var(--color-background-secondary);
    font-size: medium;
}
#conflict-table tr {
    border: 1px solid var(--color-foreground-primary);
}
#conflict-table th,
#conflict-table td {
    padding: .45rem .5rem;
    text-align: center;
}
#conflict-table th:nth-child(1),
#conflict-table td:nth-child(1) {
    padding-inline: 0.8em;
    border-right: 1px solid black;
}
#conflict-table th:nth-child(2),
#conflict-table td:nth-child(3) {
    text-align: left;
}
#conflict-table label.choice input {
    display: inline-block;
    margin: 0;
    padding: 0;
    width: 35px;
    aspect-ratio: 1;
    appearance: none;
    font: inherit;
    box-sizing: border-box;
    text-align: center;
    font-size: large;
    font-weight: 600;
    align-content: center;
    border: 1px solid var(--color-foreground-primary);
    border-radius: 50%;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}
#conflict-table label.choice input:checked {
    background: var(--color-success);
    color: var(--color-background-primary);
    border: 1px solid transparent;
}
#conflict-table label.choice input:not(:checked):hover {
    background-color: var(--color-background-secondary);
}
#conflict-table label.choice input:before {
    content: attr(value);
}
#favorites-category {
    border-bottom: 1px solid var(--color-background-tertiary);
    margin-bottom: 10px;
    padding-bottom: 12px !important;
}
.favorite-button {
    position: absolute;
    top: 10px;
    right: 15px;
    padding: 0;
    z-index: 1;
}
.favorite-button img {
    width: 16px;
    height: 16px;
    display: block;
    margin: auto;
    transition: opacity 0.2s ease-in-out;
}
.favorite-button:hover img {
    opacity: 0.5;
}

/* Tablet in landscape mode or smaller */
@media only screen and (max-width: 1199px) {
    .side-bar.right.visible {
        animation: 0.5s ease-in-out side-bar-right-appear;
        height: calc(100% - var(--footer-height));
        padding-bottom: var(--site-padding);
    }
    @keyframes side-bar-right-appear {
        0% {
            height: 0;
            padding-bottom: 0;
        }
        100% {
            height: calc(100% - var(--footer-height));
        }
    }
    #cart-title {
        height: var(--header-height);
        font-size: xx-large;
    }
}
/* Tablet in portrait mode or smaller */
@media only screen and (max-width: 819px) {
    #search-bar {
        left: 100px;
        width: calc(100% - 235px);
        padding-top: 25px;
    }
    #category-button {
        display: inline-block;
    }
}
/* Mobile phone or smaller */
@media only screen and (max-width: 605px) {
    .product h3 {
        font-size: smaller;
    }
    .product p {
        font-size: small;
    }
    #conflict-paragraph {
        flex-direction: column;
        gap: 1em;
    }
}
/* Devices with lower height */
@media only screen and (max-height: 669px) and (max-width: 1199px) {
    #cart-products {
        min-height: unset;
        height: 100%;
    }
}

@container product (max-width: 530px) {
    h3 {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
    p {
        font-size: small;

        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
}

#cart-products:not(.loading):empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

#cart-products:not(.loading):empty::after {
    content: "Your cart is empty";
    color: var(--color-foreground-secondary);
}

#cart-products:not(.loading):empty:lang(de)::after {
    content: "Der Warenkorb ist leer";
}
