/* offers/show.blade.php */

.offer-detail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.offer-detail__section {
    width: 100%;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .offer-detail__section {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Admin edit link (shown inline after title for logged-in admins) */
.offer-detail__admin-edit-link {
    margin-left: 0.5em;
    font-size: 12px;
    font-weight: normal;
    color: #2271b1;
    text-decoration: underline;
    white-space: nowrap;
}

.offer-detail__admin-edit-link:hover {
    color: #135e96;
}

@media (min-width: 1024px) {
    .offer-detail__admin-edit-link {
        font-size: 14px;
    }
}

.offer-detail__requirements-list {
    margin: 0;
    padding-left: 1.25rem;
}

.offer-detail__requirements-list li + li {
    margin-top: 0.35rem;
}

/* Header */
.offer-detail__header {
    padding: 20px 8px;
}

@media (min-width: 1024px) {
    .offer-detail__header {
        padding: 40px 30px 24px;
    }
}

.offer-detail__hero {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 1024px) {
    .offer-detail__hero {
        justify-content: flex-start;
        gap: 25px;
    }
}

.offer-detail__image {
    height: auto;
    object-fit: contain;
    max-width: 130px;
}

.offer-detail__image--default {
    width: 130px;
}

@media (min-width: 1024px) {
    .offer-detail__image {
        height: auto;
        object-fit: contain;
        max-width: 160px;
    }

    .offer-detail__image--default {
        width: 250px;
    }
}

.offer-detail__title {
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    line-height: 30px;
    text-align: center;
}

@media (min-width: 1024px) {
    .offer-detail__title {
        font-size: 25px;
        text-align: left;
    }
}

.offer-detail__rating {
    --rating-text-size: 14px;
    --rating-star-size: 21px;
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-top: 8px;
}

.offer-detail__rating-score {
    font-size: var(--rating-text-size);
    font-weight: bold;
    color: var(--sepia, #333);
    line-height: 1;
    margin: 0;
}

.offer-detail__rating-stars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.offer-detail__rating-stars svg {
    display: block;
    height: var(--rating-star-size);
    width: auto;
}

.offer-detail__rating-count {
    font-size: var(--rating-text-size);
    color: #666;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
}

/* Points */
.offer-detail__points {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
    width: 100%;
    padding-right: 15px;
}

@media (min-width: 1024px) {
    .offer-detail__points {
        padding-right: 0;
    }
}

.offer-detail__points-label {
    color: var(--point-color);
    font-size: 16px;
    font-weight: bold;
    margin-right: 5px;
    margin-bottom: 4px;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .offer-detail__points-label {
        margin-bottom: 8px;
    }
}

.offer-detail__points-label--large {
    font-size: 16px;
    font-weight: bold;
}

@media (min-width: 1024px) {
    .offer-detail__points-label--large {
        font-size: 23px;
    }
}

.offer-detail__points-value {
    color: var(--point-color);
    font-weight: bold;
    font-size: 20px;
}

@media (min-width: 1024px) {
    .offer-detail__points-value {
        font-size: 43px;
    }
}

.offer-detail__points-unit {
    font-size: 18px;
}

@media (min-width: 1024px) {
    .offer-detail__points-unit {
        font-size: 27px;
    }
}

/* Meta bar */
.offer-detail__meta {
    width: 100%;
    background: var(--gray-bg-color);
    font-size: 12px;
    text-align: center;
    padding: 9px 0;
    margin-top: 15px;
}

@media (min-width: 1024px) {
    .offer-detail__meta {
        margin-top: 20px;
    }
}

.offer-detail__external-link-wrap {
    margin-top: 20px;
}

.offer-detail__external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    word-break: break-all;
}

.offer-detail__external-link:hover {
    color: #1d4ed8;
}

.offer-detail__external-link i {
    font-size: 12px;
}

/* Actions (PC) */
.offer-detail__actions {
    display: none;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

@media (min-width: 1024px) {
    .offer-detail__actions {
        display: flex;
        flex-direction: row;
        gap: 25px;
        margin-top: 25px;
    }
}

.offer-detail__actions-group {
    display: flex;
    gap: 10px;
}

.offer-detail__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 1024px) {
    .offer-detail__icon-btn {
        width: 50px;
        height: 50px;
    }
}

.offer-detail__icon-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .offer-detail__icon-btn svg {
        width: 25px;
        height: 25px;
    }
}

.offer-detail__icon-btn--share {
    background: var(--white);
    border: 1px solid var(--default-color);
}

.offer-detail__icon-btn--share i {
    color: var(--default-color);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .offer-detail__icon-btn--share i {
        font-size: 22px;
    }
}

.offer-detail__share-dialog {
    max-width: 420px;
}

.offer-detail__share-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.offer-detail__share-modal-header {
    border: none;
    padding: 12px 12px 0;
    justify-content: flex-end;
}

.offer-detail__share-modal-body {
    padding: 0 20px 24px;
}

.offer-detail__share-message {
    position: relative;
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff8d6;
    color: var(--default-color);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
}

.offer-detail__share-message::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff8d6;
    transform: translateX(-50%) rotate(45deg);
}

