/* Products page styles optimized for mega-menu filtering */

/* Top bar section */
.products-top-bar {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 5%);
    border: 1px solid #7e7e7e3d;
}

@media (max-width: 767.98px) {
    .products-top-bar {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Product count styling */
.product-count {
    font-weight: 600;
    color: var(--bs-primary);
}

/* Sort selector styling */
.sort-selector .form-select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
}

.sort-selector .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Active filters styling */
.active-filters {
    margin-bottom: 1.5rem;
}

.active-filters .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.active-filters .badge:hover {
    transform: translateY(-1px);
}

.active-filters .btn-outline-secondary {
    border-radius: 0.375rem;
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
}

.active-filters .btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Product card enhancements - Clean Design */
.product-card {
    height: 100%;
    border: 1px solid rgb(0 0 0 / 6%) !important;
    border-radius: 1rem;
    overflow: hidden;
    background: #f9f9f9;
}

.product-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
}

.product-card .card-body {
    padding: 1rem;
    background: white;

}

@media (max-width: 575.98px) {
    .product-card .card-body {
        padding: 0.75rem;
    }
}

/* Product image container - Clean Design */
.product-image-container {
    border-radius: 1rem 1rem 0 0;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 0.5rem;
    position: relative;
    z-index: 1;
}

.placeholder-image {
    width: 100%;
    height: 180px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    position: relative;
    z-index: 1;
}

/* Desktop Action Buttons Overlay */
.desktop-action-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

/* Dedicated desktop favorite button */
.desktop-favorite-btn {
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    background: rgb(220 53 69 / 34%);
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.desktop-favorite-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border: 2px solid #dc3545;
}

.desktop-favorite-btn:hover i {
    color: white;
    opacity: 1;
    visibility: visible;
}

/* Dedicated desktop alert button */
.desktop-alert-btn {
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    background: rgb(255 193 7 / 7%);
    color: #212529;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.desktop-alert-btn:hover {
    background: #ffc107;
    color: #212529;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border: 2px solid #ffc107;
}

.desktop-alert-btn:hover i {
    color: #212529;
    opacity: 1;
    visibility: visible;
}

/* Product title container - Modern Typography */
.product-title-container {
    position: relative;
    margin-bottom: 0.75rem;
}

.product-title-link {
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 600;
    color: #1a202c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.product-title-link:hover {
    color: #3182ce;
    text-decoration: none;
}

/* Mobile title expansion - Enhanced visibility */
@media (max-width: 767.98px) {
    .product-title-link {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        max-height: 1.4em;
        font-size: 0.8rem;
        font-weight: 700;
    }
    
    /* Allow expansion when toggle is active */
    .product-title-link.expanded {
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        max-height: none !important;
        display: block !important;
    }
    
    /* Always show toggle button on mobile with enhanced visibility */
    .product-title-toggle {
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: #e2e8f0 !important;
        border: 2px solid #cbd5e1 !important;
        color: #334155 !important;
        font-weight: bold !important;
        transition: all 0.2s ease !important;
    }
    
    .product-title-toggle:hover {
        background: #0ea5e9 !important;
        border-color: #0284c7 !important;
        color: white !important;
        transform: scale(1.1) !important;
    }
    
    .product-title-toggle:active {
        transform: scale(0.95) !important;
    }
}

.product-title-toggle {
    border: none;
    background: #e2e8f0;
    font-size: 0.7rem;
    line-height: 1;
    vertical-align: baseline;
    position: relative;
    z-index: 3;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.25rem;
    border-radius: 50%;
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none;
    transition: none;
}

.product-title-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

.product-title-toggle:hover {
    color: #3182ce;
    background: #bee3f8;
}

.product-title-toggle:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Price section - Clean Design */
.price-section {
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.price-section .h6 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ff7f16 !important;
    margin-bottom: 0.25rem;
}

.price-section small {
    color: #64748b;
    font-weight: 600;
    text-decoration-thickness: 2px;
}

.price-section .text-success {
    color: #059669 !important;
    font-weight: 700;
}

/* Active filters styling - Modern Design */
.active-filters {
    margin-bottom: 1.5rem;
}

.active-filters .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #0ea5e9;
    color: white;
    border: none;
}

.active-filters .badge:hover {
    background: #0891b2;
}

.active-filters .badge.bg-success {
    background: #059669;
}

.active-filters .badge.bg-success:hover {
    background: #047857;
}

