diff --git a/src/App.css b/src/App.css index 6cd2f7c..b164416 100644 --- a/src/App.css +++ b/src/App.css @@ -6,6 +6,227 @@ flex: 1; } +.products-page, +.product-details { + max-width: 1100px; + margin: 0 auto; + padding: 4rem 1.5rem; +} + +.products-hero { + max-width: 620px; + margin-bottom: 3rem; +} + +.eyebrow, +.product-category { + color: #726fc1; + font-size: 0.75rem; + font-weight: 700; + letter-spacing: 0.1em; + text-transform: uppercase; +} + +.products-hero h1 { + margin: 0.5rem 0 1rem; + color: #213547; + font-size: clamp(2.25rem, 5vw, 4rem); + letter-spacing: -0.05em; + line-height: 1; +} + +.products-hero > p:last-child { + color: #666; + font-size: 1.1rem; +} + +.product-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: 1.25rem; +} + +.product-card { + display: flex; + flex-direction: column; + overflow: hidden; + border: 1px solid #e7e7ed; + border-radius: 14px; + color: inherit; + text-decoration: none; + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.product-card:hover { + box-shadow: 0 12px 30px rgba(33, 53, 71, 0.12); + transform: translateY(-4px); +} + +.product-card-image { + display: grid; + height: 220px; + place-items: center; + padding: 1.5rem; + background: #fafafe; +} + +.product-card-image img { + width: 100%; + height: 100%; + object-fit: contain; +} + +.product-card-content { + display: flex; + flex: 1; + flex-direction: column; + padding: 1.25rem; +} + +.product-card .product-category { + margin: 0 0 0.6rem; + font-size: 0.65rem; +} + +.product-card h2 { + margin: 0; + color: #213547; + font-size: 1rem; + line-height: 1.35; +} + +.product-price, +.product-details-price { + color: #213547; + font-size: 1.25rem; + font-weight: 700; +} + +.view-product { + margin-top: auto; + padding-top: 1.25rem; + color: #726fc1; + font-size: 0.9rem; + font-weight: 700; +} + +.products-message { + padding: 2rem; + border: 1px solid #f0caca; + border-radius: 10px; + color: #a33; + text-align: center; +} + +.back-link { + display: inline-block; + margin-bottom: 2rem; + color: #726fc1; + font-weight: 700; + text-decoration: none; +} + +.product-details-card { + display: grid; + grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr); + gap: clamp(2rem, 6vw, 6rem); + align-items: center; +} + +.product-details-image { + display: grid; + min-height: 430px; + place-items: center; + padding: 3rem; + border-radius: 18px; + background: #fafafe; +} + +.product-details-image img { + width: 100%; + max-height: 390px; + object-fit: contain; +} + +.product-details-content h1 { + margin: 0.5rem 0 1rem; + color: #213547; + font-size: clamp(2rem, 4vw, 3.25rem); + letter-spacing: -0.04em; + line-height: 1.05; +} + +.product-details-price { + margin: 0 0 1.5rem; + font-size: 1.75rem; +} + +.product-description { + color: #5e6268; + line-height: 1.7; +} + +.product-rating { + display: flex; + gap: 1rem; + margin: 1.5rem 0; + color: #666; + font-size: 0.9rem; +} + +.product-rating span:first-child { + color: #b47b00; + font-weight: 700; +} + +.add-to-cart-button { + width: 100%; + padding: 0.95rem 1.25rem; + border: 0; + border-radius: 8px; + background: #726fc1; + color: #fff; + cursor: pointer; + font: inherit; + font-weight: 700; + transition: background 0.2s ease; +} + +.add-to-cart-button:hover { + background: #5e5ba8; +} + +.product-details-error { + text-align: center; +} + +.product-details-error h1 { + color: #213547; +} + +html[data-theme="dark"] .products-hero h1, +html[data-theme="dark"] .product-card h2, +html[data-theme="dark"] .product-details-content h1, +html[data-theme="dark"] .product-details-error h1, +html[data-theme="dark"] .product-price, +html[data-theme="dark"] .product-details-price { + color: #dbe8f2; +} + +html[data-theme="dark"] .products-hero > p:last-child, +html[data-theme="dark"] .product-description { + color: #b9c4ce; +} + +html[data-theme="dark"] .product-card { + border-color: #2b3340; +} + +html[data-theme="dark"] .product-card-image, +html[data-theme="dark"] .product-details-image { + background: #10151c; +} + .welcome h1 { font-size: 2rem; margin-bottom: 1rem; @@ -341,6 +562,21 @@ html[data-theme="dark"] .mobile-link { padding: 2rem 1rem; } + .products-page, + .product-details { + padding: 2.5rem 1rem; + } + + .product-details-card { + grid-template-columns: 1fr; + gap: 2rem; + } + + .product-details-image { + min-height: 300px; + padding: 2rem; + } + .welcome h1 { font-size: 1.6rem; } diff --git a/src/App.jsx b/src/App.jsx index 2db0f85..7db02e3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,9 +1,10 @@ -import Welcome from "./components/Welcome.jsx"; import "./App.css"; import { Route, Routes } from "react-router-dom"; import ErrorPage from "./components/ErrorPage.jsx"; import Footer from "./components/Footer.jsx"; import Navbar from "./components/Navbar.jsx"; +import ProductDetails from "./components/ProductDetails.jsx"; +import ProductList from "./components/ProductList.jsx"; function App() { return ( @@ -14,13 +15,12 @@ function App() { path="/" element={ <> -
- -
+