/* Instig Shop Management - Front-end Styles */

.instig-shops-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Card ── */
.instig-shop-card {
    display: flex;
    position: relative;
    overflow: hidden;
    border: 2px solid;
    border-radius: 8px;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.instig-shop-card.odd {
    flex-direction: row;
    background: var(--color-a);
    border-color: var(--border-color-a);
}

.instig-shop-card.even {
    flex-direction: row-reverse;
    background: var(--color-b);
    border-color: var(--border-color-b);
}

.instig-shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.instig-shop-card.odd:hover {
    border-color: color-mix(in srgb, var(--border-color-a) 70%, white);
}

.instig-shop-card.even:hover {
    border-color: color-mix(in srgb, var(--border-color-b) 70%, white);
}

.instig-shop-card.odd .instig-shop-content {
    color: var(--text-color-a);
    text-align: right;
    align-items: flex-end;
}

.instig-shop-card.odd .instig-shop-meta {
    flex-direction: row-reverse;
}

.instig-shop-card.even .instig-shop-content {
    color: var(--text-color-b);
}

/* ── Image wrapper (gold drop-shadow follows child clip-path) ── */
.instig-shop-image-wrap {
    flex: 0 0 240px;
    position: relative;
}

.instig-shop-card.odd .instig-shop-image-wrap {
    filter: drop-shadow(2px 0 0 #d4a843);
}

.instig-shop-card.even .instig-shop-image-wrap {
    filter: drop-shadow(-2px 0 0 #d4a843);
}

/* ── Image / Logo with diagonal edge ── */
.instig-shop-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 24px;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 8px
        ),
        rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
    position: relative;
}

.instig-shop-card.odd .instig-shop-image {
    clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%);
    padding-right: 140px;
}

.instig-shop-card.even .instig-shop-image {
    clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
    padding-left: 140px;
}

/* Gradient overlay along diagonal edge */
.instig-shop-card.odd .instig-shop-image::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--color-a));
    pointer-events: none;
}

.instig-shop-card.even .instig-shop-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to left, transparent, var(--color-b));
    pointer-events: none;
}

.instig-shop-image img {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 16px 4px 16px 4px;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.15));
    transition: transform 0.35s ease, filter 0.35s ease;
}

.instig-shop-card:hover .instig-shop-image img {
    transform: scale(1.06);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
}

/* ── Content ── */
.instig-shop-content {
    flex: 1;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.instig-shop-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: inherit;
}

.instig-shop-desc {
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
    line-height: 1.6;
    color: inherit;
}

/* ── Meta (tag + amount) ── */
.instig-shop-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
    margin: 6px 0;
}

.instig-shop-card.odd .instig-shop-tag {
    display: inline-flex;
    align-items: center;
    background: var(--tag-color-a);
    color: #fff;
    padding: 4px 16px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

.instig-shop-card.even .instig-shop-tag {
    display: inline-flex;
    align-items: center;
    background: var(--tag-color-b);
    color: #fff;
    padding: 4px 16px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

.instig-shop-amount {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instig-shop-amount::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='10' fill='%23f5c518' stroke='%23b8860b' stroke-width='1.5'/><circle cx='12' cy='12' r='7.5' fill='none' stroke='%23b8860b' stroke-width='0.7'/><text x='12' y='17' text-anchor='middle' fill='%23b8860b' font-size='14' font-weight='900' font-family='Arial,sans-serif'>$</text></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* ── Action (button stays in content) ── */
.instig-shop-action {
    margin-top: auto;
    padding-top: 8px;
}

/* ── Contact sidebar (phone + LINE on the right) ── */
.instig-shop-contact {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.instig-shop-card.even .instig-shop-contact {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.instig-shop-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s;
}

.instig-shop-phone .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.instig-shop-phone:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Odd cards: darker tone for phone & separator on lighter bg ── */
.instig-shop-card.odd .instig-shop-contact {
    border-left-color: #5b5b5b;
}

.instig-shop-card.odd .instig-shop-phone {
    background: rgba(91, 91, 91, 0.08);
    border-color: #5b5b5b;
    color: #5b5b5b;
}

.instig-shop-card.odd .instig-shop-phone:hover {
    background: rgba(91, 91, 91, 0.18);
    color: #5b5b5b;
}

.instig-shop-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #06C755;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    transition: opacity 0.3s;
}

.instig-shop-line:hover {
    opacity: 0.85;
    color: #fff;
}

.instig-shop-card.odd .instig-shop-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-color-a);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: opacity 0.3s;
    width: 100%;
    max-width: 220px;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.instig-shop-card.even .instig-shop-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-color-b);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: opacity 0.3s;
    width: 100%;
    max-width: 220px;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.instig-shop-card .instig-shop-button:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none !important;
}

.instig-shop-card .instig-shop-button:visited,
.instig-shop-card .instig-shop-button:active,
.instig-shop-card .instig-shop-button:focus {
    color: #fff;
    text-decoration: none;
}