.active-filters .btn-outline-secondary {
    border-radius: 0.75rem;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 2px solid #64748b;
    color: #475569;
    font-weight: 600;
}

.active-filters .btn-outline-secondary:hover {
    background: #64748b;
    color: white;
    border-color: #475569;
}

/* No active filters message styling */
.active-filters .text-muted {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin: 0;
}

.active-filters .text-muted i {
    color: #94a3b8;
    font-size: 1rem;
}

/* Responsive grid adjustments */
@media (max-width: 575.98px) {
    .product-image-container {
        padding: 0.5rem;
    }

    .product-image-container img,
    .placeholder-image {
        height: 140px !important;
    }

    .product-title-link {
        font-size: 0.65rem;
        font-weight: 700;
    }

    .price-section {
        padding: 0;
        margin: 0;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .product-image-container img,
    .placeholder-image {
        height: 160px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .product-image-container img,
    .placeholder-image {
        height: 170px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .product-image-container img,
    .placeholder-image {
        height: 175px !important;
    }
}

@media (min-width: 1200px) {
    .product-image-container img,
    .placeholder-image {
        height: 180px !important;
    }
}

/* Loading spinner */
.spinner-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
}

/* Pagination enhancements - Modern Design */
.pagination .page-link {
    border-radius: 0.75rem;
    margin: 0 0.125rem;
    border: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    background: #ffffff;
}

.pagination .page-link:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: #f0f9ff;
}

.pagination .page-item.active .page-link {
    background: #0ea5e9;
    border-color: #0891b2;
    color: white;
}

.pagination .page-item.disabled .page-link {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card:hover,
    .active-filters .badge,
    .active-filters .badge:hover,
    .active-filters .btn-outline-secondary,
    .active-filters .btn-outline-secondary:hover,
    .pagination .page-link,
    .pagination .page-link:hover,
    .product-card .btn:hover {
        transform: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }

    .product-card:hover {
        border-color: var(--bs-primary);
    }

    .price-section {
        background: rgba(37, 99, 235, 0.1);
        border-top: 2px solid var(--bs-primary);
    }
}

/* Focus states for keyboard navigation */
.product-card .btn:focus,
.sort-selector .form-select:focus,
.active-filters .btn:focus,
.product-title-toggle:focus {
    outline: none;
    box-shadow: none;
}

/* Additional clean touches */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #026ed3;
    border-radius: 1rem 1rem 0 0;
    opacity:1;
}

.product-card:hover::before {
    opacity: 1;
}

/* Enhanced loading states */
.btn-modern.loading {
    position: relative;
    color: transparent !important;
}

.btn-modern.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shimmer effect for loading cards */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced focus states */
.product-card:focus-within {
    outline: none;
    box-shadow: none;
}

/* Micro-interactions for better UX */
.product-card .card-body {
    position: relative;
}

.product-card .card-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(14, 165, 233, 0.2);
    opacity: 0;
}

.product-card:hover .card-body::after {
    opacity: 1;
}

