/* KGN Products Layout - Updated */
.kgn-products-wrapper-main {
    margin: 20px 0;
    font-family: inherit;
}

/* Header Banner */
.kgn-products-header-banner {
    margin-bottom: 20px;
    width: 100%;
}

.kgn-products-header-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tabs Container */
.kgn-products-tabs-container {
    background-color: #f2f2f2;
    border-bottom: 2px solid #ddd;
    margin-bottom: 30px;
}

.kgn-products-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.kgn-products-tabs li {
    margin: 0;
    position: relative;
}

.kgn-products-tabs li a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 15px 25px;
    font-size: 1rem;
    border-right: 1px solid #ddd;
    transition: background 0.3s, color 0.3s;
    position: relative;
}

.kgn-products-tabs li:first-child a {
    border-left: 1px solid #ddd;
}

.kgn-products-tabs li a:hover,
.kgn-products-tabs li a.active {
    background-color: #e5e5e5;
    color: #000;
}

/* Tab Arrow for Active State */
.kgn-tab-arrow {
    position: absolute;
    bottom: -10px; /* Adjust based on arrow size */
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #555; /* Arrow color */
    z-index: 10;
}

/* Product Grid */
.kgn-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.kgn-product-card {
    background-color: #f7f7f7;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.kgn-product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    border-color: #ddd;
}

.kgn-product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kgn-product-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kgn-product-card-title {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #222;
    font-weight: 500;
    line-height: 1.4;
}

.kgn-product-card-image {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    display: block;
    overflow: hidden;
    margin-bottom: 0;
    padding: 0;
    box-sizing: border-box;
    order: -1; /* Make image appear at the top without changing HTML structure if possible, but we'll change HTML structure anyway */
}

.kgn-product-card-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.kgn-product-card-image img:hover {
    transform: scale(1.03);
}

/* Lightbox Styles */
.kgn-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kgn-lightbox-overlay.active {
    opacity: 1;
}
.kgn-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
.kgn-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}
.kgn-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}
.kgn-lightbox-trigger {
    cursor: pointer;
}

.kgn-no-image {
    color: #aaa;
    font-size: 0.9rem;
    padding: 20px;
    text-align: center;
}

.kgn-product-card-footer {
    margin-top: auto;
    text-align: left;
    padding-top: 15px;
}

.kgn-know-more-btn {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    background-color: #0073aa;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 24px;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.2);
}

.kgn-know-more-btn:hover {
    background-color: #005a87;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 115, 170, 0.3);
}

/* Pagination */
.kgn-products-pagination {
    margin-top: 40px;
    text-align: center;
}

.kgn-products-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
    transition: all 0.3s;
}

.kgn-products-pagination .page-numbers:hover,
.kgn-products-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Responsive */
@media (max-width: 1024px) {
    .kgn-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kgn-products-tabs li a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    .kgn-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kgn-products-grid {
        grid-template-columns: 1fr;
    }
}
