/* Ionmara Product Grid - Responsive Layout */
.ionmara-product-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Top Category Navigation */
.ionmara-product-grid-top-nav {
    width: 100%;
  background: #ffffff;
  padding: 25px 0 50px 0;
  margin-bottom: 50px;
  border-bottom: 1px solid #ccc;
}

.ionmara-product-grid-top-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.ionmara-product-grid-top-category {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  min-width: 160px;
}

.ionmara-product-grid-top-category:hover,
.ionmara-product-grid-top-category.active {
    background: #f5f5f5;
    border-color: #cccccc;
}

.ionmara-product-grid-top-category-icon {
    font-size: 24px;
    color: #555555;
    transition: color 0.3s ease;
}

.ionmara-product-grid-top-category:hover .ionmara-product-grid-top-category-icon,
.ionmara-product-grid-top-category.active .ionmara-product-grid-top-category-icon {
    color: #EF4136;
}

.ionmara-product-grid-top-category-name {
    font-size: 15px;
  font-weight: 600;
  color: #555555;
  transition: color 0.3s ease;
  margin: 10px 0 0 0;
  text-transform: uppercase;
}

.ionmara-product-grid-top-category:hover .ionmara-product-grid-top-category-name,
.ionmara-product-grid-top-category.active .ionmara-product-grid-top-category-name {
    color: #EF4136;
}

/* Main Content Layout */
.ionmara-product-grid-main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Side Category Navigation */
.ionmara-product-grid-side-nav {
    width: 25%;
  background: #ffffff;
  border: 0px solid #e1e5e9;
  border-radius: 0px;
  overflow: hidden;
}

.ionmara-product-grid-side-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: 0 !important;
    margin-top: 0px !important;
    margin-bottom: 25px !important;
}

@media (min-width: 769px) {
    .ionmara-product-grid-side-nav {
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 10px;
    }

    .ionmara-product-grid-side-categories {
        padding: 0 !important;
        margin-bottom: 0 !important;
    }
}

.ionmara-product-grid-side-category {
    border-bottom: 0px solid #e1e5e9;
    margin-bottom: 8px;
}

.ionmara-product-grid-side-category:last-child {
    border-bottom: none;
}

.ionmara-product-grid-side-category-link {
    display: block;
  padding: 15px 20px;
  color: #555555;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #ffffff;
}

.ionmara-product-grid-side-category-link:hover {
    background: #f8f9fa;
    color: #EF4136;
    border-radius: 10px;
    text-decoration: none !important;
}

.ionmara-product-grid-side-category-link.active,
.ionmara-product-grid-side-category-link.active:hover {
    background: #ef4136;
    color: #ffffff;
    border-radius: 10px;
    text-decoration: none !important;
}

.ionmara-product-grid-side-categories-select {
    display: none;
    width: 100%;
    padding: 6px 40px 6px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2712%27%20height=%2712%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%236c757d%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpolyline%20points=%276%209%2012%2015%2018%209%27/%3E%3C/svg%3E);
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #555555;
}

.ionmara-product-grid-side-categories-select option:hover {
    background-color: #ee4036;
    color: #ffffff;
}

.ionmara-product-grid-side-categories-select option:checked {
    background-color: #ee4036;
    color: #ffffff;
}

/* Product Grid Section */
.ionmara-product-grid-content {
    width: 75%;
}

.ionmara-product-grid-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.ionmara-product-grid-item {
    background: #f5f5f5;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
	display: flex;
    flex-direction: column;
}

.ionmara-product-grid-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.ionmara-product-grid-item-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    max-height: 200px;
    min-height: 200px;
    padding: 0px;
}

.ionmara-product-grid-item-content {
    padding: 15px;
    position: relative;
    background: #f5f5f5;
	flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
}

.ionmara-product-grid-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    box-orient: vertical;
    text-decoration: none;
}

.ionmara-product-grid-item h3.ionmara-product-grid-item-title {
    text-decoration: none !important;
}

.ionmara-product-grid-item-link {
    text-decoration: none;
}

.ionmara-product-grid-item-link:hover {
    text-decoration: none;
}

.ionmara-product-grid-item a {
    text-decoration: none !important;
}

.ionmara-product-grid-item a:hover {
    text-decoration: none !important;
}

