/* Grid Layout */
.hb-grid {
    display: grid;
    gap: var(--grid-gap, 1.5rem);
    grid-template-columns: repeat(var(--desktop-cols, 3), 1fr);
    box-sizing: border-box;
}

/* Set grid columns based on data attributes */
.hb-grid[data-tablet] {
    --tablet-cols: attr(data-tablet);
}

.hb-grid[data-mobile] {
    --mobile-cols: attr(data-mobile);
}

@media (max-width: 768px) {
    .hb-grid {
        grid-template-columns: repeat(var(--tablet-cols, 2), 1fr);
    }
}

@media (max-width: 480px) {
    .hb-grid {
        grid-template-columns: repeat(var(--mobile-cols, 1), 1fr);
    }
}

/* Card Container */
.hb-card {
    position: relative;
    perspective: 1000px;
    width: 100%;
    margin: 0 auto;
}

.hb-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

/* Card Styling with Overlays */
.hb-card-front,
.hb-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 30%; /* Better positioning for faces/subjects */
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    border-radius: var(--card-border-radius);
}

.hb-card-back-content h3 {
    line-height: 1 !important;
}

.hb-card-front-content h3 {
    line-height: 1 !important;
}

.hb-card-back-content p {
    font-family: "mundial", Sans-serif !important;
    line-height: 1.5 !important;
}

.hb-card-front-content  {
    max-width: 86%;
}

.hb-card-back-content {
    max-width: 86%;
  }

/* Overlay styling */
.hb-overlay {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background-color: var(--overlay-color, rgba(0,0,0,0.5));
    border-radius: var(--card-border-radius);
}

/* Blur overlay effect */
.hb-blur-overlay {
    backdrop-filter: blur(var(--blur-intensity, 10px));
    -webkit-backdrop-filter: blur(var(--blur-intensity, 10px));
    background: rgba(0, 0, 0, 0.3);
}

.hb-card-front > *:not(.hb-overlay),
.hb-card-back > *:not(.hb-overlay) {
    position: relative;
    z-index: 1;
}

/* Button Styles */
.hb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 15px;
    min-width: 29px;
}

/* Default rounded corners */
.hb-shape-default {
    border-radius: 4px;
}

/* Square buttons */
.hb-shape-square {
    border-radius: 0;
}

/* Fully rounded buttons */
.hb-shape-rounded {
    border-radius: 50px; /* Large value ensures pill shape */
    padding-left: 25px;
    padding-right: 25px;
}

/* Circle buttons - ideal for icon-only buttons */
.hb-shape-circle {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    min-width: 50px;
}

/* Adjust SVG in circle buttons */
.hb-shape-circle svg {
    margin: 0;
    height: 24px;
    width: 24px;
}

/* Button Style Variations */
.hb-button-default {
    background: #4285f4;
    color: white;
    border: none;
}

.hb-button-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.hb-button-flat {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
}

.hb-button svg {
    height: 1em;
    width: auto;
    margin-right: 0.5em;
}

/* Remove margin for icon-only buttons */
.hb-shape-circle svg {
    margin-right: 0;
}

/* Content Positioning */
.hb-card-front.hb-position-center,
.hb-card-back.hb-position-center {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hb-card-front.hb-position-top,
.hb-card-back.hb-position-top {
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding-top: 2rem;
}

.hb-card-front.hb-position-bottom,
.hb-card-back.hb-position-bottom {
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding-bottom: 2rem;
}

.hb-card-front.hb-position-left,
.hb-card-back.hb-position-left {
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding-left: 2rem;
}

.hb-card-front.hb-position-right,
.hb-card-back.hb-position-right {
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding-right: 2rem;
}

/* ---------- FLIP EFFECT ---------- */
.hb-effect-flip .hb-card:hover .hb-card-inner {
    transform: rotateY(180deg);
}

.hb-effect-flip .hb-card-inner {
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.2, 0.85, 0.4, 1.275);
}

.hb-effect-flip .hb-card-front,
.hb-effect-flip .hb-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hb-effect-flip .hb-card-back {
    transform: rotateY(180deg);
}

/* ---------- FADE EFFECT ---------- */
.hb-effect-fade .hb-card-inner {
    opacity: 1;
    transform: none;
}

.hb-effect-fade .hb-card:hover .hb-card-front {
    opacity: 0;
}

.hb-effect-fade .hb-card:hover .hb-card-back {
    opacity: 1;
}

