/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. PRODUCT CARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#products-wrapper {
    margin: 0;
}

/* Card styling */
.p-card {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border: 1px solid #e8eaed;
    border-radius: 0px;
    position: relative;
}

.p-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

/* Image zone */
.p-img {
    position: relative;
    background: #f7f8fb;
    aspect-ratio: 1/1;
    overflow: hidden;
    flex-shrink: 0;
}

.p-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
    display: block;
    transition: transform 0.4s ease;
}

.p-card:hover .p-img img {
    transform: scale(1.06);
}

.p-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 20px;
    line-height: 1.5;
    z-index: 3;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

[dir="rtl"] .p-badge {
    left: auto;
    right: 8px;
}

.pb-sale {
    background: #dc3545;
    color: #fff;
}

.pb-new {
    background: #28a745;
    color: #fff;
}

.pb-oos {
    background: #6c757d;
    color: rgba(255, 255, 255, 0.9);
}

/* Hover overlay with action icons */
.p-actions {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 4;
}

.p-card:hover .p-actions {
    opacity: 1;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    color: #1a1a2e;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

.action-btn:hover {
    background: #ff0000;
    color: #fff;
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.action-btn:hover .tooltip {
    opacity: 1;
}

/* Card body */
.p-body {
    padding: 12px 13px 13px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Product name */
.p-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    text-decoration: none;
}

.p-name:hover {
    color: #ff0000;
}

/* Stars */
.p-stars {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
}

.p-stars img {
    width: auto;
    height: 16px;
}

/* Price */
.p-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.price-now {
    font-size: 16px;
    font-weight: 700;
    color: #dc3545;
}

.price-was {
    font-size: 12px;
    text-decoration: line-through;
    color: #adb5bd;
}

/* Product Buttons */
.product-buttons {
    display: flex;
    margin-top: 8px;
}

.product-buttons .number {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.product-buttons .button {
    flex: 1;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-buttons .button:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.btn-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.btn-body i {
    font-size: 14px;
}

.btn-body p {
    margin: 0;
}

/* Toolbar Grid Buttons */
.cat-grid-btns {
    display: flex;
    gap: 8px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.cat-grid-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #666;
    font-size: 16px;
}

.cat-grid-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.cat-grid-btn.active {
    background-color: #ff0000;
    color: white;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-buttons {
        flex-direction: column;
    }

    .product-buttons .number {
        width: 100%;
    }

    .p-body {
        padding: 10px;
    }

    .price-now {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .p-name {
        font-size: 12px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
    }
}