/* Variables */
:root {
    --hbh-popup-lasche-width: 44px;
}

/* Wrapper / Drawer */
.hbh-popup-drawer {
    --hbh-font-main: "komet", Arial, sans-serif;
    --hbh-font-heading: "komet", Arial, sans-serif;
    --hbh-translate-y: 0px;
    --hbh-translate-x-open: 0px;
    --hbh-translate-x-closed: 0px;
    
    position: fixed;
    z-index: 999999;
    display: flex;
    transition: transform 0.4s ease;
    width: max-content;
    max-width: 95vw;
    
    /* Default open state transform */
    transform: translateY(var(--hbh-translate-y)) translateX(var(--hbh-translate-x-open));
}

/* Closed state */
.hbh-popup-drawer.is-closed {
    transform: translateY(var(--hbh-translate-y)) translateX(var(--hbh-translate-x-closed));
}

/* RIGHT Position */
.hbh-popup-drawer.position-right {
    right: 0;
    --hbh-translate-x-closed: calc(100% - var(--hbh-popup-lasche-width));
}
.hbh-popup-drawer.position-right .hbh-popup-lasche {
    order: 1;
    border-radius: 8px 0 0 8px;
}
.hbh-popup-drawer.position-right .hbh-popup-content-wrap {
    order: 2;
}

/* LEFT Position */
.hbh-popup-drawer.position-left {
    left: 0;
    --hbh-translate-x-closed: calc(-100% + var(--hbh-popup-lasche-width));
}
.hbh-popup-drawer.position-left .hbh-popup-lasche {
    order: 2;
    border-radius: 0 8px 8px 0;
}
.hbh-popup-drawer.position-left .hbh-popup-content-wrap {
    order: 1;
}

/* VERTICAL Positions */
.hbh-popup-drawer.hbh-v-pos-center {
    top: 50%;
    align-items: center;
    --hbh-translate-y: -50%;
}

.hbh-popup-drawer.hbh-v-pos-top {
    top: 10vh;
    align-items: flex-start;
    --hbh-translate-y: 0px;
}

.hbh-popup-drawer.hbh-v-pos-bottom {
    bottom: 10vh;
    align-items: flex-end;
    --hbh-translate-y: 0px;
}

/* Lasche */
.hbh-popup-lasche {
    width: var(--hbh-popup-lasche-width);
    background-color: var(--hbh-primary-color);
    color: #fff;
    padding: 15px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.hbh-popup-lasche span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--hbh-font-main);
    font-weight: 600;
    letter-spacing: 1px;
}

.hbh-popup-lasche svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* Flip the arrow depending on open/close and side */
.hbh-popup-drawer.position-right.is-open .hbh-popup-lasche svg {
    transform: scaleX(-1);
}
.hbh-popup-drawer.position-left.is-open .hbh-popup-lasche svg {
    transform: scaleX(-1);
}

/* Content Wrap */
.hbh-popup-content-wrap {
    background: #fff;
    width: 600px; /* fixed max */
    max-width: calc(95vw - var(--hbh-popup-lasche-width));
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.hbh-popup-body {
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.hbh-popup-content-left {
    flex: 1;
    text-align: center;
}

.hbh-popup-headline {
    font-family: var(--hbh-font-heading);
    color: #404040;
    font-size: 32px;
    margin: 0 0 20px 0;
    line-height: 1.2;
    font-weight: 700;
}

.hbh-popup-text {
    font-family: var(--hbh-font-main);
    color: #7e7e7e;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.hbh-popup-action {
    margin-bottom: 20px;
}

.hbh-popup-btn {
    display: inline-block;
    background-color: var(--hbh-primary-color);
    color: #fff;
    font-family: var(--hbh-font-main);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    transition: opacity 0.2s ease;
}

.hbh-popup-btn:hover {
    opacity: 0.9;
    color: #fff;
}

.hbh-popup-footer-text {
    font-family: var(--hbh-font-main);
    color: #a0a0a0;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}

.hbh-popup-image-right {
    width: 150px;
    flex-shrink: 0;
}

.hbh-popup-image-right img {
    max-width: 100%;
    height: auto;
    display: block;
}

.hbh-popup-bottom-close {
    text-align: center;
    padding-bottom: 15px;
}

.hbh-popup-text-close-btn {
    background: transparent !important;
    border: none !important;
    font-family: var(--hbh-font-main) !important;
    color: #7e7e7e !important;
    font-size: 14px !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hbh-popup-drawer .hbh-popup-text-close-btn:hover {
    color: #404040 !important;
    background: transparent !important;
}

/* Optional Overlay */
.hbh-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.hbh-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .hbh-popup-image-right {
        display: none;
    }
    .hbh-popup-body {
        padding: 30px 20px 10px 20px;
    }
    .hbh-popup-headline {
        font-size: 24px;
    }
    .hbh-popup-text {
        font-size: 16px;
    }
}
