/**
 * Polytron Animated Cards - Premium CSS
 * Animații spectaculoase pentru desktop și mobile
 */

/* ============================================
   VARIABILE CSS - TEMA PREMIUM
   ============================================ */
:root {
    --polytron-primary: #FF6B35;
    --polytron-secondary: #004E89;
    --polytron-accent: #F7B801;
    --polytron-dark: #1A1A2E;
    --polytron-light: #FFFFFF;
    --polytron-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --polytron-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --polytron-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --polytron-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.24);
    --polytron-gradient-shine: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    --polytron-ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
    --polytron-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   GRID LAYOUT - CARDURI
   ============================================ */
.polytron-cards-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
}

.polytron-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    perspective: 1000px;
}

/* ============================================
   CARD STYLING - DESIGN PREMIUM
   ============================================ */
.polytron-card {
    position: relative;
    background: var(--polytron-light);
    border-radius: 24px;
    padding: 48px 32px;
    transition: all 0.6s var(--polytron-ease-smooth);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--polytron-shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.polytron-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.03) 0%, 
        rgba(0, 78, 137, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.6s var(--polytron-ease-smooth);
    z-index: 0;
}

.polytron-card:hover::before {
    opacity: 1;
}

.polytron-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--polytron-shadow-xl);
    border-color: rgba(255, 107, 53, 0.2);
}

/* ============================================
   ICON CONTAINER - PROFESSIONAL REVEAL
   ============================================ */
.polytron-card-icon-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.polytron-card-icon-box {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--polytron-primary) 0%, var(--polytron-accent) 100%);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--polytron-shadow-lg);
    overflow: hidden;
    opacity: 0;
    animation: professionalReveal 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Professional reveal - banda din stanga in dreapta */
.polytron-card-icon-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: revealBand 1.2s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    z-index: 3;
}

@keyframes professionalReveal {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

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

.polytron-card-icon {
    font-size: 4rem;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Delay profesional între carduri */
.polytron-card:nth-child(1) .polytron-card-icon-box,
.polytron-card:nth-child(1) .polytron-card-icon-box::before {
    animation-delay: 0s;
}

.polytron-card:nth-child(2) .polytron-card-icon-box,
.polytron-card:nth-child(2) .polytron-card-icon-box::before {
    animation-delay: 0.15s;
}

.polytron-card:nth-child(3) .polytron-card-icon-box,
.polytron-card:nth-child(3) .polytron-card-icon-box::before {
    animation-delay: 0.3s;
}

.polytron-card:nth-child(4) .polytron-card-icon-box,
.polytron-card:nth-child(4) .polytron-card-icon-box::before {
    animation-delay: 0.45s;
}

.polytron-card:nth-child(5) .polytron-card-icon-box,
.polytron-card:nth-child(5) .polytron-card-icon-box::before {
    animation-delay: 0.6s;
}

.polytron-card:nth-child(6) .polytron-card-icon-box,
.polytron-card:nth-child(6) .polytron-card-icon-box::before {
    animation-delay: 0.75s;
}

/* ============================================
   CARD CONTENT
   ============================================ */
.polytron-card-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.polytron-card-title {
    font-family: 'Raleway', 'Segoe UI', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--polytron-dark);
    margin: 0 0 24px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.polytron-card-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.polytron-card-link {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--polytron-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s var(--polytron-ease-smooth);
    position: relative;
    overflow: hidden;
}

.polytron-card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 107, 53, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.polytron-card-link:hover::before {
    left: 100%;
}

.polytron-card-link:hover {
    color: var(--polytron-primary);
    background: rgba(255, 107, 53, 0.08);
    transform: translateX(4px);
}

/* ============================================
   MOBILE OVERLAY - PREMIUM DESIGN
   ============================================ */
.polytron-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--polytron-ease-smooth);
}

.polytron-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.polytron-overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 480px;
    height: 70%;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border-radius: 32px;
    padding: 0;
    overflow: hidden;
    transition: transform 0.4s var(--polytron-ease-bounce);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    
    /* Gradient la margini - fade out subtil */
    position: relative;
}

.polytron-mobile-overlay.active .polytron-overlay-content {
    transform: translate(-50%, -50%) scale(1);
}

