/* スギ薬局クーポン検索ツール（ブログ記事ページ内） */

body:has(.sugi-sticky-bar) {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.sugi-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px color-mix(in srgb, var(--text) 8%, transparent);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sugi-sticky-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 10px;
    max-width: 740px;
    margin: 0 auto;
    padding: 10px 24px;
}

.sugi-sticky-bar__inner--copy-only {
    justify-content: flex-end;
}

.sugi-sticky-bar__inner--copy-only .sugi-sticky-btn--copy {
    flex: 0 1 auto;
    min-width: min(100%, 220px);
}

.sugi-sticky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s, background-color 0.15s;
}

.sugi-sticky-btn__icon {
    flex-shrink: 0;
}

.sugi-sticky-btn--share {
    color: var(--primary-contrast, #fff);
    background-color: var(--primary);
    border: none;
}

.sugi-sticky-btn--share:hover {
    opacity: 0.92;
}

.sugi-sticky-btn--copy {
    color: var(--primary);
    background-color: var(--surface-2);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}

.sugi-sticky-btn--copy:hover {
    background-color: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.sugi-sticky-bar__toast {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2f855a;
    background-color: var(--surface);
    border: 1px solid color-mix(in srgb, #2f855a 30%, var(--border));
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    pointer-events: none;
}

[data-theme="dark"] .sugi-sticky-bar__toast {
    color: #68d391;
}

.sugi-search-section {
    margin: 2.5em 0;
    padding: 24px 20px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

#sugi-search-heading {
    scroll-margin-top: 60px;
}

.sugi-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
}

.sugi-meta-bar p {
    margin: 0;
}

.sugi-meta-bar__updated {
    color: var(--text-muted);
}

.sugi-meta-bar__updated span {
    font-weight: 700;
    color: var(--heading);
}

.sugi-official-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--link);
    text-decoration: none;
}

.sugi-official-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.sugi-official-link__icon {
    font-size: 0.9em;
}

.sugi-notices {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface-2);
}

.sugi-notices__summary {
    padding: 12px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--heading);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.sugi-notices__summary::-webkit-details-marker {
    display: none;
}

.sugi-notices__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s;
}

.sugi-notices[open] .sugi-notices__summary::before {
    transform: rotate(90deg);
}

.sugi-notices__body {
    padding: 0 14px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    border-top: 1px solid var(--border);
}

.sugi-notices__body ul {
    margin: 12px 0 0;
    padding-left: 1.2em;
}

.sugi-notices__body li {
    margin-bottom: 0.5em;
}

.sugi-notices__body li:last-child {
    margin-bottom: 0;
}

.sugi-search-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 10px;
}

.sugi-search-input-wrap {
    position: relative;
}

.sugi-search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.sugi-search-input::placeholder {
    color: var(--text-xs);
}

.sugi-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.sugi-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-xs);
    pointer-events: none;
}

.sugi-search-status {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-xs);
    min-height: 1.2em;
}

.sugi-save-bar {
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: 8px;
    line-height: 1.6;
}

.sugi-save-bar--search {
    background-color: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}

.sugi-save-bar--page {
    margin-top: 1em;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.sugi-save-bar--page .sugi-save-bar__text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sugi-save-bar__icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}

.sugi-save-bar__text {
    margin: 0 0 10px;
    font-weight: 600;
    color: var(--heading);
}

.sugi-save-bar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.sugi-save-feedback {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2f855a;
}

