diff --git a/assets/css/shop/components.css b/assets/css/shop/components.css index 1873b4c..d6c6c9f 100644 --- a/assets/css/shop/components.css +++ b/assets/css/shop/components.css @@ -324,4 +324,549 @@ .details-subheading { color: var(--t-text-primary); } + + /* ── Announcement bar ── */ + + .announcement-bar { + background-color: var(--t-accent-button, hsl(var(--t-accent-h) var(--t-accent-s) 42%)); + color: var(--t-text-inverse); + text-align: center; + padding: 0.5rem 1rem; + font-size: var(--t-text-small); + } + + /* ── Shop container (body-level defaults) ── */ + + .shop-container { + background-color: var(--t-surface-base); + font-family: var(--t-font-body); + color: var(--t-text-primary); + } + + /* ── Shop header ── */ + + .shop-header { + background-color: var(--t-surface-raised); + border-bottom: 1px solid var(--t-border-default); + display: flex; + align-items: center; + } + + .shop-logo { + display: flex; + align-items: center; + position: relative; + z-index: 1; + } + + .shop-logo-link { + display: flex; + align-items: center; + text-decoration: none; + } + + .shop-logo-img { + width: auto; + } + + .shop-logo-text { + font-family: var(--t-font-heading); + font-size: var(--t-text-xl); + font-weight: var(--t-heading-weight); + color: var(--t-text-primary); + } + + .shop-nav { + position: relative; + z-index: 1; + } + + .shop-actions { + position: relative; + z-index: 1; + } + + .header-icon-btn { + color: var(--t-text-secondary); + border-radius: var(--t-radius-button); + + &:where(button) { + background: none; + border: none; + cursor: pointer; + } + } + + .cart-badge { + position: absolute; + top: -4px; + right: -4px; + background: hsl(var(--t-accent-h) var(--t-accent-s) var(--t-accent-l)); + color: var(--t-text-inverse); + font-size: var(--t-text-caption); + font-weight: 600; + min-width: 18px; + height: 18px; + border-radius: 9999px; + display: flex; + align-items: center; + justify-content: center; + padding: 0 4px; + } + + /* ── Desktop nav links ── */ + + .nav-link { + color: var(--t-text-secondary); + text-decoration: none; + cursor: pointer; + + &[aria-current="page"] { + color: var(--t-text-primary); + border-bottom-color: hsl(var(--t-accent-h) var(--t-accent-s) var(--t-accent-l)); + } + } + + /* ── Mobile bottom nav ── */ + + .mobile-bottom-nav { + position: fixed; + bottom: 0; + left: 0; + right: 0; + z-index: 100; + background-color: var(--t-surface-raised); + border-top: 1px solid var(--t-border-default); + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); + padding-bottom: env(safe-area-inset-bottom, 0px); + + & ul { + margin: 0; + padding: 0; + list-style: none; + } + } + + .mobile-nav-link { + color: var(--t-text-secondary); + text-decoration: none; + font-weight: 500; + background-color: transparent; + + &[aria-current="page"] { + color: hsl(var(--t-accent-h) var(--t-accent-s) calc(var(--t-accent-l) - 15%)); + font-weight: 600; + background-color: hsl(var(--t-accent-h) var(--t-accent-s) var(--t-accent-l) / 0.1); + } + } + + /* ── Search modal ── */ + + .search-modal { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 1001; + align-items: flex-start; + justify-content: center; + padding-top: 10vh; + } + + .search-panel { + background: var(--t-surface-raised); + border-radius: var(--t-radius-card); + overflow: hidden; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + } + + .search-bar { + border-bottom: 1px solid var(--t-border-default); + } + + .search-icon { + color: var(--t-text-tertiary); + } + + .search-input { + font-family: var(--t-font-body); + color: var(--t-text-primary); + } + + .search-kbd { + color: var(--t-text-tertiary); + border: 1px solid var(--t-border-default); + } + + .search-close { + color: var(--t-text-tertiary); + background: none; + border: none; + cursor: pointer; + border-radius: var(--t-radius-button); + } + + .search-results { + max-height: 60vh; + overflow-y: auto; + } + + .search-result { + text-decoration: none; + color: inherit; + + &:hover { + background: var(--t-surface-sunken); + } + } + + .search-result-thumb { + background: var(--t-surface-sunken); + } + + .search-result-title { + color: var(--t-text-primary); + } + + .search-result-meta { + color: var(--t-text-tertiary); + } + + .search-hint { + color: var(--t-text-tertiary); + } + + /* ── Shop footer ── */ + + .shop-footer { + background-color: var(--t-surface-raised); + border-top: 1px solid var(--t-border-default); + } + + .footer-heading { + font-family: var(--t-font-heading); + color: var(--t-text-primary); + } + + .footer-link { + color: var(--t-text-secondary); + cursor: pointer; + } + + .footer-bottom { + border-top: 1px solid var(--t-border-subtle); + } + + .footer-copyright { + color: var(--t-text-tertiary); + } + + /* ── Cart drawer ── */ + + .cart-drawer-overlay { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.4); + z-index: 999; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease; + } + + .cart-drawer { + position: fixed; + top: 0; + right: -400px; + width: 400px; + max-width: 90vw; + height: 100vh; + height: 100dvh; + background: var(--t-surface-raised); + z-index: 1001; + display: flex; + flex-direction: column; + transition: right 0.3s ease; + box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15); + } + + .cart-drawer-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 1rem 1.5rem; + border-bottom: 1px solid var(--t-border-default); + } + + .cart-drawer-title { + font-family: var(--t-font-heading); + font-weight: var(--t-heading-weight); + font-size: var(--t-text-large); + color: var(--t-text-primary); + margin: 0; + } + + .cart-drawer-close { + background: none; + border: none; + padding: 0.5rem; + cursor: pointer; + color: var(--t-text-secondary); + } + + .cart-drawer-items { + flex: 1; + overflow-y: auto; + padding: 1rem; + + & ul { + list-style: none; + margin: 0; + padding: 0; + } + + & li { + border-bottom: 1px solid var(--t-border-default); + } + } + + .cart-drawer-footer { + padding: 1rem 1.5rem; + border-top: 1px solid var(--t-border-default); + background: var(--t-surface-sunken); + } + + .cart-drawer-total { + display: flex; + justify-content: space-between; + font-family: var(--t-font-body); + font-size: var(--t-text-base); + font-weight: 600; + color: var(--t-text-primary); + margin-bottom: 1rem; + } + + .cart-drawer-checkout { + width: 100%; + padding: 0.75rem 1.5rem; + font-weight: 600; + transition: all 0.2s ease; + background: var(--t-accent-button, hsl(var(--t-accent-h) var(--t-accent-s) 42%)); + color: var(--t-text-inverse); + border-radius: var(--t-radius-button); + border: none; + cursor: pointer; + font-family: var(--t-font-body); + } + + /* ── Cart item row ── */ + + .cart-item-row { + display: flex; + gap: 1rem; + padding: 0.75rem 0; + + &[data-size="compact"] { + gap: 0.75rem; + } + } + + .cart-item-image { + display: block; + border-radius: var(--t-radius-card); + background-size: cover; + background-position: center; + flex-shrink: 0; + width: 80px; + height: 80px; + + &[data-size="compact"] { + width: 60px; + height: 60px; + } + } + + .cart-item-image--empty { + background-color: var(--t-surface-sunken); + } + + .cart-item-details { + flex: 1; + min-width: 0; + } + + .cart-item-name { + font-family: var(--t-font-body); + font-size: var(--t-text-base); + font-weight: 500; + margin: 0 0 2px; + + &[data-size="compact"] { + font-size: var(--t-text-small); + } + + & span { + color: var(--t-text-primary); + } + } + + .cart-item-name-link { + color: var(--t-text-primary); + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } + + .cart-item-variant-text { + font-family: var(--t-font-body); + font-size: var(--t-text-caption); + color: var(--t-text-tertiary); + margin: 0; + } + + .cart-item-actions { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 4px; + flex-wrap: wrap; + gap: 0.5rem; + } + + .cart-qty-group { + border: 1px solid var(--t-border-default); + border-radius: var(--t-radius-input); + } + + .cart-qty-btn { + background: none; + border: none; + cursor: pointer; + color: var(--t-text-primary); + } + + .cart-qty-display { + border-color: var(--t-border-default); + color: var(--t-text-primary); + min-width: 2rem; + text-align: center; + } + + .cart-qty-text { + font-size: var(--t-text-caption); + color: var(--t-text-tertiary); + } + + .cart-item-price-col { + flex-shrink: 0; + } + + .cart-item-price { + font-weight: 500; + font-size: var(--t-text-base); + color: var(--t-text-primary); + margin: 0; + + &[data-size="compact"] { + font-size: var(--t-text-small); + } + } + + .cart-remove-btn { + background: none; + border: none; + padding: 0; + cursor: pointer; + font-family: var(--t-font-body); + font-size: var(--t-text-caption); + color: var(--t-text-tertiary); + text-decoration: underline; + } + + /* ── Cart empty state ── */ + + .cart-empty { + color: var(--t-text-secondary); + } + + .cart-empty-icon { + color: var(--t-text-tertiary); + } + + .cart-continue-link { + color: var(--t-text-accent); + text-decoration: underline; + + &:where(button) { + background: none; + border: none; + cursor: pointer; + } + } + + /* ── Cart page item (full size) ── */ + + .cart-page-image { + border-radius: var(--t-radius-image); + } + + .cart-page-item-name { + font-family: var(--t-font-heading); + color: var(--t-text-primary); + } + + .cart-page-item-variant { + color: var(--t-text-secondary); + } + + .cart-page-item-remove { + color: var(--t-text-tertiary); + } + + .cart-page-item-price { + color: var(--t-text-primary); + } + + /* ── Delivery line ── */ + + .delivery-line { + font-family: var(--t-font-body); + font-size: var(--t-text-small); + color: var(--t-text-secondary); + + & form { + display: inline; + } + } + + .delivery-select { + appearance: auto; + background: transparent; + border: none; + color: inherit; + font: inherit; + padding: 0; + cursor: pointer; + text-decoration: underline; + text-underline-offset: 2px; + } + + /* ── Order summary ── */ + + .order-summary-heading { + font-family: var(--t-font-heading); + color: var(--t-text-primary); + } + + .order-summary-label { + color: var(--t-text-secondary); + } + + .order-summary-value { + color: var(--t-text-primary); + } + + .order-summary-divider { + border-color: var(--t-border-default); + } } diff --git a/assets/css/theme-semantic.css b/assets/css/theme-semantic.css index 80a1fda..8762e43 100644 --- a/assets/css/theme-semantic.css +++ b/assets/css/theme-semantic.css @@ -312,8 +312,7 @@ color: var(--t-text-primary); } -.shop-nav a[aria-current="page"], -.shop-nav span[aria-current="page"] { - color: var(--t-text-primary); +/* Active nav underline — must stay unlayered to match the base border above */ +.shop-nav [aria-current="page"] { border-bottom-color: hsl(var(--t-accent-h) var(--t-accent-s) var(--t-accent-l)); } diff --git a/lib/simpleshop_theme_web/components/shop_components/cart.ex b/lib/simpleshop_theme_web/components/shop_components/cart.ex index b946b74..c76fea7 100644 --- a/lib/simpleshop_theme_web/components/shop_components/cart.ex +++ b/lib/simpleshop_theme_web/components/shop_components/cart.ex @@ -60,7 +60,6 @@ defmodule SimpleshopThemeWeb.ShopComponents.Cart do id="cart-drawer-overlay" class={["cart-drawer-overlay", @open && "open"]} aria-hidden={to_string(!@open)} - style="position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;" phx-click={close_cart_drawer_js()} > @@ -75,25 +74,20 @@ defmodule SimpleshopThemeWeb.ShopComponents.Cart do aria-hidden={to_string(!@open)} phx-hook="CartDrawer" class={["cart-drawer", @open && "open"]} - style="position: fixed; top: 0; right: -400px; width: 400px; max-width: 90vw; height: 100vh; height: 100dvh; background: var(--t-surface-raised); z-index: 1001; display: flex; flex-direction: column; transition: right 0.3s ease; box-shadow: -4px 0 20px rgba(0,0,0,0.15);" >
Shopping basket with {@cart_count} {if @cart_count == 1, do: "item", else: "items"}. Press Escape to close.
-