.gb-grid {
    display: grid;
    width: 100%;
    position: relative;
}

.gb-col-1 { grid-template-columns: repeat(1, 1fr); }
.gb-col-2 { grid-template-columns: repeat(2, 1fr); }
.gb-col-3 { grid-template-columns: repeat(3, 1fr); }
.gb-col-4 { grid-template-columns: repeat(4, 1fr); }
.gb-col-5 { grid-template-columns: repeat(5, 1fr); }
.gb-col-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
    .gb-col-tablet-1 { grid-template-columns: repeat(1, 1fr); }
    .gb-col-tablet-2 { grid-template-columns: repeat(2, 1fr); }
    .gb-col-tablet-3 { grid-template-columns: repeat(3, 1fr); }
    .gb-col-tablet-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
    .gb-col-mobile-1 { grid-template-columns: 1fr; }
    .gb-col-mobile-2 { grid-template-columns: repeat(2, 1fr); }
    .gb-col-mobile-3 { grid-template-columns: repeat(3, 1fr); }
    .gb-col-mobile-4 { grid-template-columns: repeat(4, 1fr); }
    .gb-col-mobile-5 { grid-template-columns: repeat(5, 1fr); }
    .gb-col-mobile-6 { grid-template-columns: repeat(6, 1fr); }
}

.gb-masonry {
    display: block !important;
}

.gb-masonry .gb-card {
    width: calc(33.333% - 14px);
    display: inline-block;
    vertical-align: top;
    margin: 7px;
}

.gb-masonry .gb-size-wide {
    width: calc(66.666% - 14px);
}

.gb-masonry .gb-size-tall {
    width: calc(33.333% - 14px);
}

.gb-masonry .gb-size-big {
    width: calc(66.666% - 14px);
}

@media (max-width: 1024px) {
    .gb-masonry .gb-card {
        width: calc(50% - 14px);
    }

    .gb-masonry .gb-size-wide,
    .gb-masonry .gb-size-big {
        width: calc(100% - 14px);
    }
}

@media (max-width: 767px) {
    .gb-masonry .gb-card,
    .gb-masonry .gb-size-wide,
    .gb-masonry .gb-size-tall,
    .gb-masonry .gb-size-big {
        width: calc(100% - 14px);
    }
}

.gb-view-list .gb-card {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
}

.gb-view-list .gb-card-image {
    flex: 0 0 280px;
    max-width: 280px;
}

.gb-view-list .gb-card-image img {
    height: 100% !important;
}

.gb-view-list .gb-card-body {
    flex: 1;
}

@media (max-width: 600px) {
    .gb-view-list .gb-card {
        flex-direction: column;
    }

    .gb-view-list .gb-card-image {
        flex: 0 0 auto;
        max-width: 100%;
    }
}

.gb-card {
    position: relative;
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
    background: #fff;
    margin-bottom: 20px;
}

.gb-card:hover {
    transform: translateY(-5px);
}

.gb-card-image img {
    width: 100%;
    display: block;
    transition: transform .4s ease;
}

.gb-card:hover .gb-card-image img {
    transform: scale(1.05);
}

.gb-card-body {
    padding: 15px;
}

.gb-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #ff4757;
    color: #fff;
    border-radius: 3px;
    z-index: 2;
}

.gb-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #ff6b35;
    margin-bottom: 5px;
}

.gb-meta {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.gb-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
}

.gb-title a {
    color: inherit;
    text-decoration: none;
}

.gb-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 15px;
}

.gb-extra {
    display: inline-flex;
    align-items: baseline;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 10px;
    gap: 2px;
}

.gb-extra-currency {
    font-size: 13px;
    font-weight: 700;
    color: #222;
}

.gb-extra-amount {
    font-size: 13px;
    font-weight: 700;
    color: #222;
}

.gb-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all .3s ease;
}

.gb-btn:hover {
    background: #005a87;
    color: #fff;
}

.gb-tpl-template-2 .gb-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.gb-card-overlay .gb-card {
    color: #fff;
}

.gb-card-overlay .gb-card-body-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
    color: #fff;
    z-index: 1;
}

.gb-card-overlay .gb-title a,
.gb-card-overlay .gb-desc {
    color: #fff;
}

.gb-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

.gb-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0;
}

.gb-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.gb-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all .25s ease;
    white-space: nowrap;
    line-height: 1;
    position: relative;
}

.gb-tab-style-pill .gb-filter {
    padding: 10px 20px;
    border-radius: 30px;
}

.gb-tab-style-pill .gb-filter:hover {
    background: #e8e8e8;
    color: #000;
}

