/* ========================================
   GROUPS HACK PAGE - Đồng bộ với index (VietHax 2025)
   Dùng biến --vx-* từ viethax-2025.css
   ======================================== */

/* Skip link - accessibility */
.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    z-index: 9999;
    padding: 0.6rem 1rem;
    background: var(--vx-accent, #6366f1);
    color: #fff;
    border-radius: var(--radius, 6px);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 1rem;
    outline: 2px solid var(--vx-accent);
    outline-offset: 2px;
}

/* ========================================
   MODERN HERO SECTION
   ======================================== */

.hero-modern {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.hero-modern .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-modern .hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-modern .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 2;
}

.hero-modern .hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 2px 2px, var(--vx-accent-soft) 1px, transparent 0);
    background-size: 40px 40px;
    z-index: 2;
    opacity: 0.5;
}

.hero-modern .hero-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 2.5rem 1rem;
}

.hero-modern .hero-content {
    max-width: 800px;
}

/* Hero Breadcrumbs */
.hero-modern .hero-breadcrumbs {
    margin-bottom: 2rem;
}

.hero-modern .hero-breadcrumbs ol {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero-modern .hero-breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-modern .hero-breadcrumbs a {
    color: var(--vx-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.hero-modern .hero-breadcrumbs a:hover {
    color: var(--vx-accent);
}

.hero-modern .hero-breadcrumbs span:not(.breadcrumb-sep) {
    color: var(--vx-text);
}

.hero-modern .breadcrumb-sep {
    color: var(--vx-text-dim);
    flex-shrink: 0;
}

/* Hero Title */
.hero-modern .hero-title {
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    font-family: var(--vx-font-head);
}

.hero-modern .hero-title-text {
    background: linear-gradient(135deg, var(--vx-text) 0%, var(--vx-text) 50%, var(--vx-text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

.hero-modern .hero-title-text::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--vx-accent);
    border-radius: 2px;
}

/* Hero Description */
.hero-modern .hero-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--vx-text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

/* Hero Actions */
.hero-modern .hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-modern .btn-hero-primary,
.hero-modern .btn-hero-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.hero-modern .btn-hero-primary {
    background: var(--vx-accent);
    color: white;
    box-shadow: 0 4px 16px rgba(196, 75, 44, 0.35);
}

.hero-modern .btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 75, 44, 0.4);
}

.hero-modern .btn-hero-primary:active {
    transform: translateY(0);
}

.hero-modern .btn-hero-ghost {
    background: var(--vx-accent-soft);
    color: var(--vx-accent);
    border: 2px solid var(--vx-accent);
    backdrop-filter: blur(10px);
}

.hero-modern .btn-hero-ghost:hover {
    background: var(--vx-accent);
    border-color: var(--vx-accent);
    color: #fff;
    transform: translateY(-2px);
}

.hero-modern .btn-hero-primary svg,
.hero-modern .btn-hero-ghost svg {
    flex-shrink: 0;
}

/* Hero Meta Badges (for view_hack.php) */
.hero-modern .hero-meta-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hero-modern .hero-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--vx-accent-soft);
    border: 1px solid var(--vx-border);
    border-radius: 20px;
    color: var(--vx-text);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.hero-modern .hero-meta-badge:hover {
    background: var(--vx-accent-soft);
    border-color: var(--vx-accent);
    transform: translateY(-1px);
}

.hero-modern .hero-meta-badge.status-active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--vx-success);
}

.hero-modern .hero-meta-badge.status-maintenance {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--vx-danger);
}

.hero-modern .hero-meta-badge svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.hero-modern .hero-notification-box {
    margin-top: 1.5rem;
}

/* Hero Info Box - Modern Notification */
.hero-modern .hero-info-box {
    position: relative;
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--vx-accent-soft);
    border: 1px solid var(--vx-accent);
    border-radius: var(--vx-radius);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: slideInUp 0.5s ease-out;
    max-width: 900px;
}

.hero-modern .hero-info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--vx-accent) 0%, var(--vx-accent-hover) 100%);
    border-radius: var(--vx-radius) 0 0 var(--vx-radius);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-modern .hero-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vx-accent-soft);
    border-radius: 10px;
    color: var(--vx-accent);
}

.hero-modern .hero-info-content {
    flex: 1;
    color: var(--vx-text);
    line-height: 1.6;
    font-size: 0.95rem;
}

.hero-modern .hero-info-content p {
    margin: 0 0 0.5rem 0;
}

.hero-modern .hero-info-content p:last-child {
    margin-bottom: 0;
}

.hero-modern .hero-info-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--vx-text-muted);
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.hero-modern .hero-info-close:hover {
    background: var(--vx-accent-soft);
    color: var(--vx-text);
}

.hero-modern .hero-info-close:active {
    transform: scale(0.95);
}

