/* ====================================
   Products Section - Grid Cards Modern
   Clean Grid Layout with Smooth Hover
   ==================================== */

/* Section Container */
.products-modern-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 30%, #f1f5f9 70%, #ffffff 100%);
    overflow: hidden;
}

.products-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 20%, rgba(67, 17, 169, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(93, 43, 196, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(67, 17, 169, 0.03) 0%, transparent 60%);
    z-index: 0;
    animation: gradient-shift 15s ease infinite;
}

.products-bg-gradient::before,
.products-bg-gradient::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float-shapes 20s ease-in-out infinite;
}

.products-bg-gradient::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(67, 17, 169, 0.15), transparent);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.products-bg-gradient::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(93, 43, 196, 0.15), transparent);
    bottom: -80px;
    right: -80px;
    animation-delay: 5s;
}

@keyframes gradient-shift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes float-shapes {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.products-modern-section .container {
    position: relative;
    z-index: 1;
}

/* Section Header */
.products-header-modern {
    margin-bottom: 70px;
}

.mini-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 26px;
    background: linear-gradient(135deg, rgba(67, 17, 169, 0.12), rgba(93, 43, 196, 0.12));
    border: 1px solid rgba(67, 17, 169, 0.2);
    border-radius: 50px;
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(67, 17, 169, 0.1);
}

.mini-badge-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(67, 17, 169, 0.2);
    border-color: rgba(67, 17, 169, 0.3);
}

.badge-dot-modern {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #4311a9, #5d2bc4);
    border-radius: 50%;
    animation: pulse-dot-modern 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(67, 17, 169, 0.6);
}

@keyframes pulse-dot-modern {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 12px rgba(67, 17, 169, 0.6);
    }
    50% {
        transform: scale(1.4);
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(67, 17, 169, 0.9);
    }
}

.badge-text-modern {
    background: linear-gradient(135deg, #4311a9, #5d2bc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.products-title-modern {
    font-size: 50px;
    font-weight: 800;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.title-line-modern {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.line-accent {
    width: 100px;
    height: 5px;
    background: linear-gradient(90deg, #4311a9, #5d2bc4, #4311a9);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: line-gradient 3s ease infinite;
    box-shadow: 0 2px 10px rgba(67, 17, 169, 0.3);
}

@keyframes line-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Products Grid */
.products-grid-modern {
    margin-top: 50px;
}

/* Product Card */
.product-card-modern {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 35px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(67, 17, 169, 0.08);
}

.product-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(67, 17, 169, 0.05), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.product-card-modern::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(67, 17, 169, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 0;
    pointer-events: none;
}

.product-card-modern:hover::before {
    left: 100%;
}

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

.product-card-modern:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(67, 17, 169, 0.25), 0 0 0 1px rgba(67, 17, 169, 0.2) inset;
    border-color: rgba(67, 17, 169, 0.3);
}

/* Card Image */
.card-image-wrapper {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(67, 17, 169, 0.05), rgba(93, 43, 196, 0.05));
}

.card-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(67, 17, 169, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

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

.image-link-modern {
    display: block;
    height: 100%;
    position: relative;
    z-index: 2;
}

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

.product-card-modern:hover .product-img-modern {
    transform: scale(1.15) rotate(1deg);
    filter: brightness(1.05) contrast(1.1);
}

/* Placeholder Image */
.product-placeholder-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(67, 17, 169, 0.05), rgba(93, 43, 196, 0.05));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
    text-align: center;
}

.product-placeholder-img svg {
    color: rgba(67, 17, 169, 0.3);
    width: 80px;
    height: 80px;
}

.placeholder-text {
    color: #718096;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.image-overlay-modern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(67, 17, 169, 0.9),
        rgba(93, 43, 196, 0.9)
    );
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    z-index: 3;
}

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

.overlay-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4311a9;
    transform: scale(0) rotate(-180deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(67, 17, 169, 0.2);
    position: relative;
    overflow: hidden;
}

.overlay-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(67, 17, 169, 0.3), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.product-card-modern:hover .overlay-icon {
    transform: scale(1) rotate(0deg);
    animation: icon-pulse 2s ease-in-out infinite;
}

.product-card-modern:hover .overlay-icon::before {
    width: 200%;
    height: 200%;
}

@keyframes icon-pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 10px 40px rgba(67, 17, 169, 0.5);
    }
}

.overlay-icon svg {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.product-card-modern:hover .overlay-icon svg {
    transform: scale(1.1) rotate(5deg);
}

/* Badge */
.card-badge-modern {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4311a9, #5d2bc4);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 4;
    animation: float-badge-modern 3s ease-in-out infinite;
    box-shadow: 0 8px 25px rgba(67, 17, 169, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card-badge-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: transform 0.6s ease;
}

.card-badge-modern:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 35px rgba(67, 17, 169, 0.6);
}

.card-badge-modern:hover::before {
    transform: rotate(225deg);
}

@keyframes float-badge-modern {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.card-badge-modern svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.card-badge-modern:hover svg {
    transform: scale(1.2) rotate(-10deg);
}

/* Card Content */
.card-content-modern {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.8) 100%);
}

.card-content-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(67, 17, 169, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.product-name-modern {
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.product-name-modern a {
    background: linear-gradient(135deg, #1a202c, #2d3748);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.4s ease;
    display: inline-block;
    position: relative;
}

.product-name-modern a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4311a9, #5d2bc4, #4311a9);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 2px 8px rgba(67, 17, 169, 0.4);
}

.product-name-modern a:hover {
    background: linear-gradient(135deg, #4311a9, #5d2bc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(-3px);
}

.product-name-modern a:hover::after {
    width: 100%;
    animation: underline-glow 2s ease infinite;
}

@keyframes underline-glow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(67, 17, 169, 0.4);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 2px 12px rgba(67, 17, 169, 0.6);
    }
}

/* Button */
.product-btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #4311a9, #5d2bc4);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(67, 17, 169, 0.35);
    border: 2px solid transparent;
    letter-spacing: 0.3px;
}