/* Gradient fade la margini */
.polytron-overlay-content::before,
.polytron-overlay-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 10;
}

.polytron-overlay-content::before {
    top: 0;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0) 100%);
}

.polytron-overlay-content::after {
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(248, 249, 250, 1) 0%, 
        rgba(248, 249, 250, 0) 100%);
}

/* Header overlay */
.polytron-overlay-header {
    position: relative;
    z-index: 11;
    padding: 24px;
    background: linear-gradient(135deg, var(--polytron-primary), var(--polytron-accent));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.polytron-overlay-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.polytron-overlay-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.75rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.polytron-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================
   CAROUSEL PRODUSE - PROFESIONAL (COMPLET)
   ============================================ */
.polytron-products-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 32px 24px 40px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.polytron-products-carousel::-webkit-scrollbar {
    display: none;
}

.polytron-product-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--polytron-shadow-md);
    transition: all 0.3s var(--polytron-ease-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
}

.polytron-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--polytron-shadow-lg);
}

/* Imagine produs - dimensiuni profesionale */
.polytron-product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
    background: #F8F9FA;
    padding: 20px;
}

.polytron-product-info {
    padding: 20px;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.polytron-product-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--polytron-dark);
    margin: 0 0 12px;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating stele */
.polytron-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.875rem;
}

.polytron-product-stars {
    color: var(--polytron-accent);
    font-size: 1rem;
    letter-spacing: 2px;
}

.polytron-product-rating-count {
    color: #666;
    font-size: 0.85rem;
}

/* Preț profesional */
.polytron-product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--polytron-primary);
    margin: 0 0 16px;
}

.polytron-product-price del {
    font-size: 1.1rem;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

/* Buton Add to Cart profesional */
.polytron-product-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.polytron-add-to-cart {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--polytron-primary), var(--polytron-accent));
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s var(--polytron-ease-smooth);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.polytron-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.polytron-add-to-cart:active {
    transform: translateY(0);
}

.polytron-view-details {
    padding: 14px 20px;
    background: white;
    color: var(--polytron-secondary);
    text-decoration: none;
    border: 2px solid var(--polytron-secondary);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s var(--polytron-ease-smooth);
    display: inline-block;
}

.polytron-view-details:hover {
    background: var(--polytron-secondary);
    color: white;
}

/* Stock status */
.polytron-stock-status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 12px;
    font-weight: 500;
}

.polytron-stock-status.in-stock {
    background: #E8F5E9;
    color: #2E7D32;
}

.polytron-stock-status.out-of-stock {
    background: #FFEBEE;
    color: #C62828;
}

/* Product badge pentru oferte */
.polytron-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FF5722, #FF6B35);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.4);
    z-index: 10;
}

/* Loading state profesional */
.polytron-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: var(--polytron-secondary);
    font-weight: 500;
}

.polytron-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 78, 137, 0.1);
    border-top-color: var(--polytron-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ============================================
   RESPONSIVE - MOBILE OPTIMIZATION
   ============================================ */
@media screen and (max-width: 768px) {
    .polytron-cards-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .polytron-card {
        padding: 40px 24px;
    }
    
    .polytron-card-icon-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .polytron-card-icon {
        font-size: 3.5rem;
    }
    
    .polytron-card-title {
        font-size: 1.5rem;
    }
    
    .polytron-product-card {
        flex: 0 0 260px;
    }
    
    .polytron-product-image {
        height: 180px;
    }
    
    .polytron-product-title {
        font-size: 0.95rem;
    }
    
    .polytron-product-price {
        font-size: 1.3rem;
    }
}

@media screen and (max-width: 480px) {
    .polytron-overlay-content {
        width: 95%;
        height: 80%;
    }
    
    .polytron-product-card {
        flex: 0 0 240px;
    }
    
    .polytron-product-image {
        height: 160px;
        padding: 15px;
    }
    
    .polytron-product-info {
        padding: 16px;
    }
    
    .polytron-add-to-cart {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states pentru accessibility */
.polytron-card:focus-visible,
.polytron-card-link:focus-visible,
.polytron-overlay-close:focus-visible,
.polytron-product-link:focus-visible {
    outline: 3px solid var(--polytron-accent);
    outline-offset: 4px;
}
