/**
 * WooCommerce Product Showcase Styles
 * Primary Color: #124ea2
 * Author: Altechmind Technologies
 */

:root {
    --wc-showcase-primary: #124ea2;
    --wc-showcase-primary-light: #1a5fb8;
    --wc-showcase-primary-dark: #0e3d7a;
    --wc-showcase-primary-rgb: 18, 78, 162;
    --wc-showcase-success: #10b981;
    --wc-showcase-warning: #f59e0b;
    --wc-showcase-danger: #ef4444;
    --wc-showcase-gray-50: #f9fafb;
    --wc-showcase-gray-100: #f3f4f6;
    --wc-showcase-gray-200: #e5e7eb;
    --wc-showcase-gray-300: #d1d5db;
    --wc-showcase-gray-400: #9ca3af;
    --wc-showcase-gray-500: #6b7280;
    --wc-showcase-gray-600: #4b5563;
    --wc-showcase-gray-700: #374151;
    --wc-showcase-gray-800: #1f2937;
    --wc-showcase-gray-900: #111827;
    --wc-showcase-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --wc-showcase-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --wc-showcase-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --wc-showcase-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --wc-showcase-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --wc-showcase-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.wc-showcase-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Grid Layout */
.wc-showcase-grid {
    display: grid;
    gap: 1.5rem;
}

.wc-showcase-container[data-columns="1"] .wc-showcase-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
}

.wc-showcase-container[data-columns="2"] .wc-showcase-grid {
    grid-template-columns: repeat(2, 1fr);
}

.wc-showcase-container[data-columns="3"] .wc-showcase-grid {
    grid-template-columns: repeat(3, 1fr);
}

.wc-showcase-container[data-columns="4"] .wc-showcase-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .wc-showcase-container[data-columns="4"] .wc-showcase-grid,
    .wc-showcase-container[data-columns="3"] .wc-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .wc-showcase-container[data-columns="4"] .wc-showcase-grid,
    .wc-showcase-container[data-columns="3"] .wc-showcase-grid,
    .wc-showcase-container[data-columns="2"] .wc-showcase-grid {
        grid-template-columns: 1fr;
    }
    
    .wc-showcase-grid {
        gap: 1rem;
    }
}

/* Showcase Item with Animation */
.wc-showcase-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s var(--wc-showcase-transition) forwards;
    animation-delay: var(--delay, 0ms);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.wc-showcase-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--wc-showcase-shadow);
    transition: all 0.4s var(--wc-showcase-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wc-showcase-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--wc-showcase-shadow-xl);
}

/* Badges */
.wc-showcase-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-sale {
    background: linear-gradient(135deg, var(--wc-showcase-danger), #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.badge-featured {
    background: linear-gradient(135deg, var(--wc-showcase-primary), var(--wc-showcase-primary-light));
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--wc-showcase-primary-rgb), 0.4);
}

/* Image Container */
.wc-showcase-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--wc-showcase-gray-100);
}

.wc-showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--wc-showcase-transition);
}

.wc-showcase-card:hover .wc-showcase-image img {
    transform: scale(1.08);
}

/* Image Overlay */
.wc-showcase-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(var(--wc-showcase-primary-rgb), 0.9) 0%,
        rgba(var(--wc-showcase-primary-rgb), 0.4) 50%,
        transparent 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s var(--wc-showcase-transition);
}

.wc-showcase-card:hover .wc-showcase-overlay {
    opacity: 1;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: var(--wc-showcase-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s var(--wc-showcase-transition);
}

.wc-showcase-card:hover .btn-view {
    transform: translateY(0);
    opacity: 1;
}

.btn-view:hover {
    background: var(--wc-showcase-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(var(--wc-showcase-primary-rgb), 0.5);
}

/* Content */
.wc-showcase-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.wc-showcase-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--wc-showcase-primary);
    margin-bottom: 8px;
}

.wc-showcase-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wc-showcase-title a {
    color: var(--wc-showcase-gray-800);
    text-decoration: none;
    transition: color 0.3s ease;
}

.wc-showcase-title a:hover {
    color: var(--wc-showcase-primary);
}

/* Rating */
.wc-showcase-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.star {
    color: var(--wc-showcase-gray-300);
    font-size: 14px;
    line-height: 1;
}

.star.filled {
    color: var(--wc-showcase-warning);
}