.product-btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.product-btn-modern::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, #4311a9, #5d2bc4, #4311a9);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: border-rotate-btn 3s linear infinite;
    z-index: -1;
}

@keyframes border-rotate-btn {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.product-btn-modern:hover::before {
    left: 100%;
}

.product-btn-modern:hover {
    transform: translateX(-8px) scale(1.02);
    box-shadow: 0 10px 35px rgba(67, 17, 169, 0.5), 0 0 0 4px rgba(67, 17, 169, 0.1);
    color: #ffffff;
    background: linear-gradient(135deg, #d43848, #2d7ba8);
}

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

.product-btn-modern:active {
    transform: translateX(-6px) scale(0.98);
    box-shadow: 0 5px 20px rgba(67, 17, 169, 0.4);
}

.btn-arrow {
    transition: transform 0.4s ease;
    width: 20px;
    height: 20px;
    position: relative;
}

.btn-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.product-btn-modern:hover .btn-arrow {
    transform: translateX(8px) scale(1.1);
}

.product-btn-modern:hover .btn-arrow::after {
    width: 40px;
    height: 40px;
}

[dir="rtl"] .product-btn-modern:hover {
    transform: translateX(8px) scale(1.02);
}

[dir="rtl"] .product-btn-modern:hover .btn-arrow {
    transform: translateX(-8px) scale(1.1);
}

[dir="rtl"] .product-name-modern a:hover {
    transform: translateX(3px);
}

[dir="rtl"] .card-badge-modern {
    right: auto;
    left: 24px;
}

[dir="rtl"] .card-badge-modern:hover {
    transform: scale(1.15) rotate(-10deg);
}

[dir="rtl"] .card-badge-modern:hover svg {
    transform: scale(1.2) rotate(10deg);
}

@media (max-width: 767px) {
    [dir="rtl"] .card-badge-modern {
        left: 20px;
    }
}

/* Card Glow Effect */
.card-glow-modern {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 5px;
    background: linear-gradient(90deg, transparent, #4311a9, #5d2bc4, #4311a9, transparent);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.5s ease, height 0.5s ease;
    border-radius: 0 0 24px 24px;
    animation: glow-line 3s ease infinite;
    box-shadow: 0 -2px 10px rgba(67, 17, 169, 0.4);
}

.card-glow-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer-glow 2s ease infinite;
}

@keyframes glow-line {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmer-glow {
    0% {
        transform: translate(-150%, -50%);
    }
    100% {
        transform: translate(150%, -50%);
    }
}

.product-card-modern:hover .card-glow-modern {
    opacity: 1;
    height: 6px;
    box-shadow: 0 -3px 15px rgba(67, 17, 169, 0.6);
}

/* Responsive Design */
@media (max-width: 1199px) {
    .card-image-wrapper {
        height: 280px;
    }
    
    .products-grid-modern::before,
    .products-grid-modern::after {
        display: none;
    }
}

@media (max-width: 991px) {
    .products-modern-section {
        padding: 100px 0;
    }

    .products-header-modern {
        margin-bottom: 50px;
    }

    .products-title-modern {
        font-size: 40px;
    }

    .line-accent {
        width: 90px;
    }

    .card-image-wrapper {
        height: 260px;
    }

    .card-content-modern {
        padding: 28px;
    }
    
    .products-bg-gradient::before,
    .products-bg-gradient::after {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 767px) {
    .products-modern-section {
        padding: 80px 0;
    }

    .products-header-modern {
        margin-bottom: 40px;
    }

    .products-title-modern {
        font-size: 32px;
    }

    .line-accent {
        width: 70px;
        height: 4px;
    }

    .card-image-wrapper {
        height: 240px;
    }

    .card-content-modern {
        padding: 24px;
    }

    .product-name-modern {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .product-card-modern {
        margin-bottom: 25px;
    }

    .product-btn-modern {
        padding: 12px 28px;
        font-size: 15px;
    }

    .card-badge-modern {
        width: 44px;
        height: 44px;
        top: 20px;
        right: 20px;
    }
    
    .products-bg-gradient::before,
    .products-bg-gradient::after {
        width: 250px;
        height: 250px;
    }
    
    .overlay-icon {
        width: 60px;
        height: 60px;
    }
    
    .overlay-icon svg {
        width: 28px;
        height: 28px;
    }
}

/* Additional Decorative Elements */
.products-grid-modern::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(67, 17, 169, 0.08), transparent);
    border-radius: 50%;
    filter: blur(40px);
    animation: float-decorative 15s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.products-grid-modern::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: 15%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(93, 43, 196, 0.08), transparent);
    border-radius: 50%;
    filter: blur(40px);
    animation: float-decorative 18s ease-in-out infinite reverse;
    z-index: 0;
    pointer-events: none;
}

@keyframes float-decorative {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(30px, -40px) scale(1.2);
        opacity: 0.8;
    }
}

/* Stagger Animation for Cards */
.product-card-modern:nth-child(1) {
    animation-delay: 0s;
}

.product-card-modern:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card-modern:nth-child(3) {
    animation-delay: 0.2s;
}

.product-card-modern {
    animation: fade-in-up 0.6s ease forwards;
    opacity: 0;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .products-modern-section {
        padding: 40px 0;
    }

    .card-badge-modern,
    .card-glow-modern,
    .products-bg-gradient,
    .products-grid-modern::before,
    .products-grid-modern::after {
        display: none;
    }
}
