* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
        "Hiragino Kaku Gothic ProN", Arial, sans-serif;
    background: #f7f7f5;
    color: #222;
}

.container {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    padding: 56px 0 36px;
    border-bottom: 1px solid #ddd;
}

.site-header h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: 0.04em;
}

.site-header p {
    margin: 8px 0 0;
    color: #777;
}

.catalog {
    padding: 36px 0 80px;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}

.catalog-header h2 {
    margin: 0;
    font-size: 24px;
}

.catalog-header span {
    color: #777;
    font-size: 14px;
}

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

.product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 20px;
}

.brand {
    color: #777;
    font-size: 13px;
    margin-bottom: 8px;
}

.product-card h3 {
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 1.5;
}

dl {
    margin: 0;
}

dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

dt,
dd {
    margin: 0;
    font-size: 12px;
}

dt {
    color: #888;
}

dd {
    text-align: right;
    word-break: break-all;
}

@media (max-width: 800px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 24px, 1100px);
    }

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

.search-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px 180px auto auto;
    gap: 10px;
    margin-bottom: 30px;
}

.search-form input,
.search-form select,
.search-form button {
    min-height: 42px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 0 14px;
    font: inherit;
}

.search-form button {
    cursor: pointer;
    padding: 0 22px;
}

.clear-search {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 13px;
    text-decoration: none;
}