/* Hero Info Box - Hidden State */
.hero-modern .hero-info-box.hidden {
    display: none;
}

/* Responsive Hero */
@media (max-width: 768px) {
    .hero-modern {
        min-height: 280px;
    }

    .hero-modern .hero-inner {
        padding: 2rem 1rem;
    }

    .hero-modern .hero-title {
        font-size: 2rem;
    }

    .hero-modern .hero-description {
        font-size: 1rem;
    }

    .hero-modern .btn-hero-primary,
    .hero-modern .btn-hero-ghost {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .hero-modern .hero-info-box {
        padding: 1.25rem;
        margin-top: 2rem;
    }

    .hero-modern .hero-info-icon {
        width: 36px;
        height: 36px;
    }

    .hero-modern .hero-actions {
        flex-direction: column;
    }

    .hero-modern .btn-hero-primary,
    .hero-modern .btn-hero-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* Breadcrumbs */
.breadcrumb-wrapper {
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-modern li {
    display: flex;
    align-items: center;
}

.breadcrumb-modern li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--vx-text-muted);
}

.breadcrumb-modern a {
    color: var(--vx-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-modern a:hover {
    color: var(--vx-accent);
}

.breadcrumb-modern .active {
    color: var(--vx-text);
    font-weight: 500;
}

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.category-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--vx-text);
    line-height: 1.2;
}

.category-header .category-description {
    font-size: 1.1rem;
    color: var(--vx-text-muted);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter & Sort Bar */
.filter-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--vx-bg-card);
    border-radius: var(--vx-radius);
    border: 1px solid var(--vx-border);
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-sort-bar .filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    flex-shrink: 0;
}

.filter-sort-bar label {
    color: var(--vx-text-muted);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.filter-sort-bar select,
.filter-sort-bar input {
    background: var(--vx-bg-elev);
    border: 1px solid var(--vx-border);
    color: var(--vx-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-sort-bar select:focus,
.filter-sort-bar input:focus {
    outline: none;
    border-color: var(--vx-accent);
    box-shadow: 0 0 0 3px var(--vx-accent-soft);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Unified card styles for all pages (index, view_hack, danh-muc) - From search.php/app.css */
.card {
    display: block;
    border-radius: var(--vx-radius);
    background: var(--vx-bg-card);
    border: 1px solid var(--vx-border);
    box-shadow: var(--vx-shadow);
    transition: transform 0.15s, outline-color 0.15s;
}

.card:hover {
    transform: translateY(-4px);
    outline: 1px solid var(--vx-accent);
}

.card.product-card-modern {
    background: var(--vx-bg-card);
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.card.product-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--vx-accent) 0%, var(--vx-accent-hover) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.card.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: var(--vx-shadow-lg), 0 0 0 1px var(--vx-accent-soft);
    border-color: var(--vx-accent);
}

.card.product-card-modern:hover::before {
    transform: scaleX(1);
}

/* Card media - From search.php/app.css */
.card-media {
    position: relative;
}

.card-media img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.card.product-card-modern .card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--vx-bg-elev);
}

.card.product-card-modern .card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

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

.card.product-card-modern .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.product-card-modern:hover .card-media img {
    transform: scale(1.1);
}

/* Badges - From search.php/app.css */
.badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
}

.badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.badge-primary {
    background: var(--vx-accent);
    color: #0A0A0A;
    font-weight: 600;
}

.badge-soft {
    background: var(--vx-bg-elev);
    border: 1px solid var(--vx-border);
}

.badge-maint {
    background: #EF4444;
    color: #fff;
    font-weight: 700;
    border: 0;
}

.card.product-card-modern .badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 10;
}

/* Card body - From search.php/app.css */
.card-body {
    padding: 14px;
}

.card-body h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.card-body p {
    margin: 0;
    color: var(--vx-text-muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card.product-card-modern .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--vx-bg-card);
}

.card.product-card-modern .card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--vx-text);
    line-height: 1.3;
    transition: color 0.3s;
}

.card.product-card-modern:hover .card-body h3 {
    color: var(--vx-accent);
}