.offer-detail__share-options {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 20px;
}

.offer-detail__share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: none;
    color: var(--white);
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        transform 0.15s ease;
}

.offer-detail__share-btn:hover {
    opacity: 0.88;
    color: var(--white);
}

.offer-detail__share-btn--active {
    transform: scale(0.95);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.offer-detail__share-btn--line {
    background: #06c755;
}

.offer-detail__share-btn--x {
    background: #000;
}

.offer-detail__icon-btn--favorite {
    background: #d1d5db;
    transform: scale(1);
    transform-origin: center center;
    transition: background-color 0.2s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.offer-detail__icon-btn--favorite-guest {
    background: #d9d9d9;
}

.offer-detail__icon-btn--favorite-active {
    background: var(--saffron-2);
}

.offer-detail__icon-btn--favorite svg {
    fill: var(--white);
}

@keyframes offer-detail-favorite-pop {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.offer-detail__icon-btn--pop {
    animation: offer-detail-favorite-pop 0.4s ease;
}

.offer-detail__cta-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.offer-detail__cta-stars {
    position: absolute;
    inset: -16px -2px;
    z-index: 2;
    pointer-events: none;
}

.offer-detail__cta-stars span {
    position: absolute;
    width: var(--star-size, 18px);
    height: var(--star-size, 18px);
    background: currentColor;
    color: #ffd400;
    clip-path: polygon(
        50% 0%,
        62% 38%,
        100% 50%,
        62% 62%,
        50% 100%,
        38% 62%,
        0% 50%,
        38% 38%
    );
    filter: drop-shadow(0 0 4px rgba(255, 208, 0, 1));
    animation: offer-detail-cta-twinkle 1.7s ease-in-out infinite;
}

.offer-detail__cta-stars span:nth-child(1) {
    top: 0;
    left: 26%;
    --star-size: 22px;
    animation-delay: 0s;
}

.offer-detail__cta-stars span:nth-child(2) {
    top: 0;
    left: calc(50% - 7px);
    --star-size: 14px;
    color: #ffc400;
    animation-delay: 0.22s;
}

.offer-detail__cta-stars span:nth-child(3) {
    top: 0;
    right: 26%;
    --star-size: 26px;
    animation-delay: 0.45s;
}

.offer-detail__cta-stars span:nth-child(4) {
    top: calc(50% - 8px);
    right: 0;
    --star-size: 16px;
    color: #ffe14a;
    animation-delay: 0.12s;
}

.offer-detail__cta-stars span:nth-child(5) {
    bottom: 0;
    right: 24%;
    --star-size: 20px;
    color: #ffc400;
    animation-delay: 0.68s;
}

.offer-detail__cta-stars span:nth-child(6) {
    bottom: 0;
    left: calc(50% - 7px);
    --star-size: 14px;
    animation-delay: 0.38s;
}

.offer-detail__cta-stars span:nth-child(7) {
    top: calc(50% - 9px);
    left: 0;
    --star-size: 18px;
    color: #ffe14a;
    animation-delay: 0.9s;
}

.offer-detail__cta-stars span:nth-child(8) {
    top: 22%;
    right: 0;
    left: auto;
    --star-size: 12px;
    color: #ffc400;
    animation-delay: 1.05s;
}

.offer-detail__cta {
    --offer-cta-from: #ff9a4a;
    --offer-cta-mid: #ff5d23;
    --offer-cta-to: #f03a2a;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 240px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--offer-cta-from) 0%, var(--offer-cta-mid) 46%, var(--offer-cta-to) 100%);
    color: var(--white);
    line-height: 1;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 -2px 0 rgba(160, 30, 12, 0.18) inset;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.offer-detail__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 255, 255, 0.42) 50%,
        transparent 62%,
        transparent 100%
    );
    transform: translateX(-130%);
    pointer-events: none;
    animation: offer-detail-cta-shine 3.8s ease-in-out infinite;
}

.offer-detail__cta-arrow {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: var(--white);
    font-size: 11px;
    line-height: 1;
}

.offer-detail__cta-arrow i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
}

