/*
 *  WakcedonDesign5 - css/modules/store.css
 *
 *  Page-specific styles for the "store" pages (category, checkout, cart,
 *  player login, user account) and the store sidebar widgets.
 *  Loaded for /store routes (see template.php).
 *
 *  Amber & Gold palette — tokens below follow the D5 theme:
 *    light:  amber #e08e0b / amber-strong #c97a10 / gold #f0b429
 *    dark:   amber #f0b429 / gold #f7c95f
 *  The rest of the theme (surfaces, text, links, buttons) lives in
 *  css/custom.css under :root and body.dark as --wk-* variables.
 *
 *  Structure is inherited from WakcedonDesign2 (wk-store-* classes) so
 *  the store templates stay portable between the two designs.
 */

:root {
    --wk-store-bg: linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(248, 241, 227, 0.98));
    --wk-store-border: rgba(150, 95, 20, 0.16);
    --wk-store-border-strong: rgba(150, 95, 20, 0.3);
    --wk-store-shadow: 0 24px 60px rgba(120, 80, 30, 0.14);
    --wk-store-shadow-hover: 0 28px 64px rgba(120, 80, 30, 0.2);
    --wk-store-title: #1d1607;
    --wk-store-text: #2b2111;
    --wk-store-muted: rgba(90, 66, 28, 0.78);
    --wk-store-surface: rgba(255, 255, 255, 0.78);
    --wk-store-surface-strong: rgba(255, 252, 245, 0.94);
    --wk-store-accent: #e08e0b;
    --wk-store-accent-strong: #c97a10;
    --wk-store-accent-soft: rgba(224, 142, 11, 0.1);
    --wk-store-on-accent: #ffffff;
    --wk-store-danger: #b91c1c;
}

body.dark {
    --wk-store-bg: linear-gradient(180deg, rgba(28, 23, 15, 0.96), rgba(20, 16, 9, 0.99));
    --wk-store-border: rgba(255, 200, 120, 0.16);
    --wk-store-border-strong: rgba(255, 200, 120, 0.28);
    --wk-store-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    --wk-store-shadow-hover: 0 28px 64px rgba(0, 0, 0, 0.45);
    --wk-store-title: #fff8e6;
    --wk-store-text: #f4ecd9;
    --wk-store-muted: rgba(244, 236, 217, 0.76);
    --wk-store-surface: rgba(28, 23, 15, 0.86);
    --wk-store-surface-strong: rgba(20, 16, 9, 0.96);
    --wk-store-accent: #f0b429;
    --wk-store-accent-strong: #c97a10;
    --wk-store-accent-soft: rgba(240, 180, 41, 0.12);
    /* На янтарном градиенте в тёмной теме светлый текст теряется — тёмный */
    --wk-store-on-accent: #2b1e05;
    --wk-store-danger: #f87171;
}

.wk-store-shell {
    position: relative;
    overflow: hidden;
    padding: 1.35rem;
    border-radius: 26px;
    border: 1px solid var(--wk-store-border);
    background: var(--wk-store-bg);
    box-shadow: var(--wk-store-shadow);
}

.wk-store-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(224, 142, 11, 0.14), transparent 34%);
    pointer-events: none;
}

.wk-store-shell > * {
    position: relative;
    z-index: 1;
}

.wk-store-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: var(--wk-store-title);
    font-size: clamp(1.6rem, 1.35rem + .7vw, 2.15rem);
    line-height: 1.15;
}

.wk-store-spacer {
    height: 1rem;
}

.wk-store-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 1.25rem;
    flex-wrap: wrap;
}

.wk-store-toolbar__actions {
    margin-left: auto;
}