.ionmara-product-grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    line-height: 48px;
    background: rgba(239, 65, 54, 1);
    color: #ffffff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ionmara-product-grid-item:hover .ionmara-product-grid-item-overlay {
    transform: translateY(0);
}

/* Pagination System */
.ionmara-product-grid-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.ionmara-product-grid-page-link {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    color: #555555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ionmara-product-grid-page-link:hover {
    background: #EF4136;
    color: #ffffff;
    border-color: #EF4136;
}

.ionmara-product-grid-page-link.active {
    background: #EF4136;
    color: #ffffff;
    border-color: #EF4136;
}

.ionmara-product-grid-page-link.disabled {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #e1e5e9;
    cursor: not-allowed;
}

.ionmara-product-grid-page-link.disabled:hover {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #e1e5e9;
}

/* Loading State */
.ionmara-product-grid-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.ionmara-product-grid-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 50%;
    border-top-color: #EF4136;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.ionmara-product-grid-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1; /* Span all columns in the grid */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ionmara-product-grid-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.ionmara-product-grid-empty-text {
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ionmara-product-grid-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ionmara-product-grid-side-nav {
        width: 35%;
    }
    
    .ionmara-product-grid-content {
        width: 65%;
    }
}

@media (max-width: 768px) {
    .ast-separate-container #content .ast-container {
        padding-left: 25px;
        padding-right: 25px;
    }

    .custom-post-tab-btn {
        padding: 15px 15px !important;
    }

    body .custom-post-content-wrapper,
    body.ast-separate-container #content .custom-post-content-wrapper {
        padding: 0px 25px 0px 25px !important;
        box-sizing: border-box !important;
    }

    .ionmara-product-grid-container {
        margin: 0 25px;
    }

    .ionmara-product-grid-top-nav {
        width: 100%;
        background: #ffffff;
        padding: 25px 0 50px 0;
        margin-bottom: 15px;
        border-bottom: 1px solid #ccc;
    }

    .ionmara-product-grid-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .ionmara-product-grid-top-categories {
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .ionmara-product-grid-top-category {
        min-width: 100px;
        padding: 12px 15px;
    }

    .ionmara-product-grid-top-category {
        min-width: 100%;
    }
    
    .ionmara-product-grid-top-category-icon {
        font-size: 20px;
    }
    
    .ionmara-product-grid-top-category-name {
        font-size: 13px;
    }
    
    .ionmara-product-grid-side-nav {
        width: 100%;
        order: 1;
    }

    .ionmara-product-grid-side-categories {
        display: none;
    }

    .ionmara-product-grid-side-categories-select {
        display: block;
        margin-bottom: 16px;
    }
    
    .ionmara-product-grid-content {
        width: 100%;
        order: 2;
    }
    
    .ionmara-product-grid-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ionmara-product-grid-item-image {
        width: 100%;
        height: 200px;
        object-fit: contain;
        background: #f8f9fa;
        max-height: 170px;
        min-height: 170px;
        padding: 0px;
    }
    
    .ionmara-product-grid-item-overlay {
        display: none;
    }
    
    .ionmara-product-grid-item-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body .custom-post-content-wrapper,
    body.ast-separate-container #content .custom-post-content-wrapper {
        padding: 0px 0px 0px 0px !important;
        box-sizing: border-box !important;
    }

    .custom-post-tab-btn {
        padding: 15px 15px !important;
    }

    .ionmara-product-grid-top-nav {
    width: 100%;
    background: #ffffff;
    padding: 25px 0 25px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #ccc;
  }
    
    .ionmara-product-grid-top-categories {
        gap: 8px;
    }
    
    .ionmara-product-grid-top-category {
        min-width: 80px;
        padding: 10px 12px;
    }
    
    .ionmara-product-grid-top-category-icon {
        font-size: 18px;
    }
    
    .ionmara-product-grid-top-category-name {
        font-size: 12px;
    }
    
    .ionmara-product-grid-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .ionmara-product-grid-item-image {
        width: 100%;
        height: 200px;
        object-fit: contain;
        background: #f8f9fa;
        max-height: 170px;
        min-height: 170px;
        padding: 0px;
    }
    
    .ionmara-product-grid-item-content {
        padding: 12px;
    }
    
    .ionmara-product-grid-item-title {
        font-size: 12px;
    }
    
    .ionmara-product-grid-pagination {
        gap: 5px;
    }
    
    .ionmara-product-grid-page-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}