.product-card {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.product-card:hover {
    border-color: #999;
}

.back-link {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.product-detail {
    max-width: 760px;
    padding: 60px 0 100px;
}

.detail-brand {
    color: #777;
    margin: 0 0 10px;
}

.product-detail h1 {
    margin: 0 0 40px;
    font-size: 34px;
    line-height: 1.45;
}

.detail-meta {
    border-top: 1px solid #ddd;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 16px 0;
    border-bottom: 1px solid #ddd;
}

.meta-row span {
    color: #777;
}

.meta-row strong {
    text-align: right;
}

.detail-section {
    margin-top: 50px;
}

.detail-section h2 {
    font-size: 20px;
    margin-bottom: 18px;
}

.variant-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.variant {
    padding: 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.variant span {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 13px;
}

.event-card {
    padding: 20px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.event-status {
    font-size: 12px;
    color: #777;
}

.event-date {
    margin-top: 8px;
    font-size: 22px;
}

.event-raw {
    margin-top: 5px;
    color: #777;
    font-size: 13px;
}

.event-note {
    margin-top: 15px;
    font-size: 13px;
}

.event-card a {
    display: inline-block;
    margin-top: 15px;
    color: #555;
    font-size: 13px;
}

.empty {
    grid-column: 1 / -1;
    padding: 50px;
    text-align: center;
    color: #777;
}

@media (max-width: 700px) {
    .search-form {
        grid-template-columns: 1fr;
    }

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

    .product-detail h1 {
        font-size: 27px;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-size: 13px;
}

.pagination a:hover {
    border-color: #999;
}

.pagination .current {
    background: #222;
    color: #fff;
    border-color: #222;
}

@media (max-width: 700px) {
    .pagination {
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
    }
}

.search-form {
    grid-template-columns: minmax(260px, 1fr) 210px 210px auto auto;
}

@media (max-width: 900px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }

    .search-form input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form input {
        grid-column: auto;
    }
}

.search-form {
    grid-template-columns: minmax(240px, 1fr) 180px 180px 180px auto auto;
}

@media (max-width: 1100px) {
    .search-form {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .search-form input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form input {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .catalog-header {
        display: block;
    }

    .catalog-header h2 {
        margin-bottom: 6px;
    }

    .catalog-header span {
        display: block;
    }
}

.error-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 120px 20px;
}

.error-code {
    font-size: 72px;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
}

.error-page h1 {
    margin: 0 0 16px;
    font-size: 28px;
}

.error-page p {
    color: #777;
    margin-bottom: 32px;
}

.error-page a {
    color: #222;
}

@media (max-width: 520px) {
    .error-page {
        padding: 80px 20px;
    }

    .error-code {
        font-size: 56px;
    }
}


/* Subtle interaction */
.product-card {
    transition:
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.035);
}

/* Primary search action */
.search-form button {
    background: #222;
    color: #fff;
    border-color: #222;
    transition: opacity 0.15s ease;
}

.search-form button:hover {
    opacity: 0.82;
}

/* Official source link */
.event-card a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.event-card a:hover {
    border-color: #999;
    background: #f7f7f5;
}

/* STILLA soft pink interaction */
:root {
    --stilla-pink: #d9aeb8;
    --stilla-pink-soft: rgba(217, 174, 184, 0.22);
    --stilla-pink-glow: rgba(217, 174, 184, 0.16);
}

.product-card:hover {
    border-color: var(--stilla-pink);
    box-shadow: 0 8px 24px var(--stilla-pink-glow);
}

.event-card a:hover {
    border-color: var(--stilla-pink);
    background: rgba(217, 174, 184, 0.05);
    box-shadow: 0 4px 14px var(--stilla-pink-glow);
}

.event-card a:focus,
.event-card a:focus-visible {
    outline: none;
    border-color: var(--stilla-pink);
    box-shadow:
        0 0 0 3px var(--stilla-pink-soft),
        0 4px 14px var(--stilla-pink-glow);
}

/* STILLA pink glow - stronger */
.product-card:hover {
    border-color: rgba(217, 174, 184, 0.75);
    box-shadow:
        0 0 0 1px rgba(217, 174, 184, 0.10),
        0 6px 22px rgba(217, 174, 184, 0.28),
        0 14px 38px rgba(217, 174, 184, 0.12);
}

.event-card a:hover,
.event-card a:focus,
.event-card a:focus-visible {
    outline: none;
    border-color: rgba(217, 174, 184, 0.9);
    background: rgba(255, 248, 250, 0.8);
    box-shadow:
        0 0 0 3px rgba(217, 174, 184, 0.14),
        0 5px 18px rgba(217, 174, 184, 0.30);
}

/* Mobile refinement */
@media (max-width: 520px) {
    .site-header {
        padding: 38px 0 28px;
    }

    .site-header h1 {
        font-size: 36px;
    }

    .site-header .site-copy {
        margin-top: 12px;
        font-size: 15px;
    }

    .site-header .site-description {
        margin-top: 8px;
        font-size: 14px;
        line-height: 1.7;
    }

    .catalog {
        padding-top: 28px;
    }

    .search-form {
        gap: 8px;
        margin-bottom: 28px;
    }

    .search-form input,
    .search-form select,
    .search-form button {
        min-height: 46px;
        font-size: 14px;
    }
}

/* Mobile product detail refinement */
@media (max-width: 520px) {
    .product-detail {
        padding: 40px 0 70px;
    }

    .detail-brand {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .product-detail h1 {
        font-size: 24px;
        line-height: 1.45;
        margin-bottom: 30px;
    }

    .meta-row {
        gap: 16px;
        padding: 14px 0;
        font-size: 14px;
    }

    .detail-section {
        margin-top: 38px;
    }

    .detail-section h2 {
        font-size: 19px;
    }

    .event-card {
        padding: 18px;
    }

    .event-date {
        font-size: 21px;
    }

    .event-note {
        line-height: 1.6;
    }
}

/* Market availability */
.market-card {
    padding: 22px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.market-label {
    font-size: 13px;
    color: #777;
}

.market-price {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 600;
}

.market-meta {
    margin-top: 6px;
    color: #777;
    font-size: 13px;
}

.market-link {
    display: inline-block;
    margin-top: 18px;
    padding: 9px 13px;
    border: 1px solid #ddd;
    color: #222;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.market-link:hover,
.market-link:focus,
.market-link:focus-visible {
    outline: none;
    border-color: rgba(217, 174, 184, 0.9);
    background: rgba(255, 248, 250, 0.8);
    box-shadow:
        0 0 0 3px rgba(217, 174, 184, 0.14),
        0 5px 18px rgba(217, 174, 184, 0.30);
}

@media (max-width: 520px) {
    .market-card {
        padding: 18px;
    }

    .market-price {
        font-size: 24px;
    }
}

/* Offer list page */
.offers-page {
    max-width: 900px;
    padding: 60px 0 100px;
}

.offers-page h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.45;
}

.offers-intro {
    margin: 18px 0 0;
    color: #777;
}

.offers-count {
    margin-top: 10px;
    color: #777;
    font-size: 13px;
}

.offers-list {
    margin-top: 32px;
}

.offer-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 20px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.offer-main {
    min-width: 0;
}

.offer-seller {
    font-size: 13px;
    color: #777;
}

.offer-title {
    margin-top: 7px;
    line-height: 1.6;
}

.offer-side {
    flex: 0 0 150px;
    text-align: right;
}

.offer-price {
    font-size: 22px;
    font-weight: 600;
}

.offer-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 11px;
    border: 1px solid #ddd;
    color: #222;
    text-decoration: none;
    font-size: 13px;
}

.offer-link:hover,
.offer-link:focus,
.offer-link:focus-visible {
    outline: none;
    border-color: rgba(217, 174, 184, 0.9);
    background: rgba(255, 248, 250, 0.8);
    box-shadow:
        0 0 0 3px rgba(217, 174, 184, 0.14),
        0 5px 18px rgba(217, 174, 184, 0.30);
}

@media (max-width: 520px) {
    .offers-page {
        padding: 40px 0 70px;
    }

    .offers-page h1 {
        font-size: 24px;
    }

    .offer-row {
        display: block;
        padding: 18px;
    }

    .offer-side {
        margin-top: 18px;
        text-align: left;
    }

    .offer-price {
        font-size: 20px;
    }
}

/* Keep marketplace titles compact */
.offer-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* Subtle card rounding */
.product-card,
.event-card,
.market-card,
.offer-row {
    border-radius: 6px;
}

.market-link,
.offer-link {
    border-radius: 4px;
}

/* Stilla wordmark */
.site-wordmark {
    margin: 0 0 18px;
}

.site-wordmark img {
    display: block;
    width: 180px;
    height: auto;
}

@media (max-width: 520px) {
    .site-wordmark img {
        width: 150px;
    }
}