.wk-store-toolbar__buttons.ui.buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    padding: .35rem;
    border-radius: 18px;
    background: var(--wk-store-surface);
    border: 1px solid var(--wk-store-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.dark .wk-store-toolbar__buttons.ui.buttons,
body.dark .wk-store-nav-menu.ui.menu {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wk-store-toolbar__buttons.ui.buttons>.button,
.wk-store-toolbar__buttons.ui.buttons>.or,
.wk-store-toolbar__buttons.ui.buttons form {
    border-radius: 14px !important;
}

.wk-store-toolbar__buttons form {
    margin: 0;
}

.wk-store-account-chip,
.wk-store-cart-button,
.wk-store-logout-button {
    min-height: 42px;
    border-radius: 14px !important;
    font-weight: 700 !important;
}

.wk-store-account-chip {
    background: var(--wk-store-surface-strong) !important;
    color: var(--wk-store-title) !important;
    border: 1px solid var(--wk-store-border) !important;
}

.wk-store-cart-button,
.wk-store-cart-button:link,
.wk-store-cart-button:visited,
.wk-store-cart-button:hover,
.wk-store-cart-button:focus {
    background: linear-gradient(135deg, var(--wk-store-accent), var(--wk-store-accent-strong)) !important;
    background-color: var(--wk-store-accent) !important;
    background-image: none !important;
    color: var(--wk-store-on-accent) !important;
    box-shadow: 0 16px 30px rgba(224, 142, 11, 0.28) !important;
}

.wk-store-cart-button.disabled {
    opacity: .55 !important;
    box-shadow: none !important;
}

.wk-store-logout-button,
.wk-store-logout-button:hover,
.wk-store-logout-button:focus {
    background: rgba(185, 28, 28, 0.12) !important;
    color: var(--wk-store-danger) !important;
    border: 1px solid rgba(185, 28, 28, 0.22) !important;
}

.wk-store-nav-menu.ui.menu {
    width: 100%;
    margin: 0;
    padding: .55rem;
    border: 1px solid var(--wk-store-border);
    border-radius: 20px 20px 16px 16px !important;
    background: var(--wk-store-surface) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    gap: .35rem;
    flex-wrap: wrap;
    position: sticky;
    top: 84px;
    z-index: 9;
}

.wk-store-nav-menu::-webkit-scrollbar {
    display: none;
}

.wk-store-nav-menu .item,
.wk-store-nav-menu .item:link,
.wk-store-nav-menu .item:visited {
    margin: 0 !important;
    border-radius: 14px !important;
    color: var(--wk-store-text) !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.wk-store-nav-menu .item:hover,
.wk-store-nav-menu .item.active,
.wk-store-nav-menu .dropdown.item.active {
    background: var(--wk-store-accent-soft) !important;
    color: var(--wk-store-title) !important;
}

.wk-store-nav-menu .dropdown .menu {
    border-radius: 16px !important;
    border: 1px solid var(--wk-store-border-strong) !important;
    box-shadow: 0 18px 36px rgba(90, 66, 28, 0.16) !important;
}

.wk-store-panel.ui.segment,
.wk-store-section,
.wk-store-summary-table.ui.table,
.wk-store-table.ui.table {
    border: 1px solid var(--wk-store-border) !important;
    background: var(--wk-store-surface) !important;
    box-shadow: none !important;
}

.wk-store-panel.ui.segment {
    margin-top: 1rem;
    border-radius: 0 0 22px 22px;
}

.wk-store-copy,
.wk-store-shell p,
.wk-store-shell .content,
.wk-store-shell .description,
.wk-store-shell label {
    color: var(--wk-store-text);
}

.wk-store-products.ui.grid {
    row-gap: 1rem;
}

.wk-store-product-card.ui.card,
#widget-featured-products .ui.card {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--wk-store-border);
    background: var(--wk-store-surface-strong);
    box-shadow: var(--wk-store-shadow);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.wk-store-product-card.ui.card:hover,
#widget-featured-products .ui.card:hover {
    transform: translateY(-6px);
    border-color: var(--wk-store-border-strong);
    box-shadow: var(--wk-store-shadow-hover);
}

.wk-store-product-card__image,
#widget-featured-products .ui.card>.image {
    background: linear-gradient(180deg, rgba(224, 142, 11, 0.14), transparent 78%);
}

.wk-store-product-card__image img,
#widget-featured-products .ui.card>.image img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.wk-store-product-card__content,
#widget-featured-products .center.aligned.content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .9rem;
    padding: 1.1rem 1.15rem 1.2rem !important;
}

.wk-store-product-card__title,
#widget-featured-products .header {
    display: block;
    color: var(--wk-store-title) !important;
    font-size: 1.06rem;
    font-weight: 800;
}

.wk-store-price-old {
    color: var(--wk-store-danger);
    text-decoration: line-through;
    font-weight: 700;
    opacity: .92;
}

.wk-store-price-current {
    color: var(--wk-store-title);
    font-size: 1.05rem;
    font-weight: 800;
}

