/* ============================================
   Product Grid - Layout Fix
   ============================================ */

/* Product items container - flexbox layout */
.products-grid .product-items {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 -12px !important;
    list-style: none !important;
    padding: 0 !important;
}

/* Individual product item */
.products-grid .product-item {
    width: calc(25% - 24px) !important;
    margin: 12px !important;
    padding: 0 !important;
    background: #0f1214 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.products-grid .product-item:hover {
    border-color: rgba(116, 169, 255, 0.6) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

/* Product info wrapper */
.products-grid .product-item-info {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    width: 100% !important;
}

/* Photo container - fixed aspect ratio */
.products-grid .product-item-photo {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    padding-top: 100% !important;
    background: #111111 !important;
    overflow: hidden !important;
}

/* Image container absolute positioning */
.products-grid .product-image-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Image wrapper */
.products-grid .product-image-wrapper {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* The actual image */
.products-grid .product-image-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Product details section */
.products-grid .product-item-details {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    background: #0f1214 !important;
    min-height: 180px !important;
}

/* Product name - fixed height for 2 lines */
.products-grid .product-item-name {
    margin-bottom: 8px !important;
    min-height: 40px !important;
    height: 40px !important;
}

.products-grid .product-item-name a {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-decoration: none !important;
}

.products-grid .product-item-name a:hover {
    color: #9ec3ff !important;
}

/* Price - fixed position */
.products-grid .price-box {
    margin-bottom: 12px !important;
    min-height: 24px !important;
}

.products-grid .price-box .price {
    color: #d6d6d6 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Add to cart button - pushed to bottom */
.products-grid .product-item-actions {
    margin-top: auto !important;
}

.products-grid .action.tocart {
    width: 100% !important;
    text-align: center !important;
    padding: 12px 16px !important;
}

/* Secondary actions (wishlist, compare) */
.products-grid .actions-secondary {
    display: flex !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

.products-grid .actions-secondary .action {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
}

.products-grid .actions-secondary .action:hover {
    background-color: rgba(158, 195, 255, 0.15) !important;
    border-color: #9ec3ff !important;
}

.products-grid .actions-secondary .action:before {
    font-size: 18px !important;
    line-height: 1 !important;
    color: #d6d6d6 !important;
}

.products-grid .actions-secondary .action:hover:before {
    color: #9ec3ff !important;
}

.products-grid .actions-secondary .action span {
    display: none !important;
}

/* Responsive - Tablet (3 columns) */
@media (max-width: 1024px) {
    .products-grid .product-item {
        width: calc(33.333% - 24px) !important;
    }
}

/* Responsive - Mobile (2 columns) */
@media (max-width: 768px) {
    .products-grid .product-items {
        margin: 0 -6px !important;
    }

    .products-grid .product-item {
        width: calc(50% - 12px) !important;
        margin: 6px !important;
    }

    .products-grid .product-item-details {
        padding: 12px !important;
    }

    .products-grid .product-item-name a {
        font-size: 13px !important;
    }

    .products-grid .price-box .price {
        font-size: 14px !important;
    }
}