.products-grid {
    width: 100%;
}

.products-grid .row {
    margin-bottom: 30px;
}

.product-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    background: #ffffff !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--btnColor);
}

body.dark_mode .product-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--btnColor);
}

.product-image {
    position: relative;
    display: block;
    height: auto;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
    padding: 0;
    width: 100%;
}

body.dark_mode .product-image {
    background: #2d2d2d;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    object-position: center;
    object-fit: cover;
}

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

.sold_out {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    animation: pulse-sold-out 2s infinite;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sold_out_text {
    font-family: "Cairo", sans-serif;
    letter-spacing: 0.5px;
}

.sold_out i {
    font-size: 14px;
}

@keyframes pulse-sold-out {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 18px rgba(220, 53, 69, 0.4);
    }
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

body.dark_mode .product-category {
    color: #a0aec0;
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.5;
    flex: 1;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

body.dark_mode .product-title a {
    color: #2d3748;
}

.product-title a:hover {
    color: var(--btnColor);
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--btnColor);
    margin: 12px 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-currency {
    font-size: 14px;
    color: #718096;
    font-weight: 400;
}

body.dark_mode .product-currency {
    color: #a0aec0;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-shrink: 0;
}

.product-button {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    font-weight: 600;
}

.product-button-cart {
    background: linear-gradient(135deg, var(--btnColor), #2d5aa0);
    color: white;
    border: none;
}

.product-button-cart:hover:not(.product-button-disabled) {
    background: linear-gradient(135deg, #166088, #2d5aa0);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(45, 90, 160, 0.3);
}

.product-button-cart i {
    font-size: 16px;
}

.product-button-disabled {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    opacity: 0.7;
    color: #718096;
}

body.dark_mode .product-button-disabled {
    background: linear-gradient(135deg, #4a5568, #718096);
    color: #cbd5e0;
}

.product-button-favorite {
    background-color: transparent;
    color: var(--btnColor);
    border: 2px solid var(--btnColor);
    width: 50px;
    padding: 12px;
    flex: 0 0 auto;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.product-button-favorite i {
    font-size: 18px;
    transition: all 0.3s ease;
}

.product-button-favorite:hover:not(.product-button-loading) {
    background-color: var(--btnColor);
    color: white;
    transform: translateY(-2px);
}

.product-button-favorite.product-button-active i {
    color: #e53e3e;
}

.product-button-favorite.product-button-active:hover i {
    color: white;
}

.product-button-favorite.product-button-loading i {
    animation: favorite-spin 2s infinite linear;
    opacity: 0.7;
}

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

.product-button-favorite:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.favorite-notification {
    font-family: "Cairo", sans-serif;
    direction: rtl;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #38a169;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: notification-slide-in 0.3s ease;
}

.favorite-notification.notification-error {
    background: #e53e3e;
}

.favorite-notification i {
    font-size: 18px;
}

@keyframes notification-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.row.g-4 .col-xl-3,
.row.g-4 .col-lg-3,
.row.g-4 .col-md-6,
.row.g-4 .col-sm-6 {
    display: flex;
    align-items: stretch;
}

.row.g-4 .col-xl-3 > *,
.row.g-4 .col-lg-3 > *,
.row.g-4 .col-md-6 > *,
.row.g-4 .col-sm-6 > * {
    width: 100%;
}

@media (max-width: 1200px) {
    .col-xl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .product-image {
        height: auto;
    }
}

@media (max-width: 992px) {
    .col-lg-3 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
    .product-image {
        height: auto;
    }
    .product-title {
        height: 44px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .product-image {
        height: auto;
        padding: 15px;
    }
    .sold_out {
        font-size: 10px;
        padding: 6px 12px;
    }
    .product-info {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .product-actions {
        flex-direction: row;
    }
    .product-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    .product-button-favorite {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .product-image {
        height: auto;
    }
    .product-actions {
        flex-direction: column;
    }
    .product-button {
        width: 100%;
    }
    .product-button-favorite {
        width: 100%;
    }
}