.offer-detail__cta-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(140, 30, 10, 0.18);
}

@media (min-width: 1024px) {
    .offer-detail__cta {
        width: 260px;
        height: 56px;
        gap: 10px;
        padding: 0 20px;
    }

    .offer-detail__cta-text {
        font-size: 18px;
    }

    .offer-detail__cta-arrow {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .offer-detail__cta:hover {
        color: var(--white);
        filter: brightness(1.05);
        transform: translateY(-2px);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.5) inset,
            0 -2px 0 rgba(160, 30, 12, 0.18) inset;
    }

    .offer-detail__cta:active {
        transform: translateY(1px);
        filter: brightness(0.98);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.35) inset;
    }
}

.offer-detail__cta:focus-visible {
    outline: 3px solid #ffd24a;
    outline-offset: 3px;
}

.offer-detail__cta--view {
    --offer-cta-from: #3dd89a;
    --offer-cta-mid: #20c07a;
    --offer-cta-to: #159a62;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 -2px 0 rgba(12, 90, 55, 0.22) inset;
}

.offer-detail__cta--view::before {
    animation: none;
    background: none;
}

.offer-detail__cta--view .offer-detail__cta-text {
    text-shadow: 0 1px 0 rgba(10, 70, 40, 0.2);
}

.offer-detail__cta--view:focus-visible {
    outline-color: #7ee0b4;
}

@media (hover: hover) and (pointer: fine) {
    .offer-detail__cta--view:hover {
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.5) inset,
            0 -2px 0 rgba(12, 90, 55, 0.22) inset;
    }

    .offer-detail__cta--view:active {
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
    }
}

@keyframes offer-detail-cta-shine {
    0%,
    58% {
        transform: translateX(-130%);
    }

    78%,
    100% {
        transform: translateX(130%);
    }
}

@keyframes offer-detail-cta-twinkle {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.65) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1) rotate(18deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .offer-detail__cta::before,
    .offer-detail__cta-stars span {
        animation: none;
    }

    .offer-detail__cta-stars span {
        opacity: 0.85;
        transform: none;
    }

    .offer-detail__cta {
        transition: none;
    }
}

/* Referral */
.offer-detail__referral {
    margin-top: 30px;
}

.offer-detail__referral-heading {
    display: none;
}

.offer-detail__referral-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
}

.offer-detail__referral-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.offer-detail__referral-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.offer-detail__referral-copy {
    flex: 1;
    min-width: 0;
}

.offer-detail__referral-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 4px;
    line-height: 1.4;
}

.offer-detail__referral-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.offer-detail__referral-link {
    align-self: stretch;
    text-align: center;
    font-size: 13px;
    border-radius: 6px;
    padding: 10px 16px;
}

@media (min-width: 1024px) {
    .offer-detail__referral-heading {
        display: block;
        font-size: 25px;
        font-weight: bold;
        margin: 0 0 8px;
    }

    .offer-detail__referral-card {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
        padding: 8px;
    }

    .offer-detail__referral-body {
        align-items: center;
        gap: 28px;
        flex: 1;
        min-width: 0;
    }

    .offer-detail__referral-icon {
        width: auto;
        height: auto;
        margin-left: 23px;
    }

    .offer-detail__referral-title {
        display: none;
    }

    .offer-detail__referral-text {
        font-size: 15px;
        font-weight: bold;
    }

    .offer-detail__referral-link {
        align-self: center;
        width: auto;
        margin-left: auto;
        margin-top: 0;
        font-size: 12px;
        padding: inherit;
    }
}

/* Related offers */
.offer-detail__related {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow: visible;
}