/* Enhanced mobile responsiveness */
@media (max-width: 575.98px) {
    .product-card {
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }
    
    .product-title-link {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .price-section .h6 {
        font-size: 1.1rem;
    }
    
    .active-filters .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Title actions container for mobile layout */
.title-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .title-actions {
        justify-content: flex-end;
    }
}

/* Mobile action buttons container */
.mobile-action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

@media (min-width: 768px) {
    .mobile-action-buttons {
        display: none !important;
    }
}

/* Enhanced mobile title toggle positioning */
@media (max-width: 767.98px) {
    .product-title-toggle {
        order: 1;
        flex-shrink: 0;
    }
    
    .mobile-action-buttons {
        order: 2;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .title-actions {
        justify-content: space-between;
        margin-top: 0.5rem;
        width: 100%;
    }
}



/* Price Alert Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Notification Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

/* Print styles for better printing */
@media print {
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .active-filters {
        display: none;
    }
}

/* ===========================================
   VIEW CONTROLS STYLES
   =========================================== */

/* View controls container */
.view-controls {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.view-controls .btn {
    border-radius: 0 !important;
    border: none;
    background: white;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.view-controls .btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.view-controls .btn.active {
    background: var(--bs-primary);
    color: white;
    font-weight: 600;
}

.view-controls .btn:not(:last-child) {
    border-right: 1px solid #dee2e6;
}

.view-controls .btn.active + .btn {
    border-left-color: var(--bs-primary);
}

/* ===========================================
   LIST VIEW STYLES
   =========================================== */

/* List view product items */
.products-container.list-view .product-item {
    margin-bottom: 1rem;
}

.products-container.list-view .product-card {
    flex-direction: row;
    height: auto;
    min-height: 200px;
}

.products-container.list-view .product-image-container {
    width: 200px !important;
    flex-shrink: 0;
    border-radius: 0.75rem 0 0 0.75rem !important;
}

.products-container.list-view .product-image-container img,
.products-container.list-view .placeholder-image {
    height: 150px !important;
    border-radius: 0.5rem;
}

.products-container.list-view .product-content {
    flex: 1;
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* List view title adjustments */
.products-container.list-view .product-title-link {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.products-container.list-view .product-description {
    display: block !important;
    margin-bottom: 1rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* List view meta adjustments */
.products-container.list-view .product-meta {
    margin-bottom: 1rem;
}

.products-container.list-view .product-rating {
    margin-bottom: 0.5rem;
}

/* List view price section */
.products-container.list-view .price-section {
    margin-top: auto;
    padding: 1rem 0 0 0 !important;
    margin: 0;
    border-top: 1px solid #e9ecef;
}

.products-container.list-view .product-price-info {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.products-container.list-view .product-price {
    font-size: 1.5rem;
}

.products-container.list-view .product-offers-count {
    text-align: right;
}

/* List view actions */
.products-container.list-view .product-actions {
    margin-top: 1rem;
    flex-direction: row;
    gap: 0.5rem;
}

.products-container.list-view .product-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS FOR LIST VIEW
   =========================================== */

@media (max-width: 767.98px) {
    .products-container.list-view .product-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .products-container.list-view .product-image-container {
        width: 100% !important;
        border-radius: 0.75rem 0.75rem 0 0 !important;
    }
    
    .products-container.list-view .product-content {
        padding: 1rem !important;
    }
    
    .products-container.list-view .product-price {
        font-size: 1.25rem;
    }
    
    .products-container.list-view .product-actions {
        flex-direction: column;
    }
    
    .products-container.list-view .product-actions .btn {
        max-width: none;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .products-container.list-view .product-image-container {
        width: 180px !important;
    }
    
    .products-container.list-view .product-image-container img,
    .products-container.list-view .placeholder-image {
        height: 140px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .products-container.list-view .product-image-container {
        width: 190px !important;
    }
}

/* ===========================================
   GRID VIEW DEFAULT STYLES
   =========================================== */

.products-container.grid-view .product-card {
    height: 100%;
    flex-direction: column;
    display: flex !important;
}

.products-container.grid-view .product-image-container {
    width: 100% !important;
    flex-shrink: 0;
}

.products-container.grid-view .product-image-container img,
.products-container.grid-view .placeholder-image {
    height: 180px !important;
}

.products-container.grid-view .product-content {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
}

/* Grid view content sections */
.products-container.grid-view .product-main-content {
    flex: 1;
}

.products-container.grid-view .product-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem;
}

.products-container.grid-view .product-actions {
    flex-shrink: 0;
    margin-top: 0.5rem;
}

/* ===========================================
   VIEW TRANSITIONS
   =========================================== */

.products-container {
    transition: all 0.3s ease;
}

.product-item {
    transition: all 0.3s ease;
}

.product-card {
    transition: all 0.3s ease;
}

.product-image-container {
    transition: all 0.3s ease;
}

.product-content {
    transition: all 0.3s ease;
}

/* ===========================================
   PRODUCT TAGS STYLES (LIST VIEW ONLY)
   =========================================== */

/* Product tags container - Only visible in list view */
.product-tags {
    margin-bottom: 1rem;
}

.list-view-tags {
    display: none !important;
}

.products-container.list-view .list-view-tags {
    display: block !important;
}

/* Tag badges styling */
.product-tags .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    margin-right: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
    cursor: pointer;
}

.product-tags .badge:hover {
    background: #0ea5e9 !important;
    color: white !important;
    border-color: #0891b2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none !important;
}

.product-tags .badge:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-tags .badge i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.product-tags .badge:hover i {
    opacity: 1;
}

/* Responsive adjustments for tags */
@media (max-width: 767.98px) {
    .product-tags .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .product-tags .badge {
        font-size: 0.725rem;
        padding: 0.3rem 0.55rem;
    }
}

/* Brand link styling */
.brand-link {
    color: #059669 !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.brand-link:hover {
    color: #047857 !important;
    text-decoration: none !important;
    border-bottom-color: #059669;
    transform: translateY(-1px);
}

.brand-link:active {
    transform: translateY(0);
}

/* Tag link styling */
.tag-link {
    color: #059669 !important;
    transition: all 0.2s ease;
}

.tag-link:hover {
    color: #047857 !important;
    text-decoration: none !important;
}

/* Alert link styling */
.alert .btn-primary {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.alert .btn-primary:hover {
    background-color: #047857 !important;
    border-color: #047857 !important;
}

/* ===== MOBILE CARDS BORDER SYSTEM ===== */
/* Remove gaps and add borders for responsive grid layout */
@media (max-width: 767.98px) {
    /* Mobile: 2 columns - remove gaps and add borders */
    .mobile-no-gap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .mobile-border {
        border: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    /* Remove right border from cards in the right column (2nd column) */
    .mobile-no-gap:nth-child(2n) .mobile-border {
        border-right: none !important;
    }
    
    /* Remove bottom border from cards in the last row */
    .products-grid .mobile-no-gap:nth-last-child(-n+2) .mobile-border {
        border-bottom: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tablet: 4 columns - apply border system */
    .mobile-no-gap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .mobile-border {
        border: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    /* Remove right border from cards in the rightmost columns (4th, 8th, 12th, etc.) */
    .mobile-no-gap:nth-child(4n) .mobile-border {
        border-right: none !important;
    }
    
    /* Remove bottom border from cards in the last row */
    .products-grid .mobile-no-gap:nth-last-child(-n+4) .mobile-border {
        border-bottom: none !important;
    }
}

@media (min-width: 992px) {
    /* Desktop: 4 columns - apply border system */
    .mobile-no-gap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .mobile-border {
        border: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    /* Remove right border from cards in the rightmost columns (4th, 8th, 12th, etc.) */
    .mobile-no-gap:nth-child(4n) .mobile-border {
        border-right: none !important;
    }
    
    /* Remove bottom border from cards in the last row */
    .products-grid .mobile-no-gap:nth-last-child(-n+4) .mobile-border {
        border-bottom: none !important;
    }
}

/* Ensure normal layout for larger screens without border system */
@media (min-width: 1200px) {
    .mobile-no-gap {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .mobile-border {
        border: none !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
}
/* ===========================================
   PRODUCT ACTION BUTTONS STYLES
   =========================================== */

/* Product actions container */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Primary action button - Confronta prezzi */
.product-actions .btn-primary {
    background: linear-gradient(135deg, #05294c 0%, #0a4a7a 100%);
    border: 2px solid #05294c;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(5, 41, 76, 0.2);
}

.product-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0a4a7a 0%, #05294c 100%);
    border-color: #0a4a7a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 41, 76, 0.3);
    text-decoration: none;
}

.product-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 41, 76, 0.2);
}

.product-actions .btn-primary i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.product-actions .btn-primary:hover i {
    transform: scale(1.1);
}

/* Outline action button - Vai al negozio */
.product-actions .btn-outline-primary {
    background: transparent;
    border: 2px solid #FF6600;
    color: #05294c;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-actions .btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #FF6600;
    transition: left 0.3s ease;
    z-index: -1;
}

.product-actions .btn-outline-primary:hover {
    color: white;
    border-color: #FF6600;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 41, 76, 0.3);
    text-decoration: none;
}

.product-actions .btn-outline-primary:hover::before {
    left: 0;
}

.product-actions .btn-outline-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 41, 76, 0.2);
}

.product-actions .btn-outline-primary i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.product-actions .btn-outline-primary:hover i {
    transform: scale(1.1);
}

/* Focus states for accessibility */
.product-actions .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 41, 76, 0.3);
}

/* Responsive adjustments for action buttons */
@media (max-width: 767.98px) {
    .product-actions {
        gap: 0.3rem;
    }
    
    .product-actions .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.7rem;
    }
    
    .product-actions .btn i {
        font-size: 0.7rem;
    }
}

/* List view action buttons adjustments */
.products-container.list-view .product-actions {
    flex-direction: row;
    gap: 0.75rem;
    margin-top: 1rem;
}

.products-container.list-view .product-actions .btn {
    flex: 1;
    max-width: 200px;
    padding: 0.75rem 1.25rem;
}

@media (max-width: 767.98px) {
    .products-container.list-view .product-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .products-container.list-view .product-actions .btn {
        max-width: none;
    }
}

.d-grid.gap-1.product-actions {
    /* text-align: right; */
    display: flex !important;
}