/* ==========================================================================
   ERB System — Noon-Inspired Modern E-Commerce Stylesheet
   ========================================================================== */

/* Custom Palette & Variables */
:root {
    --ecom-bg: #ffffff;
    --ecom-card-bg: #ffffff;
    --ecom-border: #f2f2f2;
    --ecom-text-primary: #1e2022;
    --ecom-text-secondary: #7e858a;
    --ecom-yellow: #feee00;
    --ecom-green: #38ae04;
    --ecom-green-light: #e8f5e9;
    --ecom-red: #ff3f3f;
    --ecom-red-light: #ffebee;
    --ecom-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    --ecom-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Page Level styling */
body {
    background-color: var(--ecom-bg) !important;
    color: var(--ecom-text-primary);
    font-family: 'Cairo', 'Outfit', sans-serif !important;
}

/* Custom Premium Navbar Styling */
.navbar-custom {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.navbar-custom .navbar-brand {
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.4rem;
}

.navbar-custom .nav-link {
    color: #cbd5e1 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease;
}

.navbar-custom .nav-link:hover {
    color: #ffffff !important;
    opacity: 1;
    transform: translateY(-1px);
}

.navbar-custom .nav-link.position-relative i {
    color: #ffffff !important;
}

.navbar-custom .btn-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 700;
    transition: all 0.2s ease;
}

.navbar-custom .btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.navbar-custom .btn-outline-primary {
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    font-weight: 700;
}

.navbar-custom .btn-outline-primary:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Section Header Styling */
.section-header {
    background: rgba(248, 250, 252, 0.6) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-radius: 16px !important;
    padding: 16px 24px !important;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.section-header::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1.5px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -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;
    pointer-events: none;
}

.section-header:hover {
    background: #ffffff !important;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.06) !important;
    border-color: transparent !important;
    transform: translateY(-2px);
}

.section-header:hover::after {
    opacity: 1;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ecom-text-primary);
    margin: 0;
}

/* Gray block container like Noon's Men's fashion section */
.bg-section-gray {
    background-color: #f7f7fa !important;
    border-radius: 20px !important;
    padding: 2.5rem 2rem !important;
    margin-bottom: 3rem;
}

/* Rounded Categories & Squircle Shapes like Noon's first image */
.category-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-img-wrapper {
    background-color: #f4f4f6 !important;
    border-radius: 24px !important;
    width: clamp(90px, 15vw, 130px);
    height: clamp(90px, 15vw, 130px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-card:hover .category-img-wrapper {
    transform: scale(1.06) translateY(-3px);
    background-color: #ebebeb !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05) !important;
}

.category-card h6 {
    color: var(--ecom-text-primary);
    margin-top: 12px;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Product Card - Premium Noon Style with Rich Animations */
.product-card {
    background-color: var(--ecom-card-bg) !important;
    border: 1px solid var(--ecom-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--ecom-shadow) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    position: relative;
}

/* Bottom accent line that expands on hover */
.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ecom-yellow), #ffc107);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
}

.product-card:hover::after {
    width: 60%;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1) !important;
    border-color: #e8e8e8 !important;
}

/* Image container */
.premium-img-container {
    background-color: #fafafa !important;
    position: relative;
    border-bottom: 1px solid #f5f5f5;
    overflow: hidden;
}

/* Shimmer overlay on image hover */
.premium-img-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    z-index: 3;
    transition: none;
}

.product-card:hover .premium-img-container::before {
    animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Image zoom on hover */
.premium-img-container img {
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

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

/* Action buttons - slide in from right on hover */
.card-actions-overlay {
    position: absolute;
    top: 8px;
    right: -50px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .card-actions-overlay {
    right: 8px;
}

/* Action Overlay & Heart button */
.glass-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid var(--ecom-border) !important;
    color: #555 !important;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(4px);
}

.glass-badge:hover {
    transform: scale(1.18);
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14) !important;
}

.glass-badge:hover i {
    animation: heartPulse 0.5s infinite alternate;
}

@keyframes heartPulse {
    from { transform: scale(1); }
    to { transform: scale(1.25); }
}

/* Discount badge with entrance animation */
.discount-badge {
    background: var(--ecom-red) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    animation: badgeBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.glass-badge-danger {
    background: var(--ecom-red-light) !important;
    color: var(--ecom-red) !important;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Rating badge styling */
.rating-pill {
    background-color: #f5f5f5;
    color: var(--ecom-green);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.product-card:hover .rating-pill {
    background-color: var(--ecom-green-light);
}

.text-warning {
    color: #fbc02d !important;
}

/* Card body content transitions */
.product-card .card-body {
    transition: all 0.3s ease;
}

.product-card:hover .card-body {
    background-color: #fefefe;
}

/* Product title link hover */
.product-card .card-title a {
    transition: color 0.2s ease;
}

.product-card:hover .card-title a {
    color: #333 !important;
}

/* Price styling with subtle glow on hover */
.price-tag {
    transition: all 0.3s ease;
}

.product-card:hover .price-tag {
    color: var(--ecom-green) !important;
    text-shadow: 0 0 8px rgba(56, 174, 4, 0.15);
}

/* Add to Cart button styling */
.btn-amazon {
    background-color: #ffffff !important;
    border: 1.5px solid #e0e0e0 !important;
    color: var(--ecom-text-primary) !important;
    font-size: 0.85rem;
    padding: 7px 16px !important;
    border-radius: 22px !important;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
    overflow: hidden;
    position: relative;
}

.btn-amazon:hover {
    background-color: var(--ecom-yellow) !important;
    border-color: var(--ecom-yellow) !important;
    color: var(--ecom-text-primary) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(254, 238, 0, 0.35) !important;
}

/* Cart icon spin on hover */
.btn-amazon:hover i {
    animation: cartBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(-8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Exclusive offers styling */
.coupon-card {
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: var(--ecom-shadow) !important;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.coupon-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ecom-shadow-hover) !important;
}

/* Staggered card entrance animation */
.row > .col:nth-child(1) .product-card { animation-delay: 0s; }
.row > .col:nth-child(2) .product-card { animation-delay: 0.06s; }
.row > .col:nth-child(3) .product-card { animation-delay: 0.12s; }
.row > .col:nth-child(4) .product-card { animation-delay: 0.18s; }
.row > .col:nth-child(5) .product-card { animation-delay: 0.24s; }

.scroll-reveal.revealed .product-card {
    animation: cardEntrance 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

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

/* Scroll reveal helper class */
.scroll-reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    margin-top: 3.5rem !important;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