.card.product-card-modern .card-body p {
    color: var(--vx-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Card foot - From search.php/app.css */
.card-foot {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Nút trong card - From search.php/app.css */
.card-foot select.btn {
    padding: 8px 10px;
    padding-right: 2.5rem; /* Thêm padding bên phải cho mũi tên dropdown */
    font-size: 14px;
    border-radius: 10px;
    line-height: 1.2;
    min-width: 0;
    max-width: 100%;
    white-space: normal; /* Cho phép text xuống dòng nếu cần */
    word-wrap: break-word;
    overflow-wrap: break-word;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

.card-foot select.btn option {
    white-space: normal;
    word-wrap: break-word;
    padding: 0.5rem;
}

.card-foot .btn-primary.btn-sm.btn-buy-hack {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 10px;
}

.price {
    color: var(--vx-warning);
    font-weight: 700;
}

.card.product-card-modern .card-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--vx-border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.product-card-modern .card-foot .flex-1 {
    flex: 1;
    min-width: 0; /* Cho phép flex item co lại */
    max-width: 100%;
    overflow: visible; /* Cho phép dropdown mở ra ngoài */
}

.product-card-modern .card-foot form.flex-1 {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: visible; /* Cho phép dropdown mở ra ngoài */
    position: relative; /* Để z-index hoạt động */
}

/* Responsive for unified cards */
@media (max-width: 768px) {
    .card.product-card-modern .card-body {
        padding: 1rem;
    }
}

/* Modern Product Card - Redesigned */
.product-card-modern {
    background: var(--vx-bg-card);
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--vx-accent) 0%, var(--vx-accent-hover) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: var(--vx-shadow-lg), 0 0 0 1px var(--vx-accent-soft);
    border-color: var(--vx-accent);
}

.product-card-modern:hover::before {
    transform: scaleX(1);
}

.product-card-modern[data-status="free"]::before {
    background: linear-gradient(90deg, var(--vx-warning) 0%, #f59e0b 100%);
}

.product-card-modern[data-status="maintenance"]::before {
    background: linear-gradient(90deg, var(--vx-danger) 0%, #dc2626 100%);
}

/* Card Media with Image Overlay */
.product-card-modern .card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--vx-bg-elev);
}

.product-card-modern .card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

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

.product-card-modern .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card-modern:hover .card-media img {
    transform: scale(1.1);
}

.product-card-modern .card-media a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* Badges - Redesigned */
.product-card-modern .badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 10;
}

.product-card-modern .badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.product-card-modern:hover .badge {
    transform: scale(1.05);
}

.badge-primary {
    background: var(--vx-success);
    color: white;
    border: 1px solid var(--vx-success);
}

.badge-maint {
    background: var(--vx-danger);
    color: white;
    border: 1px solid var(--vx-danger);
}

.badge-soft {
    background: var(--vx-accent);
    color: white;
    border: 1px solid var(--vx-accent);
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
}

.product-card-modern .badge[style*="background:var(--color-danger"] {
    background: rgba(229, 57, 53, 0.9) !important;
    color: white !important;
    border: 1px solid rgba(229, 57, 53, 1) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Discount Badge Bottom Right */
.product-card-modern .discount-badge-bottom {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 11;
}

.product-card-modern .badge-discount {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--vx-danger) 0%, #b91c1c 100%);
    color: white;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    line-height: 1.2;
    min-width: 75px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card-modern .badge-discount .discount-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    margin-bottom: 3px;
    font-weight: 600;
}

.product-card-modern .badge-discount .discount-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Discount badge animation on hover */
.product-card-modern:hover .badge-discount {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* Responsive discount badge */
@media (max-width: 640px) {
    .product-card-modern .discount-badge-bottom {
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    .product-card-modern .badge-discount {
        padding: 0.4rem 0.6rem;
        min-width: 65px;
    }
    
    .product-card-modern .badge-discount .discount-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .product-card-modern .badge-discount .discount-value {
        font-size: 1rem;
    }
}

.product-card .product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--vx-bg-elev);
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-card .product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Card Body - Redesigned */
.product-card-modern .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--vx-bg-card);
    position: relative;
}

.product-card-modern .card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--vx-text);
    line-height: 1.3;
    transition: color 0.3s;
}

.product-card-modern:hover .card-body h3 {
    color: var(--vx-accent);
}

