/* ============================================
   PRODUCT-CARD-EXPAND.CSS
   SPίTI Brand · Clean Version
   ============================================ */

/* ══════════════════════════════════════════
   1. MODAL 默認隱藏
══════════════════════════════════════════ */

.eye_modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -1 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 未展開時，modal 及子元素完全不可見 */
.showcase:not(.expanded) .eye_modal,
.showcase:not(.expanded) .eye_modal *,
.showcase:not(.expanded) .eye_close {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

/* ══════════════════════════════════════════
   2. 背景遮罩
══════════════════════════════════════════ */

.expand-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 26, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.expand-overlay.active {
    display: block;
    opacity: 1;
}

/* ══════════════════════════════════════════
   3. 展開狀態 - 卡片
══════════════════════════════════════════ */

.showcase {
    position: relative;
    overflow: visible;
}

.showcase.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 760px !important;
    max-height: 92vh !important;
    z-index: 10001 !important;
    overflow: hidden !important;
    border-radius: 0 !important;        /* ← 移除圓角 */
    background: transparent !important; /* ← 改透明 */
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;        /* ← 移除陰影，交給 eye_modal-content */
    animation: expandIn 0.32s cubic-bezier(0.34, 1.36, 0.64, 1);
    display: flex !important;
    flex-direction: column !important;
}

.showcase.expanded::before,
.showcase.expanded::after { display: none !important; }

@keyframes expandIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
}

/* 隱藏原始卡片內容 */
.showcase.expanded .showcase-banner,
.showcase.expanded .showcase-content,
.showcase.expanded .showcase-actions {
    display: none !important;
}

/* ══════════════════════════════════════════
   4. 展開時 - Modal 內容顯示
══════════════════════════════════════════ */

.showcase.expanded .eye_modal {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
    position: static !important;
    z-index: auto !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    clip: auto !important;
    left: auto !important;
    flex-direction: column !important;
    background: transparent !important;      /* ⭐ 加這行 */
    align-items: stretch !important;         /* ⭐ 加這行 */
    justify-content: stretch !important;     /* ⭐ 加這行 */
}

.showcase.expanded .eye_modal-content {
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;              /* ⭐ 改這行（原本 900px） */
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(76,202,184,0.12) !important;
    border: none !important;
    padding: 0 !important;
}

/* ══════════════════════════════════════════
   5. 關閉按鈕
══════════════════════════════════════════ */

.eye_close {
    position: fixed !important;
    top: calc(4% + 14px) !important;
    right: calc(5% + 14px) !important;
    z-index: 10002 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.95) !important;
    border: 1.5px solid rgba(0,0,0,0.08) !important;
    display: none !important; /* 默認隱藏 */
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 20px !important;
    color: #636e72 !important;
    line-height: 1 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.showcase.expanded .eye_close {
    display: flex !important;
}

.eye_close:hover {
    background: #ff6b6b !important;
    color: #fff !important;
    border-color: #ff6b6b !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 14px rgba(255,107,107,0.4) !important;
}

