From dd841dc6d660508cd7be28973040582326517f7a Mon Sep 17 00:00:00 2001 From: Ermin Zoronjic Date: Thu, 7 May 2026 03:32:54 +0200 Subject: [PATCH] add spacing and responsive changes --- .../src/components/ProductDetailPage.css | 31 +++-- .../src/components/ProductDetailPage.jsx | 28 ++++- .../src/components/ProductTransition.jsx | 9 +- parfum-shop/src/components/StickyBuyBar.css | 110 ++++++++++++++++++ parfum-shop/src/components/StickyBuyBar.jsx | 71 +++++++++++ parfum-shop/src/pages/DiscoverySetPage.css | 101 ++++++++-------- parfum-shop/src/pages/DiscoverySetPage.jsx | 42 +++---- parfum-shop/src/pages/LandingPage.css | 17 ++- 8 files changed, 316 insertions(+), 93 deletions(-) create mode 100644 parfum-shop/src/components/StickyBuyBar.css create mode 100644 parfum-shop/src/components/StickyBuyBar.jsx diff --git a/parfum-shop/src/components/ProductDetailPage.css b/parfum-shop/src/components/ProductDetailPage.css index c99b485..6a5277c 100644 --- a/parfum-shop/src/components/ProductDetailPage.css +++ b/parfum-shop/src/components/ProductDetailPage.css @@ -933,6 +933,10 @@ } @media (max-width: 1023px) { + .detail-page { + padding-bottom: 4.5rem; + } + .product-hero { grid-template-columns: 1fr; align-content: start; @@ -974,11 +978,11 @@ grid-column: auto; grid-row: auto; min-height: 0; - height: clamp(18rem, 48svh, 32rem); + height: clamp(22rem, 50svh, 34rem); } .product-hero-image { - width: min(74%, 460px); + width: 100%; max-height: 100%; } @@ -1035,6 +1039,7 @@ @media (max-width: 760px) { .detail-page { padding: 0; + padding-bottom: 4.5rem; } .product-hero { @@ -1053,12 +1058,13 @@ } .product-hero-visual { - height: clamp(13rem, 32svh, 18rem); + height: clamp(22rem, 50svh, 32rem); min-height: 0; } .product-hero-image { - width: min(68%, 280px); + width: 100%; + max-height: 100%; } .character-facts, @@ -1125,8 +1131,7 @@ } .product-purchase-panel { - min-width: 0; - gap: var(--gap-2xs); + display: none; } .purchase-price-row { @@ -1140,18 +1145,18 @@ .size-card { min-width: 0; - min-height: 70px; - gap: 0.2rem; - padding: 0.6rem 0.7rem; + min-height: 56px; + gap: 0.15rem; + padding: 0.5rem 0.6rem; } .size-title { - font-size: 0.66rem; + font-size: 0.64rem; letter-spacing: 0.14em; } .size-card strong { - font-size: 0.98rem; + font-size: 0.92rem; white-space: normal; overflow-wrap: anywhere; } @@ -1167,6 +1172,10 @@ font-size: 0.72rem; } + .purchase-actions .restock-button { + display: none; + } + .purchase-discovery-note, .reviews-heading, .recommendation-heading { diff --git a/parfum-shop/src/components/ProductDetailPage.jsx b/parfum-shop/src/components/ProductDetailPage.jsx index be9c5b3..0167a9a 100644 --- a/parfum-shop/src/components/ProductDetailPage.jsx +++ b/parfum-shop/src/components/ProductDetailPage.jsx @@ -1,8 +1,9 @@ -import { useEffect, useMemo, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import { Link, useParams } from "react-router"; import perfumes from "../data/perfumes"; import SharedNavbar from "./SharedNavbar"; import PageMeta from "./seo/PageMeta"; +import StickyBuyBar from "./StickyBuyBar"; import { useProductTransition } from "../transitions/ProductTransitionContext"; import { useShop } from "../shop/useShop"; import { formatChf } from "../shop/money"; @@ -73,6 +74,7 @@ function ProductPurchasePanel({ discountPreviewCents, addToCart, subscribeToProduct, + panelRef, }) { const selectedProductId = `${perfume.slug}-${selectedSize === "sample" ? "sample" : "full"}`; const selectedProductLabel = selectedSize === "sample" ? "Probe" : "50 ml Flakon"; @@ -92,7 +94,7 @@ function ProductPurchasePanel({ ]; return ( -