/* ============================================
   공통 제품 카드 스타일
   메인페이지와 판매자 스토어에서 동일하게 사용
   ============================================ */

/* 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* 더 큰 화면에서 더 많은 열 표시 */
@media (min-width: 1400px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* 카드 베이스 */
.card {
    background: white;
    border: 1px solid white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

/* 보더 스타일 변형 */
.card-grid.border-minimal .card {
    border-color: white !important;
}

.card-grid.border-bordered .card {
    border-color: #e5e7eb !important;
}

/* 카드 대표 이미지 */
.card__thumbnail {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    position: relative;
}

.card__thumbnail--placeholder {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #cbd5e1;
}

/* 카드 바디 */
.card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 타입 레이블 */
.card__type {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 타이틀 */
.card__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text, #1f2937);
    line-height: 1.4;
}

/* 설명 */
.card__excerpt {
    color: var(--text-light, #6b7280);
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.5;
    flex: 1;
}

/* 푸터 */
.card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

/* 가격 */
.card__price {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #1f2937);
}

.card__price--free {
    color: #10b981;
}

.card__price--locked {
    color: #7c3aed;
}

.card__price--owned {
    color: #6366f1;
}

/* CTA 버튼/텍스트 */
.card__cta {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.2s;
}

.card:hover .card__cta {
    color: #475569;
}

/* 수정 버튼 (판매자 본인만 보임) */
.card__edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 10;
    text-decoration: none;
    color: var(--text, #1f2937);
    display: inline-block;
}

.card__edit-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

/* 빠른 실행 버튼 (구매한 제품) */
.card__quick-play {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.card__quick-play--bottariapp {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    box-shadow: 0 12px 25px rgba(236, 72, 153, 0.35);
}

.card__quick-play--webapp {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.25);
}

.card__quick-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.15);
}

.card__quick-play:active {
    transform: translateY(0);
}

/* 반응형 */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .card__thumbnail {
        height: 160px;
    }

    .card__body {
        padding: 16px;
    }

    .card__title {
        font-size: 16px;
    }

    .card__excerpt {
        font-size: 13px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card__thumbnail {
        height: 140px;
    }

    .card__body {
        padding: 12px;
    }

    .card__title {
        font-size: 14px;
    }

    .card__price {
        font-size: 14px;
    }
}

/* ============================================
   레이아웃별 스타일 변형
   ============================================ */

/* 표준형 (Standard) - 기본 디자인 */
.card-grid.layout-standard .card {
    /* 기본 스타일 사용 */
}

/* 컴팩트형 (Compact) - 작은 카드 */
.card-grid.layout-compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

@media (min-width: 1400px) {
    .card-grid.layout-compact {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

.card-grid.layout-compact .card {
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.card-grid.layout-compact .card:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.card-grid.layout-compact .card__thumbnail {
    height: 120px;
}

.card-grid.layout-compact .card__thumbnail--placeholder {
    font-size: 32px;
}

.card-grid.layout-compact .card__body {
    padding: 12px;
}

.card-grid.layout-compact .card__type {
    font-size: 10px;
    margin-bottom: 2px;
}

.card-grid.layout-compact .card__title {
    font-size: 15px;
    margin-bottom: 8px;
}

.card-grid.layout-compact .card__excerpt {
    display: none; /* 컴팩트형에서는 설명 숨김 */
}

.card-grid.layout-compact .card__footer {
    margin-top: 0;
}

.card-grid.layout-compact .card__price {
    font-size: 14px;
}

.card-grid.layout-compact .card__cta {
    display: none; /* 컴팩트형에서는 CTA 숨김 */
}

/* 대형 (Large) - 큰 카드 */
.card-grid.layout-large {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

@media (min-width: 1400px) {
    .card-grid.layout-large {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.card-grid.layout-large .card {
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.1);
}

.card-grid.layout-large .card:hover {
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15);
}

.card-grid.layout-large .card__thumbnail {
    height: 300px;
}

.card-grid.layout-large .card__thumbnail--placeholder {
    font-size: 64px;
}

.card-grid.layout-large .card__body {
    padding: 24px;
}

.card-grid.layout-large .card__type {
    font-size: 12px;
    margin-bottom: 6px;
}

.card-grid.layout-large .card__title {
    font-size: 22px;
    margin-bottom: 12px;
}

.card-grid.layout-large .card__excerpt {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.card-grid.layout-large .card__price {
    font-size: 20px;
    font-weight: 700;
}

.card-grid.layout-large .card__cta {
    font-size: 15px;
}

/* 미니멀 (Minimal) - 이미지 없는 카드 */
.card-grid.layout-minimal {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

@media (min-width: 1400px) {
    .card-grid.layout-minimal {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.card-grid.layout-minimal .card {
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
    padding: 20px;
}

.card-grid.layout-minimal .card:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.card-grid.layout-minimal .card__thumbnail {
    display: none; /* 미니멀형에서는 이미지 숨김 */
}

.card-grid.layout-minimal .card__body {
    padding: 0;
}

.card-grid.layout-minimal .card__type {
    font-size: 11px;
    margin-bottom: 4px;
}

.card-grid.layout-minimal .card__type::before {
    content: '';
    display: inline;
}

.card-grid.layout-minimal .card__title {
    font-size: 18px;
    margin-bottom: 16px;
}

.card-grid.layout-minimal .card__excerpt {
    display: none; /* 미니멀형에서는 설명 숨김 */
}

.card-grid.layout-minimal .card__price {
    font-size: 16px;
}

/* 옵션: 이미지 숨김 */
.card-grid.hide-thumbnail .card__thumbnail {
    display: none !important;
}

/* 옵션: 설명 숨김 */
.card-grid.hide-excerpt .card__excerpt {
    display: none !important;
}

/* 옵션: 호버 효과 비활성화 */
.card-grid.no-hover .card {
    transition: none;
}

.card-grid.no-hover .card:hover {
    transform: none;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

/* 반응형 - 레이아웃별 조정 */
/* 태블릿 */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* 모바일 */
@media (max-width: 640px) {
    /* 표준형과 미니멀은 모바일에서 2열 */
    .card-grid.layout-standard,
    .card-grid.layout-minimal {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* 컴팩트형은 작아서 2열 유지 */
    .card-grid.layout-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* 대형만 1열 */
    .card-grid.layout-large {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-grid.layout-large .card__thumbnail {
        height: 200px; /* 모바일에서는 높이 조정 */
    }

    .card-grid.layout-large .card__body {
        padding: 16px;
    }

    .card-grid.layout-large .card__title {
        font-size: 18px;
    }

    /* 모바일에서 카드 내부 조정 */
    .card__body {
        padding: 12px;
    }

    .card__title {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .card__excerpt {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .card__price {
        font-size: 14px;
    }

    .card__cta {
        font-size: 11px;
    }
}
