* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(to bottom, #2d2d35, #000);
    color: #f5f5f7;
}

.shop-nav {
    min-height: 60px;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(to bottom, #86efac, #22c55e);
}

.brand img {
    height: 44px;
}

.brand {
    margin-left: 30px;
}

.shop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-shell {
    position: relative;
}

.cart-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 5px;
    padding: 0 4px;
    border-radius: 9px;
    background: #8fd346;
    color: #17210f;
    font-size: 11px;
    line-height: 1;
}

.cart-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    right: 0;
    width: min(400px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-top: 2px solid #8fd346;
    border-radius: 8px;
    background: #242a30;
    box-shadow: 0 16px 38px rgba(0,0,0,0.42);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.cart-shell:hover .cart-popover,
.cart-shell:focus-within .cart-popover,
.cart-shell.is-open .cart-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-popover-heading {
    margin-bottom: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.cart-notice {
    margin-bottom: 10px;
    color: #bef264;
    font-size: 12px;
}

.cart-empty {
    padding: 18px 0;
    color: #b8c0c7;
    text-align: center;
    font-size: 13px;
}

.cart-item-list {
    display: grid;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: start;
    min-height: 82px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: #343c45;
}

.cart-item-image {
    aspect-ratio: 1;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 4px;
    background: #111 center / cover no-repeat;
}

.cart-item-details {
    min-width: 0;
}

.cart-item-details strong,
.cart-item-details > span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cart-item-count {
    display: block;
    margin-top: 7px;
    color: #d5dde2;
    font-size: 12px;
}

.cart-item-details strong {
    color: #fff;
    font-size: 13px;
}

.cart-item-details > span {
    margin-top: 3px;
    color: #9be05a;
    font-size: 12px;
}

.cart-item-quantity {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
}

.cart-item-quantity button,
.cart-remove,
.quantity-control button,
.modal-close {
    border: 0;
    color: #fff;
    background: #20262d;
    cursor: pointer;
}

.cart-item-quantity button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 900;
}

.cart-item-quantity span {
    min-width: 18px;
    color: #fff;
    text-align: center;
    font-size: 12px;
}

.cart-remove {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    align-self: start;
}

.cart-remove-icon {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.cart-remove.has-fallback {
    background: #20262d;
}

.cart-remove.has-fallback .cart-remove-icon {
    display: none;
}

.cart-remove.has-fallback::after {
    content: "\00d7";
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
}

.cart-summary {
    margin: 0 0 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    text-align: right;
    font-weight: 900;
}

.cart-action {
    display: grid;
    width: 100%;
    min-height: 42px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #22c55e;
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.cart-fly-item {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 7px;
    background: #111 center / cover no-repeat;
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    opacity: 1;
    transition: left 0.6s cubic-bezier(0.22, 0.8, 0.24, 1), top 0.6s cubic-bezier(0.22, 0.8, 0.24, 1), width 0.6s ease, height 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
}

.product-modal[hidden] {
    display: none;
}

.product-modal {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 44px 70px;
}

.product-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(8px);
}

.product-modal-panel {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.82fr);
    overflow: visible;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: #242a30;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    z-index: 2;
    top: 0;
    right: -46px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.product-modal-image {
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 7px 0 0 7px;
    background: #101315 center / contain no-repeat;
}

.product-modal-body {
    display: flex;
    flex-direction: column;
    padding: 28px 24px 24px;
    border-radius: 0 7px 7px 0;
}

.product-modal-body h2 {
    margin: 4px 0 8px;
    color: #fff;
    font-size: 21px;
}

.product-modal-body p {
    color: #b8c0c7;
    font-size: 14px;
    line-height: 1.5;
}

.product-modal-body .product-purchase-note {
    margin-top: 16px;
    padding: 11px 12px;
    border-left: 3px solid #22c55e;
    border-radius: 4px;
    background: rgba(34,197,94,0.08);
    color: #d8e7dc;
    font-size: 13px;
    line-height: 1.65;
}

.product-modal-prices {
    display: grid;
    gap: 5px;
    margin: auto 0 16px;
    padding-top: 18px;
}

.product-modal-prices span { color: #d5dde2; }
.product-modal-prices strong { color: #9be05a; }

.quantity-control {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.quantity-control button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 900;
}

.quantity-control span {
    min-width: 22px;
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.add-cart-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: #22c55e;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.shop-actions a,
.shop-actions button,
.category-button,
.view-button {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    background: rgba(255,255,255,0.14);
    text-decoration: none;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
a:hover,
.product-card:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.04);
}

button:active,
a:active,
.product-card:active {
    transform: scale(0.96);
}

.shop-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 18px 14px 34px;
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 14px;
    align-items: start;
}

.category-list {
    position: sticky;
    top: 12px;
    height: fit-content;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
}

.category-button {
    text-align: left;
    color: #d4d4d8;
    background: rgba(255,255,255,0.06);
}

.category-button.active {
    color: #fff;
    background: rgba(34,197,94,0.2);
}

.shop-head {
    margin-bottom: 14px;
}

.shop-head h1 {
    font-size: 26px;
}

.shop-head p {
    color: #a1a1aa;
    font-size: 13px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-grid.show-all-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    border-color: rgba(34,197,94,0.26);
    box-shadow: 0 18px 44px rgba(0,0,0,0.38);
}

.product-image {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(255,255,255,0.04)), #202128;
    background-size: cover;
    background-position: center;
}

.product-image.logo-fallback {
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #050505;
}

.product-body {
    padding: 13px;
}

.product-card.is-text-only {
    border-left: 3px solid rgba(34,197,94,0.72);
}

.product-card.is-text-only .product-body {
    min-height: 172px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(34,197,94,0.12);
    color: #86efac;
    font-size: 12px;
    font-weight: 900;
}

.product-body h2 {
    margin-bottom: 5px;
    font-size: 17px;
}

.product-body p {
    margin-bottom: 12px;
    color: #a1a1aa;
    font-size: 13px;
}

.price-row {
    display: flex;
    gap: 10px;
    color: #86efac;
    font-weight: 900;
    margin-bottom: 12px;
}

.view-button {
    width: 100%;
    background: #22c55e;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 50px 16px;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    text-align: center;
    color: #a1a1aa;
}

@media (max-width: 760px) {
    .brand {
        margin-left: 10px;
    }

    .shop-shell {
        grid-template-columns: 1fr;
    }

    .category-list {
        position: sticky;
        top: 8px;
        z-index: 10;
        flex-direction: row;
        overflow-x: auto;
        box-shadow: 0 10px 24px rgba(0,0,0,0.24);
    }

    .category-button {
        white-space: nowrap;
    }

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

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

    .cart-popover {
        position: fixed;
        top: 64px;
        right: 10px;
    }

    .product-modal-panel {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .product-modal-image {
        min-height: 190px;
        border-radius: 7px 7px 0 0;
    }

    .product-modal-body {
        border-radius: 0 0 7px 7px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }
}
