/**
 * RPC Kit Shop Section - Frontend Styles
 * 
 * All styles are scoped under .rpc-kit-shop-wrapper to avoid conflicts
 * with theme styles.
 * 
 * @package RPC_Kit_Shop
 */

/* CSS Variables with defaults - can be overridden via inline styles */
.rpc-kit-shop-wrapper {
    --rpc-kit-bg: #0a1628;
    --rpc-kit-card-bg: #111d32;
    --rpc-kit-accent: #39ff14;
    --rpc-kit-text: #ffffff;
    --rpc-kit-text-muted: #8892a4;
    --rpc-kit-border: rgba(255, 255, 255, 0.1);
    --rpc-kit-gap: 24px;
    --rpc-kit-radius: 16px;
    --rpc-kit-radius-sm: 8px;
}

/* Main Wrapper */
.rpc-kit-shop-wrapper {
    background-color: var(--rpc-kit-bg);
    padding: 60px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

.rpc-kit-shop-wrapper *,
.rpc-kit-shop-wrapper *::before,
.rpc-kit-shop-wrapper *::after {
    box-sizing: border-box;
}

/* Header Section */
.rpc-kit-shop-header {
    text-align: center;
    margin-bottom: 48px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.rpc-kit-shop-title {
    color: var(--rpc-kit-text);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rpc-kit-shop-subtitle {
    color: var(--rpc-kit-text-muted);
    font-size: 1.125rem;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Product Grid */
.rpc-kit-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--rpc-kit-gap);
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .rpc-kit-shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rpc-kit-shop-grid {
        grid-template-columns: 1fr;
    }

    .rpc-kit-shop-wrapper {
        padding: 40px 16px;
    }

    .rpc-kit-shop-title {
        font-size: 1.875rem;
    }
}

/* Product Card */
.rpc-kit-card {
    position: relative;
    background: var(--rpc-kit-card-bg);
    border: 1px solid var(--rpc-kit-border);
    border-radius: var(--rpc-kit-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rpc-kit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rpc-kit-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rpc-kit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.rpc-kit-card:hover::before {
    opacity: 1;
}

/* Popular Badge */
.rpc-kit-popular-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--rpc-kit-accent);
    color: #0a1628;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(57, 255, 20, 0.3);
}

/* Card Inner Layout */
.rpc-kit-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Image */
.rpc-kit-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2940 0%, #0d1520 100%);
}

.rpc-kit-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.rpc-kit-card:hover .rpc-kit-card-image img {
    transform: scale(1.05);
}

.rpc-kit-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2940 0%, #0d1520 100%);
}

.rpc-kit-card-placeholder::after {
    content: '';
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23555'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z' /%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.3;
}

/* Card Content */
.rpc-kit-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Card Header with Title and Price */
.rpc-kit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.rpc-kit-card-info {
    flex: 1;
    min-width: 0;
}

.rpc-kit-card-title {
    color: var(--rpc-kit-text);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.rpc-kit-card-description {
    color: var(--rpc-kit-text-muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.rpc-kit-card-price {
    flex-shrink: 0;
}

.rpc-kit-price-value {
    color: var(--rpc-kit-accent);
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

/* Size Selection */
.rpc-kit-sizes {
    margin-bottom: 16px;
}

.rpc-kit-sizes-label {
    display: block;
    color: var(--rpc-kit-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rpc-kit-sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rpc-kit-size-pill {
    background: transparent;
    color: var(--rpc-kit-text);
    border: 1px solid var(--rpc-kit-border);
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rpc-kit-size-pill:hover {
    border-color: var(--rpc-kit-accent);
    color: var(--rpc-kit-accent);
}

.rpc-kit-size-pill.rpc-kit-size-selected {
    background: var(--rpc-kit-accent);
    color: #0a1628;
    border-color: var(--rpc-kit-accent);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.rpc-kit-size-pill:focus {
    outline: 2px solid var(--rpc-kit-accent);
    outline-offset: 2px;
}

/* Size Error */
.rpc-kit-size-error {
    color: #ff4444;
    font-size: 0.8125rem;
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: var(--rpc-kit-radius-sm);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Buy Button */
.rpc-kit-buy-btn {
    width: 100%;
    margin-top: auto;
    padding: 14px 24px;
    background: transparent;
    color: var(--rpc-kit-accent);
    border: 2px solid var(--rpc-kit-accent);
    border-radius: var(--rpc-kit-radius-sm);
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.rpc-kit-buy-btn:hover {
    background: var(--rpc-kit-accent);
    color: #0a1628;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    transform: translateY(-1px);
}

.rpc-kit-buy-btn:active {
    transform: translateY(0);
}

.rpc-kit-buy-btn:focus {
    outline: 2px solid var(--rpc-kit-accent);
    outline-offset: 2px;
}

/* Empty State */
.rpc-kit-shop-empty {
    color: var(--rpc-kit-text-muted);
    text-align: center;
    padding: 60px 20px;
    font-size: 1.125rem;
}

/* Animation for cards */
@keyframes rpc-kit-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rpc-kit-card {
    animation: rpc-kit-fade-in 0.5s ease forwards;
}

.rpc-kit-card:nth-child(1) { animation-delay: 0.1s; }
.rpc-kit-card:nth-child(2) { animation-delay: 0.15s; }
.rpc-kit-card:nth-child(3) { animation-delay: 0.2s; }
.rpc-kit-card:nth-child(4) { animation-delay: 0.25s; }
.rpc-kit-card:nth-child(5) { animation-delay: 0.3s; }
.rpc-kit-card:nth-child(6) { animation-delay: 0.35s; }
.rpc-kit-card:nth-child(n+7) { animation-delay: 0.4s; }

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .rpc-kit-card,
    .rpc-kit-card-image img,
    .rpc-kit-buy-btn,
    .rpc-kit-size-pill {
        transition: none;
        animation: none;
    }
}

/* High Contrast Mode adjustments */
@media (forced-colors: active) {
    .rpc-kit-card {
        border: 2px solid CanvasText;
    }

    .rpc-kit-popular-badge {
        forced-color-adjust: none;
    }

    .rpc-kit-buy-btn {
        border: 2px solid ButtonText;
    }
}