/* ── RWD Tablet ── */
@media (max-width: 1024px) {
    .instig-shop-image-wrap {
        flex: 0 0 180px;
    }

    .instig-shop-image {
        padding: 18px;
    }

    .instig-shop-card.odd .instig-shop-image {
        padding-right: 72px;
    }

    .instig-shop-card.even .instig-shop-image {
        padding-left: 72px;
    }

    .instig-shop-image img {
        max-width: 120px;
        max-height: 120px;
    }

    .instig-shop-content {
        padding: 22px 24px;
    }

    .instig-shop-title {
        font-size: 19px;
    }

    .instig-shop-phone,
    .instig-shop-line {
        width: 46px;
        height: 46px;
    }

    .instig-shop-phone .dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }
}

/* ── RWD Mobile ── */
@media (max-width: 768px) {
    .instig-shops-container {
        gap: 12px;
    }

    /* 橫式細長卡片，圖片左右交錯 */
    .instig-shop-card.odd {
        flex-direction: row;
    }

    .instig-shop-card.even {
        flex-direction: row-reverse;
    }

    .instig-shop-image-wrap {
        flex: 0 0 130px;
    }

    .instig-shop-card.odd .instig-shop-image-wrap {
        filter: drop-shadow(2px 0 0 #d4a843);
    }

    .instig-shop-card.even .instig-shop-image-wrap {
        filter: drop-shadow(-2px 0 0 #d4a843);
    }

    .instig-shop-image {
        padding: 10px;
    }

    .instig-shop-card.odd .instig-shop-image {
        clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%);
        padding-right: 56px;
        padding-left: 14px;
    }

    .instig-shop-card.even .instig-shop-image {
        clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
        padding-left: 56px;
        padding-right: 14px;
    }

    .instig-shop-card.odd .instig-shop-image::after {
        width: 60%;
    }

    .instig-shop-card.even .instig-shop-image::after {
        width: 60%;
    }

    .instig-shop-image img {
        max-width: 80px;
        max-height: 80px;
    }

    .instig-shop-content {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        gap: 2px;
    }

    .instig-shop-card.odd .instig-shop-content {
        text-align: right;
        align-items: flex-end;
    }

    .instig-shop-card.odd .instig-shop-meta {
        flex-direction: row-reverse;
    }

    .instig-shop-card.odd .instig-shop-action {
        align-self: stretch;
    }

    .instig-shop-title {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .instig-shop-desc {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .instig-shop-meta {
        gap: 6px;
        margin: 2px 0;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .instig-shop-tag {
        font-size: 11px !important;
        padding: 1px 8px !important;
    }

    .instig-shop-amount {
        font-size: 13px;
    }

    .instig-shop-action {
        padding-top: 2px;
    }

    .instig-shop-button {
        font-size: 12px !important;
        padding: 8px 18px !important;
        max-width: 100% !important;
    }

    .instig-shop-contact {
        flex-direction: column;
        gap: 0;
        padding: 0;
        border-left: none !important;
        border-right: none !important;
    }

    .instig-shop-card.odd .instig-shop-contact {
        border-left: 1px solid #5b5b5b !important;
    }

    .instig-shop-card.even .instig-shop-contact {
        border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .instig-shop-phone,
    .instig-shop-line {
        width: 40px;
        height: 40px;
    }

    .instig-shop-phone .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }

    .instig-shop-line {
        font-size: 10px;
    }

    .instig-shop-contact {
        gap: 0;
        padding: 8px 12px !important;
    }

    .instig-shop-contact .instig-shop-phone {
        margin-bottom: 10px;
        box-shadow: 0 11px 0 -10px rgba(255, 255, 255, 0.3);
    }

    .instig-shop-card.odd .instig-shop-contact .instig-shop-phone {
        box-shadow: 0 11px 0 -10px #5b5b5b;
    }

    .instig-shop-amount::before {
        width: 14px;
        height: 14px;
        margin-right: 4px;
        vertical-align: -3px;
    }
}

/* ── RWD Extra Small (very narrow phones) ── */
@media (max-width: 480px) {
    .instig-shop-image-wrap {
        flex: 0 0 92px;
    }

    .instig-shop-image {
        padding: 6px;
    }

    .instig-shop-card.odd .instig-shop-image {
        clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
        padding-right: 28px;
        padding-left: 8px;
    }

    .instig-shop-card.even .instig-shop-image {
        clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
        padding-left: 28px;
        padding-right: 8px;
    }

    .instig-shop-image img {
        max-width: 64px;
        max-height: 64px;
    }

    .instig-shop-content {
        padding: 8px 8px;
    }

    .instig-shop-title {
        font-size: 14px;
    }

    .instig-shop-desc {
        font-size: 11px;
    }

    .instig-shop-meta {
        flex-wrap: nowrap;
        white-space: nowrap;
        gap: 4px;
    }

    .instig-shop-card.odd .instig-shop-meta {
        flex-direction: row-reverse;
    }

    .instig-shop-tag {
        font-size: 10px !important;
        padding: 1px 6px !important;
        flex-shrink: 0;
    }

    .instig-shop-amount {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .instig-shop-amount::before {
        width: 12px;
        height: 12px;
        margin-right: 3px;
        vertical-align: -2px;
    }

    .instig-shop-button {
        font-size: 11px !important;
        padding: 6px 10px !important;
        white-space: nowrap;
    }

    .instig-shop-contact {
        padding: 6px 8px !important;
    }

    .instig-shop-phone,
    .instig-shop-line {
        width: 34px;
        height: 34px;
    }

    .instig-shop-phone .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .instig-shop-line {
        font-size: 9px;
    }
}
