/* WP Rise Products List specific styling */

.wp-rise-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--wp-rise-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.wp-rise-tabs::-webkit-scrollbar {
    display: none;
}

.wp-rise-tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--wp-rise-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.wp-rise-tab-btn:hover {
    color: var(--wp-rise-primary);
}

.wp-rise-tab-btn.active {
    color: var(--wp-rise-primary);
    border-bottom-color: var(--wp-rise-primary);
}

.wp-rise-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    max-height: 540px;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--wp-rise-border) transparent;
}

.wp-rise-standalone-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    max-height: none;
    gap: 20px;
    padding: 10px 0;
}

.wp-rise-products-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.wp-rise-products-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.1vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: #111827;
}

.wp-rise-products-intro {
    margin: 0 auto 20px;
    max-width: 760px;
    color: #4b5563;
    font-size: 1rem;
    text-align: center;
    line-height: 1.6;
}

.wp-rise-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.wp-rise-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    border-color: #c7d2fe;
}

.wp-rise-product-media {
    background: #f8fafc;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

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

.wp-rise-product-card:hover img {
    transform: scale(1.035);
}

.wp-rise-product-placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.wp-rise-product-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wp-rise-product-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4f46e5;
    font-weight: 700;
}

.wp-rise-product-info h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #111827;
    line-height: 1.35;
    font-weight: 650;
    min-height: 2.7em;
}

.wp-rise-product-description {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.wp-rise-product-info .price {
    margin: 2px 0 0;
    font-weight: 800;
    color: #0f766e;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.wp-rise-product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.wp-rise-product-actions button,
.wp-rise-product-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    text-align: center;
    border: 1px solid transparent;
}

.wp-rise-view-product-btn {
    background: #f8fafc;
    color: #334155;
    border-color: #dbe3ee;
    grid-column: span 2;
}

.wp-rise-view-product-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.wp-rise-action-primary {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

.wp-rise-action-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
}

.wp-rise-action-secondary {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.wp-rise-action-secondary:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.wp-rise-action-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.wp-rise-action-danger:hover {
    background: #fecaca !important;
    border-color: #f87171 !important;
}

.wp-rise-action-full {
    grid-column: span 2;
}

.wp-rise-add-to-cart-btn,
.wp-rise-purchase-product-btn {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.wp-rise-quick-donate-btn {
    background: #fff7ed;
    color: #b45309;
    border-color: #fed7aa;
}

.wp-rise-purchase-product-btn {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.wp-rise-product-card.in-cart {
    border-color: #10b981;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.16);
}

.wp-rise-product-card.in-cart::after {
    content: '✓ In Cart';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #059669;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
}

.wp-rise-product-card.out-of-stock {
    opacity: 0.78;
}

.wp-rise-product-card.out-of-stock img,
.wp-rise-product-card.out-of-stock .wp-rise-product-placeholder {
    filter: grayscale(100%);
    opacity: 0.62;
}

.wp-rise-products-header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}

.wp-rise-currency-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-rise-currency-toggle {
    display: flex;
    gap: 6px;
}

.wp-rise-currency-btn {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.wp-rise-currency-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.wp-rise-category-select {
    min-height: 40px;
    min-width: 200px;
    padding: 8px 34px 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23334155%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.wp-rise-category-select:focus,
.wp-rise-category-select:hover {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wp-rise-cart-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-rise-stock-indicator {
    margin: 4px 0 2px;
}

.wp-rise-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    line-height: 1.3;
}

.wp-rise-stock-badge.in-stock {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.wp-rise-stock-badge.low-stock {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.wp-rise-stock-badge.out-of-stock {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.wp-rise-quote-actions-row {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: span 2;
}

.wp-rise-product-actions button:disabled,
.wp-rise-product-actions a[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

@media (max-width: 900px) {
    .wp-rise-standalone-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .wp-rise-products-header-top {
        justify-content: center;
        text-align: center;
    }

    .wp-rise-products-intro {
        font-size: 0.95rem;
    }

    .wp-rise-standalone-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 520px) {
    .wp-rise-standalone-grid {
        grid-template-columns: 1fr;
    }

    .wp-rise-product-actions {
        grid-template-columns: 1fr;
    }

    .wp-rise-view-product-btn,
    .wp-rise-quote-actions-row,
    .wp-rise-action-full {
        grid-column: span 1;
    }

    .wp-rise-category-select {
        min-width: 170px;
    }
}