/**
 * USA Product Card CSS - V2-style Component
 * Matches V2's exact class names and structure
 */

/* ==========================================================================
   Products Grid - Mobile First
   ========================================================================== */

.products-container {
    width: 100%;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 480px) {
    .products-grid {
        gap: 12px;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1536px) {
    .products-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Product Card - Dark Theme
   ========================================================================== */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.product-card:hover {
    border-color: rgba(147, 51, 234, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(147, 51, 234, 0.08);
    transform: translateY(-2px);
}

/* Product Card Link */
.product-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

/* Product Image Container */
.product-card-image {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Corner Ribbons (top-right, stacked) */
.product-card-ribbons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 5;
}

.ribbon {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 6px;
    white-space: nowrap;
}

.ribbon-agotado {
    background: rgba(0, 0, 0, 0.75);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Darken overlay for out of stock */
.product-card-darken {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
}

/* No image placeholder */
.product-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==========================================================================
   Product Card Body
   ========================================================================== */

.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
}

/* Brand */
.product-card-brand {
    font-size: 0.7rem;
    font-weight: 500;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 2px 0;
}

/* Product Name */
.product-card-name {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    margin: 0 0 4px 0;
    text-transform: capitalize;
}

/* Product Meta (Size, Concentration) */
.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.product-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    border-radius: 6px;
}

.product-card-meta-item svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Stock Status */
.product-card-stock {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.product-card-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-card-stock.in-stock .product-card-stock-dot {
    background: #22c55e;
}

.product-card-stock.low-stock .product-card-stock-dot {
    background: #eab308;
}

.product-card-stock.out-of-stock .product-card-stock-dot {
    background: #ef4444;
}

/* ==========================================================================
   Price Section
   ========================================================================== */

.product-card-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-top: auto;
    margin-bottom: 4px;
}

.product-card-price-current {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.product-card-price-current .currency {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.product-card-price-original {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}

.product-card-price-savings {
    font-size: 0.65rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 6px;
    border-radius: 6px;
}

/* ==========================================================================
   Add to Cart Button
   ========================================================================== */

.product-card-actions {
    margin-top: auto;
}

.product-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.product-card-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        270deg,
        #a855f7,
        #7c3aed,
        #d4a853,
        #a855f7
    );
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.product-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
}

.product-card-btn:active {
    transform: translateY(0);
}

.product-card-btn.loading::before {
    opacity: 1;
    animation: btn-loading-wave 2s linear infinite;
}

@keyframes btn-loading-wave {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.product-card-btn.success {
    background: #22c55e;
}

.product-card-btn.success::before {
    display: none;
}

.product-card-btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card-btn svg {
    width: 18px;
    height: 18px;
}

.product-card-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.product-card-btn.disabled::before {
    display: none;
}

.product-card-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.products-empty-icon {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

.products-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.products-empty-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
