:root {
    --bg: #fbf4ea;
    --card: #fffaf3;
    --text: #2f261f;
    --muted: #7a6a5d;
    --border: #eaddcc;
    --primary: #d97706;
    --primary-dark: #b45309;
    --danger: #dc2626;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

.shop-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.shop-logo {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    color: #c2410c;
    text-shadow: 0 2px 8px rgba(194, 65, 12, 0.16);;
    white-space: nowrap;
}

.shop-logo span {
    color: #92400e;
    margin-left: 6px;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-top: 4px;
    width: 100%;
}

.shop-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid #d7dce3;
    background: #ffffff;
    color: #1f2933;
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.10),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.shop-icon-button:hover {
    color: #2563eb;
    border-color: #2563eb;
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.shop-icon-button:active {
    transform: scale(0.96);
}

.shop-icon-button svg {
    display: block;
    width: 25px;
    height: 25px;
    stroke-width: 2.2;
}

.shop-hero {
    background: linear-gradient(135deg, #fffaf3, #fff1dc);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 18px;
}

.shop-hero h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.shop-hero p {
    margin: 0;
    color: var(--muted);
    max-width: 620px;
}

.shop-search {
    position: relative;
    margin-bottom: 14px;
}

.shop-search input {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    padding: 0 18px;
    font-size: 16px;
    outline: none;
}

.shop-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.shop-categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 14px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.shop-categories::-webkit-scrollbar {
    display: none;
}

.shop-category {
    white-space: nowrap;
    padding: 10px 15px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.shop-category.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eef0f3;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
    margin-bottom: 8px;
}

.product-description {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 12px;
}

.product-meta {
    margin-top: auto;
}

.product-price {
    font-size: 20px;
    font-weight: 850;
    margin-bottom: 10px;
}

.product-preorder {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
}

.shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 14px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
}

.shop-button:hover {
    background: var(--primary-dark);
    color: white;
}

.shop-button.secondary {
    background: #eef2ff;
    color: var(--primary);
}

.shop-button.danger {
    background: var(--danger);
}

.cart-panel,
.order-panel,
.profile-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.cart-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 14px;
    background: #eef0f3;
}

.cart-title {
    font-weight: 750;
}

.cart-small {
    color: var(--muted);
    font-size: 14px;
}

.form-control,
.form-select {
    min-height: 46px;
    border-radius: 14px;
    border-color: var(--border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.admin-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.table {
    background: white;
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .shop-page {
        padding: 12px;
    }

    .shop-header {
        margin-bottom: 12px;
    }

    .shop-logo {
        font-size: 20px;
    }

    .shop-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .shop-hero h1 {
        font-size: 25px;
    }

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

    .product-body {
        padding: 12px;
    }

    .product-title {
        font-size: 15px;
    }

    .product-description {
        display: none;
    }

    .product-price {
        font-size: 18px;
    }

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

    .cart-item img {
        width: 58px;
        height: 58px;
    }
}

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

.product-title-large {
    font-size: 26px;
    margin: 0 0 12px;
}

.product-description-full {
    display: block;
    margin-bottom: 16px;
    font-size: 16px;
}

@media (max-width: 760px) {
    .shop-icon-button {
        width: 54px;
        min-width: 54px;
        height: 54px;
    }

    .shop-icon-button svg {
        width: 27px;
        height: 27px;
    }
}

/* Compact product cards */

.product-grid {
    gap: 12px;
}

.product-card {
    border-radius: 14px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.product-image {
    aspect-ratio: 1 / 0.82;
}

.product-body {
    padding: 10px;
}

.product-title {
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 6px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

.product-description {
    display: none;
}

.product-price {
    font-size: 16px;
    margin-bottom: 8px;
}

.product-preorder {
    font-size: 11px;
    padding: 4px 8px;
    margin-bottom: 7px;
}

.shop-button {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 13px;
}

/* Mobile compact layout */
@media (max-width: 760px) {
    .shop-page {
        padding: 10px;
    }

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

    .product-card {
        border-radius: 13px;
    }

    .product-image {
        aspect-ratio: 1 / 0.72;
    }

    .product-body {
        padding: 8px;
    }

    .product-title {
        font-size: 13px;
        min-height: 31px;
        margin-bottom: 5px;
    }

    .product-price {
        font-size: 15px;
        margin-bottom: 7px;
    }

    .shop-button {
        min-height: 34px;
        font-size: 12px;
        border-radius: 10px;
    }
}

/* Very small phones */
@media (max-width: 390px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .product-image {
        aspect-ratio: 1 / 0.68;
    }

    .product-title {
        font-size: 12px;
        min-height: 29px;
    }

    .product-price {
        font-size: 14px;
    }
}

.shop-category-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 2px solid #e2c9ae;
    background: #fffaf3;
    color: #92400e;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(120, 53, 15, 0.08);
    white-space: nowrap;
}

.shop-category-button:hover {
    color: #c2410c;
    border-color: #d97706;
}

.shop-categories-panel {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    margin: -4px 0 10px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.shop-categories-panel.is-open {
    display: flex;
}

/* старую строку категорий больше не используем */
.shop-categories {
    display: none;
}

@media (max-width: 760px) {
    .shop-header {
        gap: 8px;
    }

    .shop-logo {
        font-size: 28px;
        margin-left: 4px;
    }

    .shop-logo span {
        margin-left: 5px;
    }

    .shop-category-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    .shop-header-actions {
        gap: 7px;
    }

    .shop-icon-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
}

@media (max-width: 390px) {
    .shop-category-button {
        padding: 0 10px;
        font-size: 12px;
    }

    .shop-logo {
        font-size: 26px;
    }

    .shop-icon-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }
}