/* Box Custom Widget Styles — v1.6.0 */

.box-custom-container {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.box-custom-container.box-custom-image-background {
    min-height: auto;
}

.box-custom-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Background Image ──────────────────────────────────────────── */
.box-custom-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.5s ease;
}

/* ── Video Background ──────────────────────────────────────────── */
.box-custom-video-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.box-custom-video {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.box-custom-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #000000;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* ── Icon ──────────────────────────────────────────────────────── */
.box-custom-icon {
    display: block;
    line-height: 0;
    width: 100%;
    text-align: center;
}
.box-custom-icon img {
    display: inline-block;
    object-fit: contain;
}

/* ── Image (top / bottom) ──────────────────────────────────────── */
.box-custom-image {
    width: 100%;
    line-height: 0;
}
.box-custom-image img {
    width: 100%;
    display: block;
}
.box-custom-image-top {
    order: -1;
    margin-bottom: 20px;
}
.box-custom-image-top-video {
    overflow: hidden;
    position: relative;
}
.box-custom-top-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.box-custom-top-video-hover {
    cursor: pointer;
}
.box-custom-top-video-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.box-custom-image-bottom {
    order: 999;
    margin-top: 20px;
}

/* ── Title ─────────────────────────────────────────────────────── */
.box-custom-title {
    margin: 0 0 15px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* ── Description ───────────────────────────────────────────────── */
.box-custom-description {
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* ── Button ────────────────────────────────────────────────────── */
.box-custom-button-wrapper {
    margin-top: auto;
}
.box-custom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}
.box-custom-button-full {
    width: 100%;
    display: flex;
}
.box-custom-button .button-text { display: inline-block; }
.box-custom-button .button-icon-left,
.box-custom-button .button-icon-right {
    display: inline-flex;
    align-items: center;
}
.box-custom-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ── Clickable Box ─────────────────────────────────────────────── */
a.box-custom-container {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
a.box-custom-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
/* Отключение hover-анимации блока */
a.box-custom-container.box-custom-no-hover-anim:hover {
    transform: none !important;
    box-shadow: none !important;
}
a.box-custom-container .box-custom-button {
    pointer-events: none;
}



/* ── Background Animations ─────────────────────────────────────── */
.box-custom-animation-zoom-in:hover .box-custom-background {
    transform: scale(1.1);
}
.box-custom-animation-zoom-out .box-custom-background {
    transform: scale(1.1);
}
.box-custom-animation-zoom-out:hover .box-custom-background {
    transform: scale(1);
}
.box-custom-animation-slide-left:hover .box-custom-background {
    transform: translateX(-30px) scale(1.1);
}
.box-custom-animation-slide-right:hover .box-custom-background {
    transform: translateX(30px) scale(1.1);
}
.box-custom-animation-blur-in .box-custom-background {
    filter: blur(0px);
    transition: filter 0.5s ease, transform 0.5s ease;
}
.box-custom-animation-blur-in:hover .box-custom-background {
    filter: blur(3px);
    transform: scale(1.05);
}

/* ── Accessibility ─────────────────────────────────────────────── */
.box-custom-button:focus,
.box-custom-button:focus-visible,
a.box-custom-container:focus,
a.box-custom-container:focus-visible,
a.box-custom-container:active,
.box-custom-button:active {
    outline: none;
    box-shadow: none;
}

/* ── Loading fade-in ───────────────────────────────────────────── */
.box-custom-image img,
.box-custom-icon img {
    opacity: 0;
    animation: boxCustomFadeIn 0.3s ease forwards;
}
@keyframes boxCustomFadeIn {
    to { opacity: 1; }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .box-custom-title       { font-size: 1.5em; }
    .box-custom-description { font-size: 0.9em; }
}
@media (max-width: 480px) {
    .box-custom-title { font-size: 1.2em; }
}