.wk-store-price-stack {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.wk-store-product-card__button,
#widget-featured-products .ui.bottom.attached.button,
.wk-store-submit.ui.button,
.wk-store-submit.ui.button:hover,
.wk-store-submit.ui.button:focus {
    background: linear-gradient(135deg, var(--wk-store-accent), var(--wk-store-accent-strong)) !important;
    background-color: var(--wk-store-accent) !important;
    background-image: none !important;
    color: var(--wk-store-on-accent) !important;
    border: none !important;
    box-shadow: 0 12px 24px rgba(224, 142, 11, 0.22) !important;
}

.wk-store-product-card__button:hover,
.wk-store-product-card__button:focus,
.wk-store-submit.ui.button:hover,
.wk-store-submit.ui.button:focus {
    box-shadow: 0 14px 28px rgba(224, 142, 11, 0.32) !important;
}

.wk-store-product-card__button {
    min-height: 48px;
    font-weight: 800 !important;
}

.wk-store-modal.ui.modal {
    border-radius: 24px;
    overflow: hidden;
}

.wk-store-modal.ui.modal>.header {
    color: var(--wk-store-title);
    background: var(--wk-store-surface-strong);
}

.wk-store-modal.ui.modal>.content,
.wk-store-modal.ui.modal>.actions {
    background: var(--wk-store-surface);
}

.wk-store-modal__description {
    color: var(--wk-store-text);
}

.wk-store-section {
    margin-top: 1.15rem;
    padding: 1.1rem 1.15rem 1.2rem;
    border-radius: 20px;
}

.wk-store-section h3,
.wk-store-user-card h3,
.wk-store-shell h3,
.wk-store-shell h4 {
    color: var(--wk-store-title) !important;
}

.wk-store-table.ui.table {
    border-radius: 18px;
    overflow: hidden;
}

.wk-store-table.ui.table thead th {
    background: rgba(224, 142, 11, 0.08) !important;
    color: var(--wk-store-title) !important;
    font-weight: 800;
    border-bottom: 1px solid var(--wk-store-border) !important;
}

.wk-store-table.ui.table tbody td {
    color: var(--wk-store-text) !important;
    border-top: 1px solid rgba(150, 95, 20, 0.08) !important;
    vertical-align: middle;
}

.wk-store-table.ui.table tbody tr:nth-child(even) {
    background: rgba(224, 142, 11, 0.035);
}

.wk-store-remove-button.ui.button,
.wk-store-remove-button.ui.button:hover,
.wk-store-remove-button.ui.button:focus {
    border-radius: 12px !important;
    background: rgba(185, 28, 28, 0.12) !important;
    color: var(--wk-store-danger) !important;
    box-shadow: none !important;
}

.wk-store-summary-table.ui.table {
    margin-top: 1rem;
    border-radius: 18px;
}

.wk-store-summary-table.ui.table td {
    color: var(--wk-store-title) !important;
    font-weight: 700;
}

.wk-store-summary-table.ui.table tr:last-child td {
    font-size: 1.02rem;
}

.wk-store-form .field {
    margin-bottom: 1rem;
}

.wk-store-form.ui.form input:not(.button),
.wk-store-form.ui.form textarea,
.wk-store-form.ui.form .ui.selection.dropdown,
.wk-store-form.ui.form .ui.action.input:not(.disabled) > input {
    border-radius: 14px !important;
    border-color: var(--wk-store-border) !important;
    background: var(--wk-store-surface-strong) !important;
    color: var(--wk-store-title) !important;
}

.wk-store-form.ui.form input:not(.button):focus,
.wk-store-form.ui.form textarea:focus,
.wk-store-form.ui.form .ui.selection.dropdown.active,
.wk-store-form.ui.form .ui.selection.dropdown.visible {
    border-color: var(--wk-store-border-strong) !important;
    box-shadow: 0 0 0 3px rgba(224, 142, 11, 0.12) !important;
}

.wk-store-form.ui.form .ui.checkbox label,
.wk-store-form.ui.form .ui.radio.checkbox label {
    color: var(--wk-store-text) !important;
}

.wk-store-action-input.ui.action.input {
    width: min(100%, 520px);
}

.wk-store-action-input.ui.action.input > .button {
    border-radius: 0 14px 14px 0 !important;
}

.wk-store-checkout-actions.ui.grid {
    align-items: end;
}

.wk-store-checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .74fr);
    gap: 1rem;
    align-items: start;
}