.product-card-modern .card-body p {
    color: var(--vx-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Card Footer - Redesigned */
.product-card-modern .card-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--vx-border);
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.product-card-modern .card-foot .flex-1 {
    flex: 1;
}

.product-card-modern .package-select,
.product-card-modern .card-foot select {
    width: 100% !important; /* Override inline style */
    min-width: 0;
    max-width: 100%;
    background: var(--vx-bg-elev);
    border: 1px solid var(--vx-border);
    color: var(--vx-text);
    padding: 0.75rem 1rem;
    padding-right: 2.5rem; /* Thêm padding bên phải cho mũi tên dropdown */
    border-radius: 8px;
    font-size: 0.8rem; /* Giảm font-size để hiển thị nhiều text hơn */
    transition: all 0.3s;
    cursor: pointer;
    white-space: nowrap; /* Giữ text trên một dòng */
    overflow: hidden; /* Ẩn text tràn ra ngoài khi đóng */
    text-overflow: ellipsis; /* Hiển thị ... khi text quá dài */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    box-sizing: border-box; /* Đảm bảo padding được tính vào width */
}

/* Khi select được focus hoặc mở, hiển thị đầy đủ text */
.product-card-modern .package-select:focus,
.product-card-modern .card-foot select:focus {
    overflow: visible;
    z-index: 10;
    position: relative;
}

/* Đảm bảo option trong select hiển thị đầy đủ */
.product-card-modern .package-select option,
.product-card-modern .card-foot select option {
    white-space: normal;
    word-wrap: break-word;
    padding: 0.5rem;
}

.product-card-modern .package-select:focus,
.product-card-modern .card-foot select:focus {
    outline: none;
    border-color: var(--vx-accent);
    box-shadow: 0 0 0 3px var(--vx-accent-soft);
    background: var(--vx-bg-card);
}

.product-card-modern .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.product-card-modern .btn-primary,
.product-card-modern .btn-buy-hack {
    background: linear-gradient(135deg, var(--vx-accent) 0%, var(--vx-accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(196, 75, 44, 0.3);
}

.product-card-modern .btn-primary:hover,
.product-card-modern .btn-buy-hack:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(196, 75, 44, 0.35);
}

.product-card-modern .btn-primary:active,
.product-card-modern .btn-buy-hack:active {
    transform: translateY(0);
}

/* Button outline - From search.php */
.card a.btn-outline.btn-sm,
.card .cta-guide,
.product-card-modern .btn-outline.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 10px;
    min-height: 32px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #8a7dff, #39c5ff);
    color: #fff;
    box-shadow: 0 3px 8px rgba(57, 197, 255, 0.18);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.card a.btn-outline.btn-sm:hover,
.card .cta-guide:hover,
.product-card-modern .btn-outline.btn-sm:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

.card a.btn-outline.btn-sm:active,
.card .cta-guide:active,
.product-card-modern .btn-outline.btn-sm:active {
    transform: translateY(0);
}

@media (min-width: 992px) {
    .card a.btn-outline.btn-sm,
    .card .cta-guide,
    .product-card-modern .btn-outline.btn-sm {
        min-height: 30px;
        padding: 5px 9px;
        font-size: 0.84rem;
    }
}

/* Fallback cho .btn-outline không có .btn-sm */
.product-card-modern .btn-outline:not(.btn-sm) {
    background: transparent;
    color: var(--vx-accent);
    border: 1.5px solid var(--vx-accent);
    font-weight: 600;
}

.product-card-modern .btn-outline:not(.btn-sm):hover {
    background: var(--vx-accent);
    border-color: var(--vx-accent);
    color: #fff;
    box-shadow: 0 0 0 3px var(--vx-accent-soft);
}

.product-card-modern .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.product-card-modern [style*="background:#e02424"] {
    color: #ffffff !important;
    border: 1px solid var(--vx-border) !important;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.18);
}

.product-card-modern [style*="background: var(--warning"] {
    background: linear-gradient(135deg, var(--vx-warning) 0%, var(--vx-warning) 100%) !important;
    color: #111 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.product-card-modern [style*="background: var(--warning"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--vx-text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--vx-text);
}

.empty-state p {
    font-size: 1rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-modern {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-modern a,
.pagination-modern span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    background: var(--vx-bg-card);
    border: 1px solid var(--vx-border);
    color: var(--vx-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination-modern a:hover {
    background: var(--vx-bg-elev);
    border-color: var(--vx-accent);
    color: var(--vx-accent);
}

.pagination-modern .active {
    background: var(--vx-accent);
    border-color: var(--vx-accent);
    color: white;
}

.pagination-modern .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--vx-border);
    border-top-color: var(--vx-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Cards Grid - Override for existing .cards class */
.cards .product-card-modern {
    margin-bottom: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .category-header h1 {
        font-size: 2rem;
    }

    .cards {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .filter-sort-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
        overflow-x: visible;
    }

    .filter-sort-bar .filter-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }

    .filter-sort-bar label {
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
        display: block;
        width: 100%;
    }

    .filter-sort-bar select,
    .filter-sort-bar input {
        width: 100% !important;
        padding: 0.75rem;
        font-size: 0.9rem;
        box-sizing: border-box;
    }

    .pagination-modern {
        flex-wrap: wrap;
    }

    .product-card-modern .card-foot {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .product-card-modern .card-foot .flex-1,
    .product-card-modern .card-foot form.flex-1 {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .product-card-modern .card-foot select,
    .product-card-modern .card-foot .btn {
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .product-card-modern .card-foot .btn-buy-hack {
        width: 100% !important;
        margin-top: 0;
    }
    
    .product-card-modern .card-body {
        padding: 1rem;
    }
    
    .product-card-modern .card-body h3 {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .product-card-modern .card-body p {
        font-size: 0.85rem;
    }
    
    /* Fix cho hero section trên mobile */
    .hero-modern .hero-inner {
        padding: 1.5rem 1rem;
    }
    
    .hero-modern .hero-info-box {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Accessibility */
.product-card:focus-within {
    outline: 2px solid var(--vx-accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