.sugi-category-list {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.sugi-category-list__heading {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.4;
    scroll-margin-top: 60px;
}

.sugi-category-list__lead {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.sugi-category-list__body {
    padding: 14px 16px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sugi-category-flat-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px 20px;
}

.sugi-category-item {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
}

.sugi-category-item__name {
    font-weight: 600;
    color: var(--heading);
}

.sugi-category-item__note {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

@media (min-width: 600px) {
    .sugi-category-flat-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sugi-category-item__note {
        display: inline;
        margin-top: 0;
        margin-left: 4px;
    }
}

[data-theme="dark"] .sugi-save-feedback {
    color: #68d391;
}

.sugi-hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s, background-color 0.15s;
}

.sugi-hint-btn__icon {
    flex-shrink: 0;
}

.sugi-hint-btn--primary {
    color: var(--primary-contrast, #fff);
    background-color: var(--primary);
    border: none;
}

.sugi-hint-btn--primary:hover {
    opacity: 0.9;
}

.sugi-hint-btn--secondary {
    color: var(--primary);
    background-color: transparent;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
}

.sugi-hint-btn--secondary:hover {
    background-color: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.sugi-recent-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    color: #744210;
    background-color: #faf089;
    border-radius: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

[data-theme="dark"] .sugi-recent-badge {
    color: #faf089;
    background-color: color-mix(in srgb, #faf089 20%, #744210);
}

.sugi-product-cell {
    display: inline;
}

.sugi-product-name {
    word-break: break-word;
}

.sugi-results-count {
    margin: 20px 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.sugi-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.sugi-results-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--surface-2);
}

.sugi-results-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.5;
}

.sugi-results-table th,
.sugi-results-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.sugi-results-table th {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background-color: var(--surface-3);
    white-space: nowrap;
}

.sugi-results-table tbody tr:last-child td {
    border-bottom: none;
}

.sugi-results-table .sugi-col-status {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.8rem;
}

.sugi-result-row--excluded .sugi-col-status {
    color: #c53030;
}

.sugi-result-row--eligible .sugi-col-status {
    color: #2f855a;
}

[data-theme="dark"] .sugi-result-row--excluded .sugi-col-status {
    color: #fc8181;
}

[data-theme="dark"] .sugi-result-row--eligible .sugi-col-status {
    color: #68d391;
}

.sugi-cell-empty {
    color: var(--text-xs);
}

.sugi-result-card {
    padding: 16px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--surface-2);
}

.sugi-result-card.excluded {
    border-left: 4px solid #e53e3e;
    background-color: color-mix(in srgb, #e53e3e 6%, var(--surface-2));
}

.sugi-result-card.eligible {
    border-left: 4px solid #38a169;
    background-color: color-mix(in srgb, #38a169 6%, var(--surface-2));
}

[data-theme="dark"] .sugi-result-card.excluded {
    background-color: color-mix(in srgb, #e53e3e 12%, var(--surface-2));
}

[data-theme="dark"] .sugi-result-card.eligible {
    background-color: color-mix(in srgb, #38a169 12%, var(--surface-2));
}

.sugi-result-status {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.sugi-result-card.excluded .sugi-result-status {
    color: #c53030;
}

.sugi-result-card.eligible .sugi-result-status {
    color: #2f855a;
}

[data-theme="dark"] .sugi-result-card.excluded .sugi-result-status {
    color: #fc8181;
}

[data-theme="dark"] .sugi-result-card.eligible .sugi-result-status {
    color: #68d391;
}

.sugi-result-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sugi-result-row {
    display: grid;
    grid-template-columns: 5.5em 1fr;
    gap: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sugi-result-row dt {
    color: var(--text-muted);
    font-weight: 600;
}

.sugi-result-row dd {
    color: var(--text);
    margin: 0;
    word-break: break-word;
}

.sugi-no-results {
    margin-top: 20px;
    padding: 20px 16px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
    background-color: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.sugi-no-results__title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--heading);
    text-align: center;
}

.sugi-no-results__lead {
    margin: 0 0 12px;
    line-height: 1.6;
}

.sugi-no-results__list {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.7;
}

.sugi-no-results__list li {
    margin-bottom: 0.45em;
}

.sugi-no-results__list li:last-child {
    margin-bottom: 0;
}

.sugi-no-results a {
    font-weight: 600;
}

.sugi-error {
    margin-top: 16px;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #c53030;
    background-color: color-mix(in srgb, #e53e3e 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #e53e3e 30%, var(--border));
    border-radius: 8px;
}

.sugi-disclaimer {
    margin-top: 48px;
    padding: 24px 20px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.sugi-disclaimer h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
    margin: 0 0 12px;
    padding: 0;
    border: none;
}

.sugi-disclaimer p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0 0 0.8em;
}

.sugi-disclaimer p:last-child {
    margin-bottom: 0;
}

.sugi-disclaimer a {
    font-weight: 600;
}

@media (max-width: 480px) {
    .sugi-sticky-bar__inner {
        padding: 10px 16px;
        gap: 8px;
    }

    .sugi-sticky-btn {
        font-size: 0.8rem;
        padding: 10px 10px;
    }

    .sugi-search-section {
        padding: 20px 16px;
        margin-left: -4px;
        margin-right: -4px;
    }

    .sugi-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sugi-result-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .sugi-result-row dt {
        font-size: 0.8rem;
    }
}