.eye_close:focus-visible {
    outline: 3px solid rgba(76,202,184,0.5);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════
   6. 標題 Header Band
══════════════════════════════════════════ */

.modal-header-band {
    background: linear-gradient(135deg, #4CCAB8 0%, #2da898 100%);
    padding: 28px 32px 24px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0;
}

.modal-header-band::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.modal-header-band::after {
    content: '';
    position: absolute;
    bottom: -30px; left: 40px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.modal-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.modal-product-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    max-width: 90%;
}

.modal-product-subtitle {
    color: rgba(255,255,255,0.82);
    font-size: 13px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════
   7. Scrollable Body
══════════════════════════════════════════ */

.modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 24px 32px 32px;
    scroll-behavior: smooth;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: #4CCAB8; border-radius: 3px; }

/* ══════════════════════════════════════════
   8. Description
══════════════════════════════════════════ */

.modal-description {
    font-size: 13.5px;
    color: #555;
    line-height: 1.75;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fffe;
    border-left: 3px solid #4CCAB8;
    border-radius: 0 10px 10px 0;
}

/* ══════════════════════════════════════════
   9. Feature Pills
══════════════════════════════════════════ */

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.feature-pills span {
    background: #e8faf7;
    color: #2a9d8f;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 50px;
    border: 1px solid rgba(76,202,184,0.25);
}

/* ══════════════════════════════════════════
   10. Section Blocks
══════════════════════════════════════════ */

.modal-section {
    margin-bottom: 24px;
}

.modal-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #2d3436;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-title::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, #e0f7f4, transparent);
    border-radius: 1px;
}

/* ══════════════════════════════════════════
   11. Color Grid
══════════════════════════════════════════ */

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.color-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.color-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.color-card:hover img,
.color-card.selected img {
    border-color: #4CCAB8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(76,202,184,0.3);
}

.color-card span {
    font-size: 11px;
    font-weight: 500;
    color: #636e72;
    text-align: center;
}

/* ══════════════════════════════════════════
   12. Specs Grid
══════════════════════════════════════════ */

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.spec-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #eee;
    transition: border-color 0.2s;
}

.spec-item:hover { border-color: #4CCAB8; }

.spec-label {
    font-size: 10.5px;
    font-weight: 600;
    color: #4CCAB8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
}

.spec-value {
    font-size: 13px;
    font-weight: 500;
    color: #2d3436;
}

/* ══════════════════════════════════════════
   13. Buy Buttons
══════════════════════════════════════════ */

.buy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.buy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1.5px solid #e8e8e8;
    text-decoration: none;
    background: #fff;
    gap: 8px;
    transition: all 0.22s;
}

.buy-card:hover {
    border-color: #4CCAB8;
    background: #f0fffe;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76,202,184,0.18);
}

.buy-card.official {
    border-color: #4CCAB8;
    background: linear-gradient(135deg, #4CCAB8, #38b8a6);
}

.buy-card-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 1px;
}

.buy-card-info span {
    font-size: 11px;
    color: #4CCAB8;
    font-weight: 500;
}

.buy-card.official .buy-card-info strong,
.buy-card.official .buy-card-info span { color: #fff; }

.buy-card ion-icon {
    font-size: 20px;
    color: #4CCAB8;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.buy-card.official ion-icon { color: rgba(255,255,255,0.85); }
.buy-card:hover ion-icon { transform: translateX(3px); }
.buy-card.official:hover { box-shadow: 0 8px 24px rgba(76,202,184,0.4); }

/* ══════════════════════════════════════════
   14. Footer Note
══════════════════════════════════════════ */

.modal-footer-note {
    font-size: 11px;
    color: #b2bec3;
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   15. Responsive
══════════════════════════════════════════ */

@media (max-width: 768px) {
    .showcase.expanded {
        width: 95vw !important;
        max-height: 95vh !important;
    }
    .eye_close {
        top: calc(2.5% + 10px) !important;
        right: calc(2.5% + 10px) !important;
    }
    .specs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .modal-header-band { padding: 22px 20px 18px; }
    .modal-product-title { font-size: 17px; }
    .modal-body { padding: 18px 20px 24px; }
    .buy-grid { grid-template-columns: 1fr 1fr; }
    .colors-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .showcase.expanded {
        width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    .eye_close {
        top: 10px !important;
        right: 10px !important;
    }
    .buy-grid { grid-template-columns: 1fr; }
    .colors-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════
   16. Accessibility & Print
══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .showcase.expanded,
    .eye_close,
    .color-card img,
    .buy-card { animation: none !important; transition: none !important; }
}

@media print {
    .eye_modal, .expand-overlay, .eye_close { display: none !important; }
    .showcase.expanded {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
}

.eye_modal-content h2{
    color: #ffffff;

}
.eye_modal-content .modal-product-subtitle{
    color: #ffffff;
}

.eye_modal-content .modal-footer-note{
    font-size: 12px;
}