.gb-tab-style-pill .gb-filter.active {
    background: #007cba;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,124,186,.3);
}

.gb-tab-style-underline .gb-filter {
    padding: 12px 18px;
    background: transparent !important;
    color: #555;
    border-radius: 0;
}

.gb-tab-style-underline .gb-filter:hover {
    color: #007cba;
}

.gb-tab-style-underline .gb-filter.active {
    color: #007cba;
    box-shadow: inset 0 -2px 0 #007cba;
}

.gb-tab-style-boxed .gb-filter {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: transparent !important;
    color: #333;
    border-radius: 6px;
}

.gb-tab-style-boxed .gb-filter:hover {
    border-color: #007cba;
    color: #007cba;
}

.gb-tab-style-boxed .gb-filter.active {
    background: #007cba !important;
    border-color: #007cba;
    color: #fff;
}

.gb-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.08);
    color: inherit;
    border-radius: 11px;
    line-height: 1;
}

.gb-tab-style-pill .gb-filter.active .gb-filter-count,
.gb-tab-style-boxed .gb-filter.active .gb-filter-count {
    background: rgba(255,255,255,.25);
    color: #fff;
}

.gb-filter-extras {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gb-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.gb-search-input {
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    padding: 9px 36px 9px 14px;
    font-size: 13px;
    border-radius: 20px;
    outline: none;
    transition: all .25s ease;
    min-width: 180px;
    font-family: inherit;
}

.gb-search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,.1);
}

.gb-search-icon {
    position: absolute;
    right: 12px;
    color: #999;
    pointer-events: none;
}

.gb-sort-select {
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 20px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: all .25s ease;
}

.gb-sort-select:focus {
    border-color: #007cba;
}

.gb-view-toggle {
    display: inline-flex;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
}

.gb-view-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #777;
    cursor: pointer;
    border-radius: 18px;
    transition: all .25s ease;
    padding: 0;
}

.gb-view-btn:hover {
    color: #333;
}

.gb-view-btn.active {
    background: #fff;
    color: #007cba;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

@media (max-width: 768px) {
    .gb-filters-with-extras {
        flex-direction: column;
        align-items: stretch;
    }

    .gb-filter-extras {
        justify-content: center;
    }

    .gb-search-input {
        flex: 1;
        min-width: 0;
    }
}

.gb-pagination {
    text-align: center;
    margin-top: 30px;
    clear: both;
}

.gb-load-more {
    display: inline-block;
    padding: 12px 32px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
}

.gb-load-more:hover {
    background: #005a87;
}

.gb-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: .7;
}

.gb-infinite-btn {
    display: none !important;
}

.gb-infinite-trigger {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 13px;
}

.gb-loader::after {
    content: '...';
    animation: gb-dots 1.4s infinite;
}

@keyframes gb-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.gb-anim-fade { animation: gbFade 0.8s ease forwards; }
.gb-anim-fade-up { animation: gbFadeUp 0.8s ease forwards; }
.gb-anim-fade-down { animation: gbFadeDown 0.8s ease forwards; }
.gb-anim-fade-left { animation: gbFadeLeft 0.8s ease forwards; }
.gb-anim-fade-right { animation: gbFadeRight 0.8s ease forwards; }
.gb-anim-zoom-in { animation: gbZoomIn 0.8s ease forwards; }
.gb-anim-zoom-out { animation: gbZoomOut 0.8s ease forwards; }
.gb-anim-flip-up { animation: gbFlipUp 0.8s ease forwards; }
.gb-anim-slide-up { animation: gbSlideUp 0.8s ease forwards; }

@keyframes gbFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gbFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gbFadeDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gbFadeLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes gbFadeRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes gbZoomIn {
    from { opacity: 0; transform: scale(.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes gbZoomOut {
    from { opacity: 0; transform: scale(1.2); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes gbFlipUp {
    from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
    to { opacity: 1; transform: perspective(400px) rotateX(0); }
}

@keyframes gbSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* GCB saved template support */
.gb-card-elementor-template {
    background: transparent;
    overflow: visible;
}

.gb-card-elementor-template:hover {
    transform: none;
}

.gb-card-elementor-template .gb-elementor-card-template {
    width: 100%;
}

.gb-card-elementor-template .elementor-section,
.gb-card-elementor-template .elementor-container {
    width: 100%;
}

.gb-card-source-template .gb-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* Better support for GCB text fields inside search/sort */
.gcb-field-text,
.gcb-textarea-field {
    word-break: break-word;
}