body {
    background: #f5f6fa;
}

body,
button,
input,
select,
textarea {
    letter-spacing: 0;
}

a,
button,
.btn,
.form-control,
.form-select,
.form-check-input {
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

.skip-link {
    background: #fff;
    border: 2px solid #212529;
    border-radius: 4px;
    color: #212529;
    font-weight: 700;
    left: 0.75rem;
    padding: 0.5rem 0.75rem;
    position: absolute;
    top: 0.75rem;
    transform: translateY(-150%);
    z-index: 1100;
}

.skip-link:focus {
    transform: translateY(0);
}

.app-main {
    margin-top: 1.5rem;
}

.app-nav {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    padding-top: 0.75rem;
}

.app-nav-top {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.app-logo-link {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    max-width: min(46vw, 230px);
    padding-bottom: 0;
    padding-top: 0;
}

.app-logo {
    background: #fff;
    border-radius: 6px;
    display: block;
    height: 64px;
    max-width: 100%;
    object-fit: contain;
    padding: 0.2rem;
    width: auto;
}

.app-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.nav-category-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scroll-padding-inline: 0.75rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.nav-category-strip::after {
    content: "";
    flex: 0 0 0.25rem;
}

.nav-category-link {
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 6px;
    color: #f8f9fa;
    flex: 0 0 auto;
    font-size: 0.9rem;
    min-height: 40px;
    padding: 0.45rem 0.75rem;
    scroll-snap-align: start;
    text-decoration: none;
}

.nav-category-link:hover,
.nav-category-link.active {
    background: #f8f9fa;
    color: #212529;
}

.btn,
.form-control,
.form-select {
    min-height: 40px;
}

.form-check-input {
    min-height: 1.15rem;
    min-width: 1.15rem;
}

.form-check-label {
    line-height: 1.45;
}

.footer-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: center;
    text-align: center;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

.messages-stack {
    margin-bottom: 1rem;
}

.messages-stack .alert {
    border-radius: 8px;
    overflow-wrap: anywhere;
}

.empty-state {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.5rem;
    text-align: center;
}

.catalog-page {
    margin-top: 1rem;
}

.catalog-header {
    margin-bottom: 1.5rem;
}

.home-page {
    margin-top: 1rem;
}

.home-hero {
    align-items: stretch;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
}

.home-hero-copy {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

.home-eyebrow {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.home-hero h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.home-lead {
    color: #495057;
    font-size: 1.05rem;
    line-height: 1.65;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.home-hero-products {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-product-tile {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: #212529;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    padding: 0.75rem;
    text-decoration: none;
}

.home-product-tile:first-child {
    grid-row: span 2;
}

.home-product-tile img,
.home-product-placeholder {
    aspect-ratio: 1 / 1;
    background: #e9ecef;
    border-radius: 6px;
    object-fit: contain;
    width: 100%;
}

.home-product-tile span {
    font-weight: 700;
    line-height: 1.3;
}

.home-product-tile-empty {
    grid-column: 1 / -1;
}

.home-section {
    margin-top: 2rem;
}

.home-section-header {
    margin-bottom: 1rem;
}

.home-category-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.home-category-link {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: #212529;
    font-weight: 700;
    min-height: 48px;
    padding: 1rem;
    text-decoration: none;
}

.product-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: 0.2s;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 10px 24px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #eee;
    padding: 10px;
}

.product-image-placeholder {
    background: #e9ecef;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    padding: 1rem;
}

.product-card-title {
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.product-card-description {
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

.product-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.product-meta-row span {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.3rem 0.45rem;
}

.product-detail-meta {
    margin-top: 0.75rem;
}

.product-card-footer {
    margin-top: auto;
}

.product-card-footer .btn {
    white-space: normal;
}

.price {
    font-weight: bold;
    margin-bottom: 12px;
}

.price-original {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 600;
    margin-right: 0.45rem;
    text-decoration: line-through;
}

.price-sale {
    color: #b02a37;
    font-size: 1.2rem;
    font-weight: 800;
}

.product-detail-page {
    margin-top: 1rem;
}

.product-detail-layout {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
    align-items: start;
}

.product-detail-media,
.product-detail-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-detail-media {
    padding: 1rem;
}

.product-detail-image {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    object-fit: contain;
    width: 100%;
}

.product-detail-panel {
    padding: 1.25rem;
}

.product-detail-description {
    color: #6c757d;
    margin: 1rem 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.product-detail-price .price-original {
    font-size: 1.05rem;
}

.product-detail-price .price-sale {
    font-size: 1.5rem;
}

.account-page,
.auth-page,
.legal-page {
    margin-top: 1rem;
}

.account-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.account-card,
.auth-card,
.legal-content {
    max-width: 760px;
}

.auth-card,
.legal-content {
    margin-left: auto;
    margin-right: auto;
}

.account-details {
    margin-bottom: 1.5rem;
}

.account-details > div {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
}

.account-details dt {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
}

.account-details dd {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.account-actions form {
    margin: 0;
}

.account-list {
    display: grid;
    gap: 1rem;
    max-width: 860px;
}

.account-list-card {
    border-radius: 8px;
}

.account-list-card-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.account-list-card-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.account-list-meta {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-list-meta span {
    color: #6c757d;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.account-list-meta strong {
    overflow-wrap: anywhere;
}

.account-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.address-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.address-card {
    border-radius: 8px;
}

.address-card-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.address-card-header > div {
    min-width: 0;
}

.address-card-header h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.address-card-body {
    overflow-wrap: anywhere;
}

.address-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.address-card-actions form {
    margin: 0;
}

.address-card-actions .btn-link {
    padding-left: 0;
    padding-right: 0;
    text-decoration: none;
}

.auth-card label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.auth-card input {
    display: block;
    width: 100%;
}

.legal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 1.25rem;
}

.legal-body {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.legal-meta {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1rem 0;
}

.legal-meta > div {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
}

.legal-meta span {
    color: #6c757d;
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
}

.legal-meta strong {
    display: block;
    overflow-wrap: anywhere;
}

.legal-file-button {
    margin-bottom: 1rem;
}

.cart-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.cart-item {
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    gap: 1rem;
    grid-template-columns: 96px 1fr;
    padding: 1rem 0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item-image {
    align-items: center;
    background: #f1f3f5;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 96px;
    overflow: hidden;
}

.cart-item-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.cart-item-image-placeholder {
    background: #dee2e6;
    height: 40px;
    width: 40px;
}

.cart-item-title-row {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.cart-item-title {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.cart-custom-image {
    font-size: 0.88rem;
    margin-top: 0.35rem;
}

.cart-custom-image-link {
    align-items: center;
    color: #495057;
    display: inline-flex;
    gap: 0.55rem;
    max-width: 100%;
    text-decoration: none;
}

.cart-custom-image-link span {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.cart-custom-image-link strong {
    color: #212529;
    font-weight: 600;
}

.cart-custom-image-thumb {
    aspect-ratio: 1;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    flex: 0 0 46px;
    height: 46px;
    object-fit: cover;
    width: 46px;
}

.cart-item-subtotal {
    font-weight: 700;
    white-space: nowrap;
}

.cart-item-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1rem;
}

.quantity-control {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
}

.quantity-button {
    min-height: 40px;
    min-width: 40px;
    padding: 0.35rem 0.75rem;
}

.quantity-value {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
}

.cart-remove-button {
    color: #b02a37;
    padding-left: 0;
    padding-right: 0;
    text-decoration: none;
}

.cart-remove-button:hover {
    color: #842029;
    text-decoration: underline;
}

.cart-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-top: 1.25rem;
}

.cart-total-panel {
    min-width: 280px;
}

.cart-total-row {
    align-items: center;
    display: flex;
    font-size: 1.2rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.checkout-form-card label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.checkout-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.checkout-section-title {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.checkout-radio-list {
    display: grid;
    gap: 0.6rem;
}

.checkout-radio-option {
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 0.65rem;
    margin: 0;
    min-height: 48px;
    padding: 0.75rem;
}

.checkout-radio-option .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.checkout-radio-option .form-check-label {
    line-height: 1.25;
    margin: 0;
}

.checkout-legal-alert {
    border-radius: 8px;
}

.checkout-legal-version {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-legal-version > div {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
}

.checkout-legal-version span,
.checkout-legal-version small {
    color: #6c757d;
    display: block;
    font-size: 0.82rem;
}

.checkout-legal-version strong {
    display: block;
    overflow-wrap: anywhere;
}

.checkout-summary {
    position: sticky;
    top: 1rem;
}

.checkout-summary-item {
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.checkout-summary-item > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.checkout-summary-total {
    align-items: center;
    display: flex;
    font-size: 1.1rem;
    justify-content: space-between;
    padding-top: 1rem;
}

.form-page,
.order-page {
    margin-top: 1rem;
}

.form-card,
.order-card {
    border-radius: 8px;
    margin-left: auto;
    margin-right: auto;
    max-width: 820px;
}

.form-card label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-actions,
.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.order-header {
    margin-bottom: 0.25rem;
}

.order-meta-grid,
.order-address-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1.25rem;
}

.order-meta-grid > div,
.order-address-grid > div {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.order-meta-grid span {
    color: #6c757d;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.order-meta-grid strong,
.order-address-grid p {
    overflow-wrap: anywhere;
}

.order-status-note {
    background: #eef6ff;
    border: 1px solid #cfe2ff;
    border-radius: 8px;
    margin-top: 1.25rem;
    padding: 1rem;
}

.order-status-note p {
    margin-bottom: 0.5rem;
}

.order-communication-note {
    background: #f8f9fa;
    border-color: #e5e7eb;
}

.order-fulfillment-note {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.order-status-history {
    margin-top: 1rem;
}

.status-timeline {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.status-timeline li {
    border-left: 3px solid #212529;
    padding-left: 0.75rem;
}

.status-timeline span {
    color: #6c757d;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-timeline strong {
    display: block;
}

.order-success-meta {
    margin-top: 1.25rem;
}

.order-items-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.order-item-row {
    align-items: flex-start;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem 1rem;
}

.order-item-row:last-child {
    border-bottom: 0;
}

.order-item-price {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.order-total-row {
    align-items: center;
    display: flex;
    font-size: 1.2rem;
    justify-content: space-between;
}

@media (max-width: 991.98px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
    }

    .home-hero {
        grid-template-columns: 1fr;
    }

    .checkout-page {
        padding-bottom: 1rem;
    }

    .checkout-summary {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .app-main {
        margin-top: 1rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-nav-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-logo-link {
        max-width: min(100%, 210px);
    }

    .app-logo {
        height: 56px;
    }

    .app-nav-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .app-nav-actions .btn {
        flex: 1 1 auto;
    }

    .nav-category-strip {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .home-hero h1 {
        font-size: 2rem;
    }

    .home-hero-copy {
        padding: 1.25rem;
    }

    .home-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-actions .btn {
        width: 100%;
    }

    .home-hero-products,
    .home-category-grid {
        grid-template-columns: 1fr;
    }

    .home-product-tile:first-child {
        grid-row: auto;
    }

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

    .product-card-body {
        min-height: 0;
    }

    .product-detail-panel {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .product-detail-media {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding: 0.75rem;
    }

    .product-detail-price {
        font-size: 1.35rem;
    }

    .account-header {
        align-items: stretch;
        flex-direction: column;
    }

    .account-actions .btn,
    .account-header .btn {
        width: 100%;
    }

    .account-list-card-header {
        display: block;
    }

    .account-list-card-header .badge {
        margin-top: 0.5rem;
    }

    .account-list-meta {
        grid-template-columns: 1fr;
    }

    .account-list-actions .btn {
        width: 100%;
    }

    .legal-content {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .empty-state {
        padding: 1.25rem 1rem;
    }

    .empty-state .btn {
        width: 100%;
    }

    .cart-header {
        align-items: stretch;
        flex-direction: column;
    }

    .cart-header .btn {
        width: 100%;
    }

    .cart-item {
        grid-template-columns: 72px 1fr;
    }

    .cart-item-image {
        min-height: 72px;
    }

    .cart-item-title-row {
        display: block;
    }

    .cart-item-subtotal {
        margin-top: 0.5rem;
    }

    .cart-item-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .quantity-control {
        width: 100%;
    }

    .quantity-control form {
        flex: 0 0 44px;
    }

    .quantity-button {
        width: 44px;
    }

    .quantity-value {
        flex: 1 1 auto;
    }

    .cart-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .cart-total-panel {
        min-width: 0;
        width: 100%;
    }

    .checkout-page {
        margin-top: 1rem !important;
    }

    .checkout-summary-item,
    .checkout-summary-total {
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
    }

    .checkout-summary-item .text-end {
        text-align: left !important;
    }

    .form-actions,
    .order-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions .btn,
    .order-actions .btn {
        width: 100%;
    }

    .order-meta-grid,
    .order-address-grid,
    .checkout-legal-version,
    .legal-meta {
        grid-template-columns: 1fr;
    }

    .order-item-row,
    .order-total-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
    }

    .order-item-price {
        text-align: left;
        white-space: normal;
    }
}
