.ft-grid-filter-wrapper { position: relative; }

/* Header */
.ft-grid-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.ft-grid-heading h3 { margin: 0; font-size: 20px; }
.ft-grid-shop-link { display: inline-flex; align-items: center; gap: 5px; padding: 6px 15px; border: 1px solid #ddd; border-radius: 20px; text-decoration: none; color: #555; font-size: 13px; transition: 0.3s; }
.ft-grid-shop-link:hover { background: #333; color: #fff; border-color: #333; }

/* Grid Layout */
.ft-grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 992px) { .ft-grid-products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 768px) { .ft-grid-products { grid-template-columns: repeat(2, 1fr) !important; } .ft-grid-header { flex-direction: column; align-items: flex-start; } .ft-grid-actions { width: 100%; justify-content: space-between; margin-top: 10px; } }
@media (max-width: 480px) { .ft-grid-products { grid-template-columns: 1fr !important; } }

/* --- CAROUSEL STRUCTURE --- */
/* Force flex layout immediately to prevent broken layout on frontend before JS load */
.ft-product-carousel .swiper-wrapper {
    display: flex !important;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.ft-product-carousel .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}

/* --- NAVIGATION --- */
.ft-carousel-wrapper { position: relative; }

.ft-carousel-wrapper .swiper-button-prev, 
.ft-carousel-wrapper .swiper-button-next { 
    color: #333; width: 40px; height: 40px; background: #fff; border-radius: 50%; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
    display: flex; align-items: center; justify-content: center; 
    position: absolute; top: 50%; transform: translateY(-50%); 
    z-index: 20; 
    margin-top: 0;
    cursor: pointer;
}
.ft-carousel-wrapper .swiper-button-prev:after, 
.ft-carousel-wrapper .swiper-button-next:after { font-size: 18px; font-weight: bold; }

/* Outside */
.ft-carousel-wrapper.ft-arrows-outside { padding: 0 50px; }
.ft-carousel-wrapper.ft-arrows-outside .swiper-button-prev { left: 0; right: auto; }
.ft-carousel-wrapper.ft-arrows-outside .swiper-button-next { right: 0; left: auto; }

/* Inside */
.ft-carousel-wrapper.ft-arrows-inside { padding: 0; }
.ft-carousel-wrapper.ft-arrows-inside .swiper-button-prev { left: 10px; right: auto; }
.ft-carousel-wrapper.ft-arrows-inside .swiper-button-next { right: 10px; left: auto; }

/* Dots */
.ft-carousel-wrapper .swiper-pagination {
    position: relative; bottom: auto; margin-top: 20px; text-align: center;
    z-index: 20;
}
.ft-dots-inside .swiper-pagination { position: absolute; bottom: 10px; margin-top: 0; }
.swiper-pagination-bullet { width: 8px; height: 8px; background: #ccc; opacity: 1; transition: 0.3s; cursor: pointer; display: inline-block; margin: 0 4px; }
.swiper-pagination-bullet-active { background: #333; width: 20px; border-radius: 10px; }

/* Item Styles */
.ft-grid-item-inner { border: 1px solid #eee; border-radius: 8px; overflow: hidden; background: #fff; transition: 0.3s; height: 100%; display: flex; flex-direction: column; }
.ft-grid-item-inner:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.ft-grid-item-inner > * { margin-bottom: 5px; }

/* Image */
.ft-grid-image { position: relative; overflow: hidden; margin: 0 0 15px 0 !important; padding: 0 !important; width: 100%; line-height: 0; }
.ft-grid-image img { width: 100%; height: auto; display: block; transition: 0.3s; object-fit: cover; }
.ft-grid-item-inner:hover .ft-grid-image img { transform: scale(1.05); }
.ft-sale-badge { position: absolute; top: 10px; right: 10px; background: #e1306c; color: #fff; padding: 3px 8px; font-size: 12px; border-radius: 4px; z-index: 2; }

/* Equal Height */
.ft-equal-height .ft-grid-item { display: flex; height: auto; } /* Changed from height: 100% to auto for carousels */
.ft-equal-height .ft-grid-item-inner { width: 100%; display: flex; flex-direction: column; }
.ft-equal-height .ft-grid-btn { margin-top: auto; }

/* Typography */
.ft-grid-cat { font-size: 12px; color: #999; }
.ft-grid-cat a { color: inherit; text-decoration: none; }
.ft-grid-title { margin: 0; font-size: 16px; line-height: 1.4; }
.ft-grid-title a { color: #333; text-decoration: none; }
.ft-grid-price { font-weight: bold; color: #333; }
.ft-grid-desc { font-size: 13px; color: #666; line-height: 1.5; }

/* Button */
.ft-grid-btn a { display: inline-block; text-align: center; background: #f1f1f1; color: #333; padding: 8px 15px; border-radius: 4px; text-decoration: none; transition: 0.3s; }
.ft-grid-btn a:hover { background: #333; color: #fff; }
.ft-btn-align-left .ft-grid-btn { text-align: left; }
.ft-btn-align-center .ft-grid-btn { text-align: center; }
.ft-btn-align-right .ft-grid-btn { text-align: right; }
.ft-btn-align-justify .ft-grid-btn { display: flex; }
.ft-btn-align-justify .ft-grid-btn a { width: 100%; }

/* Skins */
.ft-skin-classic .ft-grid-item-inner { border: 1px solid #eee; }
.ft-skin-card .ft-grid-item-inner { border: 1px solid #f0f0f0; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.ft-skin-card .ft-grid-item-inner > *:not(.ft-grid-image) { padding-left: 15px; padding-right: 15px; }
.ft-skin-card .ft-grid-item-inner > *:last-child { margin-bottom: 20px; }
.ft-skin-card .ft-grid-image { margin-bottom: 15px !important; }
.ft-skin-modern .ft-grid-btn { opacity: 0; transform: translateY(10px); transition: all 0.3s ease; margin-top: auto; }
.ft-skin-modern .ft-grid-item-inner:hover .ft-grid-btn { opacity: 1; transform: translateY(0); }
.ft-skin-minimal .ft-grid-item-inner { border: none; background: transparent; box-shadow: none !important; }
.ft-skin-minimal .ft-grid-image { border-radius: 8px; margin-bottom: 15px !important; }
.ft-skin-overlay .ft-grid-item-inner { position: relative; border: none; overflow: hidden; }
.ft-skin-overlay .ft-grid-image { height: 100%; margin: 0 !important; width: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
.ft-skin-overlay .ft-grid-image img { height: 100%; object-fit: cover; }
.ft-skin-overlay .ft-grid-item-inner > *:not(.ft-grid-image) { position: relative; z-index: 2; color: #fff; padding-left: 15px; padding-right: 15px; margin-bottom: 5px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.ft-skin-overlay .ft-grid-item-inner::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 70%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); z-index: 1; pointer-events: none; }
.ft-skin-overlay .ft-grid-title a, .ft-skin-overlay .ft-grid-cat a, .ft-skin-overlay .ft-grid-price { color: #fff !important; }
.ft-skin-overlay .ft-grid-item-inner { justify-content: flex-end; padding-bottom: 20px; }