/* Main CSS for Shopto */
:root {
    --primary-color: #4872c6;
    --primary-dark: #365a9e;
    --primary-light: #eef4ff;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --text-light: #666;
    --accent-color: #007bff;
    --white: #ffffff;
    --light-gray: #f9f9f9;
    --dark-gray: #222;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #4872c6 0%, #2a5298 100%);
    --gradient-light: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--dark-gray);
    margin-top: 0;
}

/* Header */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    margin-top: 80px;
    background: var(--dark-gray);
    /* Fallback */
    padding: 8rem 5% 6rem;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: var(--white);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero h1 span {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(72, 114, 198, 0.3);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 114, 198, 0.4);
}

/* Section Common */
section {
    padding: 6rem 5%;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 2.5rem;
    color: var(--dark-gray);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-title span {
    position: relative;
    display: inline-block;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Features Section */
.features {
    background-color: var(--white);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: left;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

/* 3D Icons */
.icon-3d {
    font-size: 4rem;
    background: linear-gradient(135deg, #4872c6, #2a5298);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.feature-card:hover .icon-3d {
    transform: translateY(-10px) scale(1.1);
    filter: drop-shadow(0 15px 15px rgba(72, 114, 198, 0.4));
}

.feature-card h3 {
    margin: 1rem 0;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Why Choose Us */
.why-choose-us {
    background-color: #f8fbff;
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.why-content h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-gray);
}

.why-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.why-list li {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    display: flex;
    align-items: flex-start;
    color: var(--text-color);
}

.why-list li i {
    color: var(--primary-color);
    margin-right: 15px;
    font-size: 1.2rem;
    margin-top: 4px;
}

.why-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s;
}

.why-image:hover img {
    transform: scale(1.02);
}

/* Success Stories */
.success-stories {
    background-color: var(--white);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.story-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--white);
    transition: transform 0.3s;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.story-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.story-content {
    padding: 2rem;
}

.story-content h4 {
    margin: 0 0 0.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.story-content p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Partners */
.partners {
    background-color: #fcfcfc;
    border-top: 1px solid #eee;
}

.partner-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: center;
}

.partner-logos img {
    max-height: 40px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s;
}

.partner-logos img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: #ccc;
    padding: 6rem 5% 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4rem;
}

.footer-col h4 {
    margin-bottom: 2rem;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-col ul li {
    margin-bottom: 1rem;
}

.footer-col ul li a {
    color: #888;
    transition: all 0.3s;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.copyright {
    border-top: 1px solid #333;
    margin-top: 5rem;
    padding-top: 2rem;
    color: #666;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        width: 100%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .why-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid,
    .story-grid {
        grid-template-columns: 1fr;
    }
}


/* 處理中覆蓋層 - 半透明背景，置中顯示 */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);           /* 現代毛玻璃效果，支援度高 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;                  /* 跟 card 一致圓角 */
    transition: opacity 0.3s ease;
}

.processing-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* 內容置中區塊 */
.processing-content {
    text-align: center;
    padding: 2rem;
    max-width: 320px;
}

/* 進度條容器 */
.progress-bar-container {
    width: 100%;
    height: 8px;                          /* 粗細可調整 */
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.2rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* indeterminate 動畫進度條（Material Design 風格簡化版） */
.progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #4872c6, #6ca0f6, #4872c6); /* 你的品牌藍色調 */
    background-size: 200% 100%;
    animation: indeterminate 2.2s linear infinite;
}

.progress-bar.indeterminate {
    transform: translateX(-50%);
    animation: indeterminate-slide 1.8s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

/* 關鍵動畫 */
@keyframes indeterminate-slide {
    0%   { transform: translateX(-100%) scaleX(0.3); }
    40%  { transform: translateX(0%)    scaleX(0.3); }
    60%  { transform: translateX(60%)   scaleX(0.4); }
    100% { transform: translateX(100%)  scaleX(0.3); }
}

@keyframes indeterminate {
    0%   { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

/* 文字樣式 */
.processing-text {
    color: #333;
    font-weight: 500;
    font-size: 1.05rem;
    margin: 0;
}



.tooltip-wrapper {
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px 12px;
    position: absolute;
    z-index: 10;
    bottom: 130%;          /* 顯示在上面 */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 小三角形（可選） */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}