.wk-store-checkout-layout__main {
    display: grid;
    gap: 1rem;
}

.wk-store-checkout-layout__aside {
    min-width: 0;
}

.wk-store-summary-card {
    position: sticky;
    top: 94px;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    border: 1px solid var(--wk-store-border-strong);
    background: var(--wk-store-surface-strong);
    box-shadow: var(--wk-store-shadow);
}

.wk-store-summary-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    color: var(--wk-store-accent);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.wk-store-summary-card__eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: currentColor;
    opacity: .7;
}

.wk-store-summary-card h3 {
    margin-top: .65rem;
}

.wk-store-summary-card__meta {
    margin: .85rem 0 0;
    color: var(--wk-store-muted);
    line-height: 1.6;
}

.wk-store-summary-card__cta.ui.button,
.wk-store-summary-card__cta.ui.button:hover,
.wk-store-summary-card__cta.ui.button:focus {
    width: 100%;
    margin-top: .95rem;
}

.wk-store-table--cart td:nth-child(2) {
    white-space: normal !important;
}

.wk-store-checkout-submit {
    min-width: 200px;
}

.wk-store-user-grid {
    margin-top: .1rem !important;
}

.wk-store-user-card.ui.segment {
    border-radius: 22px;
}

.wk-store-balance {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .85rem;
    border-radius: 999px;
    background: var(--wk-store-accent-soft);
    color: var(--wk-store-title);
    font-weight: 800;
}

/* Сообщения магазина: читаемые в обеих темах */
.wk-store-shell .ui.message {
    border-radius: 14px;
    border: 1px solid var(--wk-store-border);
    background: var(--wk-store-surface-strong);
    color: var(--wk-store-text);
    box-shadow: 0 10px 24px rgba(120, 80, 30, 0.1);
}

.wk-store-shell .ui.message .header {
    color: var(--wk-store-title);
}

.wk-store-shell .ui.message .icon {
    opacity: 1;
}

.wk-store-shell .ui.success.message {
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.28);
}

.wk-store-shell .ui.negative.message {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.28);
}

body.dark .wk-store-shell .ui.message {
    background: var(--wk-store-surface-strong);
    color: var(--wk-store-text);
    border-color: var(--wk-store-border-strong);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.dark .wk-store-shell .ui.success.message {
    background: rgba(74, 222, 128, 0.1);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.3);
}

body.dark .wk-store-shell .ui.negative.message {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
}

#widget-featured-products .content,
#widget-latest-purchases .content,
#widget-store-account .content {
    background: transparent;
}

#widget-featured-products,
#widget-latest-purchases,
#widget-store-account {
    border-radius: 22px;
    border: 1px solid var(--wk-store-border);
    background: var(--wk-store-bg);
    box-shadow: var(--wk-store-shadow);
}

#widget-latest-purchases .item .header,
#widget-store-account .ui.header {
    color: var(--wk-store-title) !important;
}

#widget-latest-purchases small,
#widget-store-account .description,
#widget-featured-products .description {
    color: var(--wk-store-text) !important;
}

@media only screen and (max-width: 767px) {
    .wk-store-shell {
        padding: 1rem;
        border-radius: 22px;
    }

    .wk-store-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .wk-store-toolbar__actions {
        margin-left: 0;
        width: 100%;
    }

    .wk-store-toolbar__buttons.ui.buttons {
        width: 100%;
        justify-content: stretch;
    }

    .wk-store-toolbar__buttons.ui.buttons > .button,
    .wk-store-toolbar__buttons.ui.buttons form,
    .wk-store-toolbar__buttons.ui.buttons form .button {
        width: 100%;
    }

    .wk-store-nav-menu.ui.menu {
        padding: .45rem;
        top: 72px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        scroll-snap-type: x proximity;
    }

    .wk-store-nav-menu .item {
        width: auto;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .wk-store-checkout-layout {
        grid-template-columns: 1fr;
    }

    .wk-store-checkout-layout__aside {
        order: -1;
    }

    .wk-store-summary-card {
        top: 72px;
        padding: .95rem;
    }

    .wk-store-action-input.ui.action.input {
        width: 100%;
        flex-direction: column;
    }

    .wk-store-action-input.ui.action.input > input,
    .wk-store-action-input.ui.action.input > .button {
        width: 100%;
        border-radius: 14px !important;
    }

    .wk-store-checkout-submit {
        width: 100%;
        min-width: 0;
    }
}
