Files
marketplaces/src/app/pages/search/search.component.scss
2026-02-14 02:34:11 +04:00

331 lines
5.6 KiB
SCSS

.search-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.search-header {
margin-bottom: 40px;
h1 {
font-size: 2rem;
margin-bottom: 20px;
color: #1e3c38;
text-align: center;
}
}
.search-box {
position: relative;
max-width: 600px;
margin: 0 auto;
.search-input {
width: 100%;
padding: 16px 50px 16px 20px;
font-size: 1.1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
border: 2px solid #d3dad9;
border-radius: 13px;
outline: none;
transition: border-color 0.2s;
&:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(73, 118, 113, 0.1);
}
}
.search-icon {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
pointer-events: none;
}
}
.results-count {
text-align: center;
margin-bottom: 24px;
color: #1e3c38;
font-size: 1.1rem;
}
.empty-state,
.no-results,
.loading-initial {
text-align: center;
padding: 60px 20px;
color: #697777;
}
.no-results {
.no-results-icon {
margin-bottom: 20px;
opacity: 0.5;
display: flex;
justify-content: center;
}
h2 {
font-size: 1.5rem;
color: #1e3c38;
margin-bottom: 12px;
}
p {
margin: 8px 0;
color: #697777;
}
.hint {
font-size: 0.9rem;
color: #a1b4b5;
margin-top: 16px;
}
}
.error {
text-align: center;
padding: 60px 20px;
button {
margin-top: 20px;
padding: 10px 24px;
background: var(--primary-color);
color: white;
border: none;
border-radius: 13px;
cursor: pointer;
font-size: 1rem;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
&:hover {
background: var(--primary-hover);
}
}
}
.items-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 24px;
margin-bottom: 40px;
}
.item-card {
background: white;
border-radius: 13px;
border: 1px solid #d3dad9;
box-shadow: 0 3px 4px rgba(0, 0, 0, 0.08);
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
display: flex;
flex-direction: column;
&:hover {
transform: translateY(-4px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
}
.item-link {
text-decoration: none;
color: inherit;
flex: 1;
display: flex;
flex-direction: column;
}
.item-image {
position: relative;
width: 100%;
padding-top: 75%;
background: #f5f5f5;
overflow: hidden;
border-radius: 13px;
img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
background: white;
padding: 12px;
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
filter: drop-shadow(0 2px 6px rgba(0,0,0,0.06));
}
&:hover img {
transform: scale(1.06) translateY(-2px);
filter: drop-shadow(0 12px 24px rgba(0,0,0,0.15)) brightness(1.03);
}
}
.discount-badge {
position: absolute;
top: 12px;
right: 12px;
background: #ef4444;
color: white;
padding: 6px 12px;
border-radius: 20px;
font-weight: 600;
font-size: 0.9rem;
}
.item-details {
padding: 16px;
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
}
.item-name {
font-size: 1.1rem;
margin: 0;
color: #1e3c38;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.item-rating {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.9rem;
color: #1e3c38;
.rating-stars {
color: #497671;
font-weight: 600;
}
}
.item-price {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
margin-top: auto;
}
.original-price {
text-decoration: line-through;
color: #697777;
font-size: 0.9rem;
}
.discounted-price,
.current-price {
font-size: 1.3rem;
font-weight: 700;
color: var(--primary-color);
}
.item-stock {
.stock-bar {
display: flex;
gap: 4px;
align-items: center;
.bar-segment {
width: 20px;
height: 6px;
background: #d3dad9;
border-radius: 3px;
transition: background 0.2s;
&.filled.high {
background: #2ed573;
}
&.filled.medium {
background: #ffa502;
}
&.filled.low {
background: #ef4444;
}
}
}
}
.add-to-cart-btn {
width: 100%;
padding: 12px;
background: var(--primary-color);
color: white;
border: none;
border-radius: 0 0 13px 13px;
font-size: 1rem;
font-weight: 600;
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
cursor: pointer;
transition: background 0.2s;
&:hover {
background: var(--primary-hover);
}
&:active {
transform: scale(0.98);
}
}
.loading-more {
text-align: center;
padding: 40px 20px;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 12px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.no-more {
color: #697777;
padding: 40px 20px;
text-align: center;
}
@media (max-width: 768px) {
.search-header h1 {
font-size: 1.5rem;
}
.items-grid {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 16px;
}
.item-name {
font-size: 0.95rem;
}
.discounted-price,
.current-price {
font-size: 1.1rem;
}
}