.product-card {
    border: 1px solid var(--border-light);
    background: var(--white);
    padding: 12px;
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(2, 6, 23, .06);
    transform: translateY(-1px);
}

.product-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--light-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

.product-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .3s ease;
}

.product-thumb .img-hover {
    opacity: 0;
}

.product-card:hover .product-thumb .img-hover {
    opacity: 1;
}

.product-card:hover .product-thumb .img-primary {
    opacity: 0;
}

/* Badge giảm giá */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: .75rem;
    padding: 4px 6px;
    border-radius: 6px;
}

/* Wishlist / compare (nếu muốn) – có thể ẩn nếu không dùng */
.corner-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.corner-icons .ic {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: .2s;
}

.corner-icons .ic:hover {
    color: var(--text-primary);
}

.product-info {
    padding: 10px 4px 10px;
    border-top: 1px solid var(--border-light);
    margin-top: 20px;
}

.product-title, .product-title a {
    font-size: 1rem;
    font-weight: 700;
    margin: 8px 0;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.product-title a {
    text-decoration: none;
    transition: color 0.2s ease;
}
.product-title a:hover {
    color: var(--accent);
}

.rating {
    color: #f59e0b;
    font-size: .85rem;
}

.price {
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    text-align: center;
}

.price .sale {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.price .base {
    color: var(--muted);
    text-decoration: line-through;
    font-size: .95rem;
    font-weight: 500;
}

/* Actions luôn hiển thị ở cuối card */
.product-actions {
    padding: 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 12px;
    background: rgba(var(--accent-rgb), 0.02);
}

/* Update button styles for smaller size */
.product-actions .btn {
    font-size: 0.8rem;
    padding: 8px 10px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.product-actions .btn:first-child {
    flex: 0 0 42px;
    padding: 8px;
}

.product-actions .btn:last-child {
    flex: 1;
}

.product-actions .btn-outline-primary {
    background: #fff;
    border: 1px solid var(--border-light) !important;
    color: var(--text-secondary);
}

.product-actions .btn-outline-primary:hover {
    border-color: var(--accent) !important;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.product-actions .btn-primary {
    background: var(--accent);
    color: #fff;
}

.product-actions .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.product-actions .btn-warning {
    background: #ffc107;
    color: #212529;
    flex: 1;
    font-weight: 600;
}

.product-actions .btn-warning:hover {
    background: #ffca2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.product-actions .contact-btn {
    width: 100%;
    justify-content: center;
}

.product-actions .btn-success {
    background: #28a745;
    color: #fff;
}

/* Legacy button classes for backward compatibility */
.btn-outline {
    flex: 0 0 40px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px;
    font-weight: 600;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-accent {
    flex: 1;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 6px 8px;
    font-weight: 700;
    font-size: .75rem;
    transition: .2s;
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Product Contact Modal Styles */
.product-contact-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.product-contact-modal .modal-header {
    background: linear-gradient(135deg, var(--header-bg), var(--secondary));
    color: white;
    padding: 1.5rem;
}

.product-contact-modal .modal-title {
    font-size: 1.25rem;
    margin: 0;
}

.product-contact-modal .btn-close-white {
    filter: invert(1);
    opacity: 0.8;
}

.product-contact-modal .btn-close-white:hover {
    opacity: 1;
}

/* Fix Bootstrap 5.3 modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(2px);
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

.product-contact-modal .modal-body {
    padding: 2rem;
    background: var(--light-bg);
}

.product-info-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
}

.product-thumb-small {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.product-name {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-contact-form .form-control {
    border-radius: 10px;
    border: 2px solid transparent;
    background: white;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.product-contact-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(237, 25, 37, 0.1);
    background: white;
}

.product-contact-form .form-control::placeholder {
    color: var(--text-secondary);
}

.product-contact-form .invalid-feedback {
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.product-contact-modal .modal-footer {
    background: white;
    padding: 1.5rem 2rem;
}

.submit-product-contact {
    min-width: 140px;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    border: none;
    transition: all 0.2s ease;
}

.submit-product-contact:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(237, 25, 37, 0.25);
}

@media (max-width: 768px) {
    .product-contact-modal .modal-body {
        padding: 1.5rem;
    }

    .product-contact-modal .modal-footer {
        padding: 1.5rem;
    }

    .product-thumb-small {
        width: 60px;
        height: 60px;
    }

    .product-actions .btn {
        display: block;
    }
}

@media (min-width: 992px) {
    .product-title {
        min-height: 65px;
    }
}