.star.half {
    background: linear-gradient(90deg, var(--wc-showcase-warning) 50%, var(--wc-showcase-gray-300) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-count {
    font-size: 12px;
    color: var(--wc-showcase-gray-500);
    margin-left: 4px;
}

/* Price */
.wc-showcase-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    margin-top: auto;
}

.price-old {
    font-size: 14px;
    color: var(--wc-showcase-gray-400);
    text-decoration: line-through;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--wc-showcase-gray-900);
}

.price-current .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

.price-discount {
    display: inline-flex;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--wc-showcase-danger);
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

/* Action Buttons */
.wc-showcase-actions {
    margin-top: auto;
}

.btn-add-to-cart,
.btn-select-options,
.btn-view-product {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--wc-showcase-transition);
    text-decoration: none;
}

.btn-add-to-cart {
    background: linear-gradient(135deg, var(--wc-showcase-primary), var(--wc-showcase-primary-light));
    color: #fff;
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--wc-showcase-primary-dark), var(--wc-showcase-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-add-to-cart:hover::before {
    opacity: 1;
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--wc-showcase-primary-rgb), 0.4);
}

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

.btn-add-to-cart .btn-text,
.btn-add-to-cart .btn-loading,
.btn-add-to-cart .btn-added {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.btn-add-to-cart .btn-loading,
.btn-add-to-cart .btn-added {
    display: none;
}

.btn-add-to-cart.loading .btn-text,
.btn-add-to-cart.added .btn-text {
    display: none;
}

.btn-add-to-cart.loading .btn-loading {
    display: flex;
}

.btn-add-to-cart.added .btn-added {
    display: flex;
}

.btn-add-to-cart.added {
    background: linear-gradient(135deg, var(--wc-showcase-success), #059669);
}

/* Spinner Animation */
.spinner {
    width: 18px;
    height: 18px;
    animation: rotate 1s linear infinite;
}

.spinner-circle {
    stroke: currentColor;
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
    animation: dash 1.2s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 60;
    }
    50% {
        stroke-dashoffset: 15;
    }
    100% {
        stroke-dashoffset: 60;
    }
}

/* Secondary Buttons */
.btn-select-options {
    background: var(--wc-showcase-gray-100);
    color: var(--wc-showcase-gray-700);
    border: 2px solid var(--wc-showcase-gray-200);
}

.btn-select-options:hover {
    background: var(--wc-showcase-primary);
    color: #fff;
    border-color: var(--wc-showcase-primary);
    transform: translateY(-2px);
}

.btn-view-product {
    background: transparent;
    color: var(--wc-showcase-primary);
    border: 2px solid var(--wc-showcase-primary);
}

.btn-view-product:hover {
    background: var(--wc-showcase-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Toast Notification */
.wc-showcase-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--wc-showcase-shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.4s var(--wc-showcase-transition);
    z-index: 9999;
}

.wc-showcase-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    color: var(--wc-showcase-success);
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--wc-showcase-gray-700);
}

.toast-cart-link {
    display: inline-flex;
    padding: 8px 16px;
    background: var(--wc-showcase-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast-cart-link:hover {
    background: var(--wc-showcase-primary-dark);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .wc-showcase-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .toast-cart-link {
        width: 100%;
        justify-content: center;
    }
}

/* Empty State */
.wc-showcase-empty {
    text-align: center;
    padding: 3rem;
    color: var(--wc-showcase-gray-500);
    font-size: 16px;
}

/* Loading Skeleton (Optional Enhancement) */
.wc-showcase-skeleton {
    background: linear-gradient(90deg, var(--wc-showcase-gray-200) 25%, var(--wc-showcase-gray-100) 50%, var(--wc-showcase-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Accessibility */
.btn-add-to-cart:focus-visible,
.btn-select-options:focus-visible,
.btn-view-product:focus-visible,
.btn-view:focus-visible {
    outline: 3px solid rgba(var(--wc-showcase-primary-rgb), 0.5);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wc-showcase-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .wc-showcase-card:hover {
        transform: none;
    }
    
    .wc-showcase-card:hover .wc-showcase-image img {
        transform: none;
    }
    
    .spinner {
        animation: none;
    }
    
    .spinner-circle {
        animation: none;
        stroke-dashoffset: 30;
    }
}

/* Print Styles */
@media print {
    .wc-showcase-overlay,
    .wc-showcase-actions,
    .wc-showcase-toast {
        display: none !important;
    }
    
    .wc-showcase-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
