/**
 * BOW Service Card - Storefront Styles
 * 
 * Verwendet CSS Custom Properties für flexible Konfiguration:
 * --bow-card-bg, --bow-card-border, --bow-card-radius, etc.
 */

/* === Overflow Fix für CMS Container === */
/* Erlaubt Icons außerhalb der Card-Grenzen */
.cms-block:has(.cms-element-bow-service-card--icon-top-left),
.cms-block:has(.cms-element-bow-service-card--icon-top-right) {
    overflow: visible !important;
}

.cms-block:has(.cms-element-bow-service-card--icon-top-left) .cms-block-container,
.cms-block:has(.cms-element-bow-service-card--icon-top-right) .cms-block-container,
.cms-block:has(.cms-element-bow-service-card--icon-top-left) .cms-block-container-row,
.cms-block:has(.cms-element-bow-service-card--icon-top-right) .cms-block-container-row,
.cms-block:has(.cms-element-bow-service-card--icon-top-left) .col-12,
.cms-block:has(.cms-element-bow-service-card--icon-top-right) .col-12,
.cms-block:has(.cms-element-bow-service-card--icon-top-left) [class*="col-"],
.cms-block:has(.cms-element-bow-service-card--icon-top-right) [class*="col-"] {
    overflow: visible !important;
}

/* Fallback für Browser ohne :has() Support */
.cms-element-bow-service-card--icon-top-left,
.cms-element-bow-service-card--icon-top-right {
    overflow: visible !important;
}

/* === Overflow Fix für den gesamten Block (alle Icon-Positionen) === */
/* Verhindert dass Shopwares CMS-Grid den Card-Inhalt abschneidet */
.cms-block-bow-service-card,
.cms-block-bow-service-card .cms-block-container,
.cms-block-bow-service-card .cms-block-container-row,
.cms-block-bow-service-card .cms-block-container-row [class*="col-"] {
    overflow: visible !important;
}

.cms-element-bow-service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--bow-card-bg, #ffffff);
    border: var(--bow-card-border-width, 1px) solid var(--bow-card-border, #e5e7eb);
    border-radius: var(--bow-card-radius, 1rem);
    box-shadow: var(--bow-card-shadow, 0 6px 18px rgba(0, 0, 0, 0.04));
    padding: 1.25rem;
    min-height: var(--bow-card-height, auto);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.cms-element-bow-service-card:hover {
    border-color: var(--bow-card-hover-border, #22d3ee);
    box-shadow: var(--bow-card-hover-shadow, 0 6px 18px rgba(34, 211, 238, 0.15));
    transform: translateY(-2px);
}

/* === Icon Wrapper === */
.cms-element-bow-service-card__icon-wrapper {
    z-index: 1;
}

/* Icon Position: Top Left - sitzt mittig auf der Border */
.cms-element-bow-service-card--icon-top-left .cms-element-bow-service-card__icon-wrapper {
    position: absolute;
    top: calc(var(--bow-icon-size, 4rem) / -2);
    left: calc(var(--bow-icon-size, 4rem) / -2);
}

/* Icon Position: Top Right - sitzt mittig auf der Border */
.cms-element-bow-service-card--icon-top-right .cms-element-bow-service-card__icon-wrapper {
    position: absolute;
    top: calc(var(--bow-icon-size, 4rem) / -2);
    right: calc(var(--bow-icon-size, 4rem) / -2);
}

.cms-element-bow-service-card--icon-inline .cms-element-bow-service-card__icon-wrapper {
    margin-bottom: 1rem;
    align-self: center;
}

/* === Icon Box === */
.cms-element-bow-service-card__icon {
    width: var(--bow-icon-size, 4rem);
    height: var(--bow-icon-size, 4rem);
    border-radius: 1rem;
    background: linear-gradient(to right bottom,
            var(--bow-icon-gradient-start, #22d3ee),
            var(--bow-icon-gradient-end, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px color-mix(in srgb, var(--bow-icon-gradient-start, #22d3ee) 35%, transparent);
}

.cms-element-bow-service-card__icon-emoji {
    font-size: calc(var(--bow-icon-size, 4rem) * 0.4);
    line-height: 1;
}

.cms-element-bow-service-card__icon-lucide {
    width: 55%;
    height: 55%;
    color: #fff;
    stroke-width: 1.75;
}

.cms-element-bow-service-card__icon-image {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* === Content === */
.cms-element-bow-service-card__content {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Content margin when icon is positioned absolute */
.cms-element-bow-service-card--icon-top-left .cms-element-bow-service-card__content,
.cms-element-bow-service-card--icon-top-right .cms-element-bow-service-card__content {
    margin-top: 3.5rem;
}

.cms-element-bow-service-card__subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bow-subtitle-color, #0f9ab1);
    margin-bottom: 0.6rem;
}

.cms-element-bow-service-card__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bow-title-color, #0f172a);
}

.cms-element-bow-service-card__text {
    color: var(--bow-text-color, #64748b);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* === Card Image === */
.cms-element-bow-service-card__card-image {
    width: 100%;
    margin-bottom: 0.75rem;
}

.cms-element-bow-service-card__card-image img {
    width: 100%;
    border-radius: 0.5rem;
    display: block;
}

/* === Link === */
.cms-element-bow-service-card__link {
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
    color: var(--bow-link-color, #369ec4);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.cms-element-bow-service-card:hover .cms-element-bow-service-card__link {
    color: var(--bow-card-hover-border, #22d3ee);
}

/* === Button Style === */
.cms-element-bow-service-card__button {
    margin-top: 1rem;
    text-align: center;
    display: inline-block;
    align-self: center;
    padding: 0.45rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bow-btn-text, #ffffff);
    background: var(--bow-btn-bg, #0066cc);
    border: 2px solid var(--bow-btn-border, #0066cc);
    border-radius: var(--bow-btn-radius, 2rem);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.cms-element-bow-service-card:hover .cms-element-bow-service-card__button {
    background: var(--bow-btn-hover-bg, #0052a3);
    border-color: var(--bow-btn-hover-bg, #0052a3);
    text-decoration: none;
}

a.cms-element-bow-service-card__button,
a.cms-element-bow-service-card__link,
a.cms-element-bow-service-card__button:hover,
a.cms-element-bow-service-card__link:hover {
    text-decoration: none !important;
}

/* === Responsive === */
@media (max-width: 768px) {
    .cms-element-bow-service-card {
        padding: 1rem 1rem 2rem;
    }

    .cms-element-bow-service-card--icon-top-left .cms-element-bow-service-card__content,
    .cms-element-bow-service-card--icon-top-right .cms-element-bow-service-card__content {
        margin-top: 3rem;
    }

    .cms-element-bow-service-card__icon {
        width: calc(var(--bow-icon-size, 4rem) * 0.85);
        height: calc(var(--bow-icon-size, 4rem) * 0.85);
    }

    .cms-element-bow-service-card__title {
        font-size: 1rem;
    }

    .cms-element-bow-service-card__text {
        font-size: 0.9rem;
    }
}

/* === Block-Level: Full Width im CMS Grid === */
/* Erzwingt dass Single-Card-Blöcke untereinander statt nebeneinander gerendert werden */
.cms-block-bow-service-card {
    width: 100%;
}

.cms-block-bow-service-card .cms-block-container-row [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}