/* ---------- BLUR EFFECT ---------- */
.hb-effect-blur .hb-card-inner {
    transform: none;
    transform-style: flat;
    perspective: none;
    position: relative;
}

.hb-effect-blur .hb-card-front {
    z-index: 1;
    transition: filter 0.5s ease;
    backface-visibility: visible;
}

.hb-effect-blur .hb-card-back {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
    backface-visibility: visible;
    transform: none;
    position: absolute;
    top: 0;
    left: 0;
}

.hb-effect-blur .hb-card:hover .hb-card-front {
    /* filter: blur(8px); */
}

.hb-effect-blur .hb-card:hover .hb-card-back {
    opacity: 1;
}

/* Add this to your CSS */
.hb-effect-blur .hb-card:hover .hb-card-front .hb-button {
    filter: none;
}

/* Add 3D perspective to the container */
.hb-box {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Image Button Styles */
.hb-image-button {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.hb-image-button img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hb-image-button:hover {
    box-shadow: none;
}

/* Button Sizes */
.hb-button.hb-size-small {
    font-size: 0.85em;
    padding: 6px 12px;
}

.hb-button.hb-size-medium {
    font-size: 1em;
    padding: 10px 20px;
}

.hb-button.hb-size-large {
    font-size: 1.2em;
    padding: 12px 24px;
}

/* Image button sizes */
.hb-image-button.hb-size-small {
    width: 80px;
}

.hb-image-button.hb-size-medium {
    width: 120px;
}

.hb-image-button.hb-size-large {
    width: 160px;
}

.hb-custom-button-size label {
    margin-top: 10px;
}

.hb-custom-button-size input {
    margin-bottom: 5px;
}

/* Default Typography Styles */
.hb-card-front h3,
.hb-card-back h3 {
    margin-bottom: 5px;
    color: white;
    font-family: "zuume-cut", Sans-serif;
    font-size: 51px;
    font-weight: 600;
    text-transform: uppercase;
    font-style: italic;
    line-height: 1.2;
}

.hb-card-back p {
    color: white;
    font-family: "mundial", Sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
}

/* Default Layout for Front Card */
.hb-card-front {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
}

/* Default Button Size */
.hb-button.hb-size-custom {
    height: 29px;
}

/* When toggle is on, hide individual box settings except content fields */
.hb-same-settings-active .hb-box-settings:not(:first-of-type) .hb-field:not(.hb-content-field),
.hb-same-settings-active .hb-box-settings:not(:first-of-type) .hb-field-group {
    display: none;
}
.hb-same-settings-active .hb-box-settings:not(:first-of-type) {
    position: relative;
}
.hb-same-settings-active .hb-box-settings:not(:first-of-type):after {
    content: "Using settings from Box 1";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #f0f0f1;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #50575e;
}

.hb-card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    cursor: pointer;
    opacity: 0;
}

/* Ensure buttons don't interfere with the overlay link */
.hb-card .hb-button {
    pointer-events: none;
}

.hb-stroke-settings, .hb-flex-settings {
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 10px;
    padding-left: 15px;
    border-left: 3px solid #ddd;
}

.elementor-page-2547 .elementor-element-5538758 {
    display: none;
}

/* Responsive font sizes */
@media (max-width: 768px) {
    .hb-card-front h3, .hb-card-back h3 {
        font-size: calc(var(--title-font-size, 51px) * 0.85) !important;
    }
    
    .hb-card-front p, .hb-card-back p {
        font-size: calc(var(--desc-font-size, 15px) * 0.95) !important;
    }
    
    .hb-card-front, .hb-card-back {
        padding: calc(var(--card-padding, 20px) * 0.85) !important;
    }
}

@media (max-width: 480px) {
    .hb-card-front h3, .hb-card-back h3 {
        font-size: calc(var(--title-font-size, 51px) * 0.7) !important;
    }
    
    .hb-card-front p, .hb-card-back p {
        font-size: calc(var(--desc-font-size, 15px) * 0.9) !important;
    }
    
    .hb-card-front, .hb-card-back {
        padding: calc(var(--card-padding, 20px) * 0.7) !important;
    }
    
    /* Improve image positioning on mobile */
    .hb-card-front, .hb-card-back {
        background-position: center 30%; /* Adjust to better frame faces/subjects */
    }
}

/* Ensure content stays centered in the cards */
.hb-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    z-index: 2;
    position: relative;
}