@media (max-width: 1023px) {
    .offer-detail__related {
        overflow: hidden;
    }
}

.offer-detail__related-title {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
    margin-top: 60px;
    margin-bottom: 0;
    padding-left: 8px;
    padding-right: 8px;
}

@media (min-width: 1024px) {
    .offer-detail__related-title {
        padding-left: 0;
        padding-right: 0;
    }
}

.offer-detail__related-more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.offer-detail__related-more-btn {
    height: 30px;
    width: fit-content;
    padding: 4px 13.9px;
}

.offer-detail__related-more-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.offer-detail__related-more-text {
    font-size: 14px;
}

@media (min-width: 1024px) {
    .offer-detail__related-more-text {
        font-size: 16px;
    }
}

/* Mobile bottom bar */
.offer-detail__mobile-bar {
    position: fixed;
    bottom: 56px;
    left: 0;
    width: 100%;
    z-index: 50;
}

@media (min-width: 640px) {
    .offer-detail__mobile-bar {
        display: none;
    }
}

.offer-detail__mobile-bar-list {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    gap: 12px;
    margin: 0;
    list-style: none;
    background: var(--gray-bg-color);
}

.offer-detail__mobile-bar-item {
    flex-shrink: 0;
}

.offer-detail__mobile-cta {
    width: min(260px, calc(100vw - 110px));
    height: 48px;
    gap: 6px;
    padding: 0 16px;
}

.offer-detail__mobile-cta .offer-detail__cta-text {
    font-size: 17px;
}

.offer-detail__mobile-cta .offer-detail__cta-arrow {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.offer-detail__mobile-bar .offer-detail__cta-stars {
    inset: -14px 0;
}

/* 広告詳細ページ専用タブ（共通 .tabs の修飾） */
.tabs--offer-detail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tabs--offer-detail .tabs__nav {
    justify-content: stretch;
    flex-wrap: nowrap;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .tabs--offer-detail .tabs__nav {
        margin-top: 40px;
        border-bottom: 2px solid var(--info-color);
    }
}

@media (max-width: 640px) {
    /* 検索窓の sticky 範囲をタブ直前で終わらせ、ブラウザが押し出す */
    .offer-search-sticky-scope {
        height: var(--offer-search-scope-height, auto);
        margin-bottom: calc(var(--offer-search-height, 0px) - var(--offer-search-scope-height, 0px));
        pointer-events: none;
        overflow-anchor: none;
    }

    .offer-search-sticky-scope .site-header__search-row {
        pointer-events: auto;
        overflow: visible;
    }

    /* 検索・サジェスト表示中はスコープごとタブより前面に出す */
    html.is-mobile-search-active .offer-search-sticky-scope,
    html.is-search-suggest-open .offer-search-sticky-scope {
        position: relative;
        z-index: 60;
        overflow: visible;
    }

    html.is-mobile-search-active .site-header__search-row,
    html.is-search-suggest-open .site-header__search-row,
    body.offer-show .site-header__search-row.is-search-active {
        z-index: 60;
        overflow: visible;
    }

    html.is-mobile-search-active .tabs--offer-detail .tabs__nav,
    html.is-search-suggest-open .tabs--offer-detail .tabs__nav {
        z-index: 1;
    }

    .tabs--offer-detail .tabs__nav {
        position: sticky;
        top: 0;
        z-index: 51;
        background: #fff;
        border-bottom: 2px solid var(--info-color);
        box-shadow: var(--shadow-sm);
    }

    .tabs--offer-detail .tabs__tab {
        padding: 8px 4px;
        font-size: 11px;
        line-height: 1.3;
    }

    .tabs--offer-detail .tabs__panel-body {
        font-size: 12px;
    }
}

.tabs--offer-detail .tabs__tab {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    font-size: 13px;
    text-align: center;
}

.tabs--offer-detail .tabs__tab + .tabs__tab {
    margin-left: -1px;
}

@media (min-width: 1024px) {
    .tabs--offer-detail .tabs__tab {
        padding: 10px 24px;
        font-size: 16px;
    }
}

.tabs--offer-detail .tabs__panel-body {
    font-size: 14px;
}

@media (min-width: 1024px) {
    .tabs--offer-detail .tabs__panel-body {
        padding: 30px;
    }
}
