/* --- Overlay --- */
#custom-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

/* Aktivní (viditelný) overlay */
#custom-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Modal --- */
#custom-cart-modal {
    position: fixed;
    top: 35px;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 100%;
    display: flex;              /* přidáno */
    flex-direction: column;     /* přidáno */
    height: calc(100vh - 35px); /* přidáno */
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(.25,.8,.25,1);
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 1px solid #ccc;
    font-family: "Plus JakartaSans", sans-serif;
}

/* --- Wrapper obsahu modalu --- */
#custom-cart-content-wrapper {
    flex: 1 1 auto;             /* přidáno */
    overflow-y: auto;            /* přidáno */
}

/* Aktivní modal = sliduje dovnitř */
#custom-cart-modal.active {
    transform: translateX(0);
}

/* --- Modal header --- */
.custom-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 25px 30px;
    position: relative;
}

/* Oddělovací linka pod headerem */
.custom-cart-header::after {
    content: "";
    position: absolute;
    bottom: 10px;             /* odsazení od spodní hrany headeru */
    left: 30px;               /* odsazení zleva – stejné jako padding headeru */
    right: 30px;              /* odsazení zprava – stejné jako padding headeru */
    max-width: 399px;         /* maximální délka linky */
    border-bottom: 1px solid #eee;
    margin: 0 auto;           /* centrování linky, pokud je kratší než rodič */
}

.custom-cart-header h3 {
    font-size: 26px;
    font-weight: 600;
    margin: 0;
    color: #203737;
}

.mini-cart-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #C65C47;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    margin-bottom: 2px;
    vertical-align: middle;
    font-family: "Plus JakartaSans", sans-serif;
}

#custom-cart-close {
    position: absolute;
    right: 28px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(244, 243, 237);
    border-radius: 50px;
    border: none;
    color: rgb(32, 55, 55);
    cursor: pointer;
    font-family: "Plus JakartaSans", sans-serif;
}

/* --- Loader --- */
.mini-cart-loader {
    text-align: center;
    padding: 20px 0;
    font-style: italic;
    color: #555;
}

/* === Obsah mini-cart === */
.custom-cart-content {
    flex: 1;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 25px 30px;
}
.mini-cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.woocommerce-mini-cart-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}
.mini-cart-item-img img {
    width: 60px;
    height: 90px;
    margin-right: 20px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}
.mini-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.mini-cart-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #203737;
    text-decoration: none;
}
.mini-cart-second-row {
    margin: 15px 0px 8px;
}
.mini-cart-item-price {
    display: inline-block;
    font-size: 14px;
    font-weight: 800;
    color: #203737;
}
.wc-block-components-product-price__value.is-discounted {
    font-weight: 800;
}
.mini-cart-item-regular-price {
    font-size: 14px;
    color: #696969;
    text-decoration: line-through;
}
.mini-cart-item-savings {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 12px;
}
/* --- Remove wrapper --- */
.mini-cart-quantity-remove-wrapper {
    display: flex;
    justify-content: space-between; /* quantity vlevo, Odstranit vpravo */
    align-items: center;
}
/* --- Remove link --- */
.mini-cart-item-remove {
    font-size: 12px;
    text-decoration: underline;
    align-self: flex-start; /* zarovnání nahoru */
}

.mini-cart-item-remove:hover {
    color: #d36047;
    text-decoration: none;
}

/* === Vlastní množství v mini-cart === */
/* Obal quantity selectoru */
.wc-block-components-quantity-selector {
    background: var(--wp--preset--color--bg-1);
    display: flex;
    padding: 3px 11.5px;
    border-radius: 60px;
    /* border: 1px solid color-mix(in srgb, currentColor 30%, transparent 70%); */
    align-items: center;
    width: 107px;
    box-sizing: content-box;
    margin: 0 0 .25em;
    position: relative;
}

/* Input */
.wc-block-components-quantity-selector__input {
    width: 40px;
    text-align: center !important;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 44px;
    box-sizing: border-box;       /* zajistí, že padding neovlivní width */
    padding: 0;                   /* odstraní výchozí padding */
    
    /* Appearance pro konzistentní styl napříč prohlížeči */
    -webkit-appearance: none;     /* Safari, Chrome */
    -moz-appearance: textfield;   /* Firefox (pro starší verze) */
    appearance: none;              /* moderní standard */
}

/* odstranění šipek v Chrome/Safari */
.wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-components-quantity-selector__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Tlačítka minus/plus */
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,
.wc-block-components-quantity-selector button {
    border: 0 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color:#203737 !important;
    font-weight: 400 !important;
    outline: 0 !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50px !important;
    margin: 0;
    min-width: 30px;
    padding: 0;
    text-align: center;
    text-decoration: none;
    font-style: normal;
    opacity: 1 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hover efekt */
.wc-block-components-quantity-selector__button:hover {
    background: #f2f2f2;
}

/* --- Subtotal --- */
.mini-cart-subtotal {
    font-weight: bold;
    font-size: 14px;
    margin-left: auto;
}

/* === Patička === */
.custom-cart-footer {
    font-family: Plus JakartaSans, sans-serif;
    padding: 25px 30px 18px;
}
.mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px !important;
    font-weight: 600;
    color: #1f2c2d;
    border-top: 1px solid #eee;
    padding-top: 15px;
}
.mini-cart-total-saved {
    font-size: 10px;
    font-weight: 600;
    color: #27ae60;
}
.mini-cart-note {
    font-size: 10px;
    font-weight: 400;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 20px;
}
.mini-cart-buttons {
    display: flex;
    gap: 15px;
}
.mini-cart-buttons .button {
    flex: 1;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0;
    display: inline-block;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}
.button.wc-forward {
    background-color: #1f2c2d;
    color: #fff;
}
.button.checkout {
    background-color: #c65c47;
    color: #fff;
}
.button.wc-forward:hover {
    background-color: #324849;
}
.button.checkout:hover {
    background-color: #d86a56;
}

/* --- Nové sekce: scroll, footer, blokace scrollu pozadí --- */

/* Obsah modalu – scrollovatelný */
.custom-cart-content {
    flex: 1 1 auto;                  /* vyplní prostor mezi headerem a footerem */
    overflow-y: auto;                 /* scroll uvnitř */
    -webkit-overflow-scrolling: touch; /* plynulý scroll na iOS */
    padding: 30px;
}

/* Footer s tlačítky – fixní dole */
.custom-cart-footer {
    flex-shrink: 0;          /* footer se nesmršťuje */
    background: #fff;
    padding: 30px;
}

/* Přidat třídu pro zablokování scrollu pozadí */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 782px) {
    /* Sticky tlačítka na spodní hraně modalu */
    .mini-cart-buttons--sticky {
        position: sticky;  /* nebo fixed, pokud chceš opravdu vždy dole */
        bottom: 0;
        left: 0;
        width: 100%;           /* vyplní šířku modalu */
        background: #fff;
        display: flex;
        gap: 15px;
        box-sizing: border-box;
        z-index: 9999;
        margin: 15px 0px 25px;
    }

    /* Optional: menší padding obsahu, aby tlačítka nekryla obsah */
    .custom-cart-content {
        padding-bottom: 88px;  /* výška tlačítek */
    }

    /* Sticky shadow */
    .custom-cart-footer--sticky {
        box-shadow: 0 -10px 20px 10px currentColor;
        color: hsla(0, 0%, 80%, .3);
    }
}

body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* */
