/* ========================================
   Danrakuko - Main Stylesheet
   ======================================== */

/* ==================== Variables ==================== */
:root {
    --primary-color: #065F46;
    --primary-dark: #064E3B;
    --primary-light: #34D399;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --dark-color: #1F2937;
    --light-color: #F9FAFB;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
}

/* ==================== Bootstrap Color Overrides ==================== */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.text-info { color: var(--primary-light) !important; }

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #F5F5F7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* ==================== Utilities ==================== */
.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Navigation ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
}

/* ==================== Currency Notice (Desktop) ==================== */
.currency-notice {
    background: #FFFBEB; /* amber-50 */
    border-bottom: 1px solid #FDE68A; /* amber-300 */
}

.currency-notice .container {
    min-height: 36px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: var(--dark-color);
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-light {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ==================== Cards ==================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ==================== Group Buy Cards ==================== */
.groupbuy-card {
    position: relative;
    height: 100%;
}

.groupbuy-card .badge-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.groupbuy-card .price-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.groupbuy-card .original-price {
    text-decoration: line-through;
    color: #9CA3AF;
    font-size: 0.875rem;
}

.groupbuy-card .discount-badge {
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-bar-custom {
    height: 8px;
    border-radius: 4px;
    background: #E5E7EB;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--secondary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ==================== Forms ==================== */
.form-control,
.form-select {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-text {
    color: #6B7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==================== Alerts ==================== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ==================== Hero Section ==================== */
.hero-section {
    background: linear-gradient(135deg, #064E3B 0%, #065F46 50%, #047857 100%);
    padding: 2.5rem 0 3rem;
    color: white;
    position: relative;
    overflow: visible;
    min-height: 420px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 50%);
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #F5F5F7 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 50px; /* 为底部的徽章和按钮留出空间 */
}

.hero-content .btn {
    position: relative;
    z-index: 3;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 6px rgba(0,0,0,0.1);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1.75rem;
    line-height: 1.6;
    font-weight: 400;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== Features Section ==================== */
.feature-box {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(6, 95, 70, 0.15);
    border-color: rgba(6, 95, 70, 0.1);
}

.feature-box:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.1) 0%, rgba(4, 120, 87, 0.1) 100%);
    color: var(--primary-color);
    font-size: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-box h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.feature-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6B7280;
    margin: 0;
}

/* ==================== Footer ==================== */
footer {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: white;
    padding-top: 3rem;
    padding-bottom: 1.5rem;
}

footer h5 {
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

footer a {
    color: #9CA3AF;
    transition: var(--transition);
}

footer a:hover {
    color: white;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-section {
        padding: 5rem 0 4rem;
    }
    
    .hero-section::after {
        height: 80px;
    }
    
    .feature-box {
        padding: 2rem 1.25rem;
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* ==================== Loading Animation ==================== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(6, 95, 70, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Custom Scrollbar ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== Hero Section Carousel ==================== */
.hero-section .carousel {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-section .carousel-inner {
    border-radius: var(--border-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.hero-section .carousel-item {
    min-height: 320px;
    padding: 1.5rem;
}

.carousel-text {
    padding: 0.75rem 1.5rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 推荐团购徽章（限制宽度，避免被拉满行） */
.featured-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    width: auto;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
}

.carousel-text .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.carousel-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.3;
}

.carousel-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.price-display {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
}

.carousel-price {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    display: inline-block;
    line-height: 1;
}

.carousel-original-price {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: line-through;
}

.discount-badge-large {
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: white;
    padding: 0.35rem 0.7rem;
    border-radius: 18px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 6px rgba(251, 146, 60, 0.3);
    display: inline-block;
    white-space: nowrap;
}

.progress-bar-hero {
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.3rem 0;
}

.progress-bar-hero .progress-bar-fill {
    background: linear-gradient(90deg, #10B981, #34D399);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: var(--progress, 0%);
}

.carousel-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0.75rem;
    min-height: 250px;
}

.carousel-image {
    width: 100%;
    max-width: 350px;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.carousel-image-placeholder {
    width: 100%;
    max-width: 350px;
    height: 250px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 3rem;
}

.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    top: calc(50% + 10px);
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    z-index: 2; /* 降低层级，避免覆盖文字 */
}

.hero-section .carousel-control-prev:hover,
.hero-section .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.35);
    opacity: 1;
}

.hero-section .carousel-control-prev {
    left: 0.25rem; /* 稍微外移 */
}

.hero-section .carousel-control-next {
    right: 0.25rem; /* 稍微外移 */
}

.hero-section .carousel-indicators {
    bottom: 0.5rem;
    margin-bottom: 0;
}

.hero-section .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.hero-section .carousel-indicators .active {
    background-color: white;
    transform: scale(1.1);
}

/* Hero Badges - Bottom Left (Display Only) */
.hero-badges-left {
    position: absolute;
    bottom: 1rem;
    left: 1.5rem;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 50%;
    align-items: center;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 400;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    cursor: default;
    user-select: none;
    letter-spacing: 0.01em;
}

.feature-badge i {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Hero Quick Links - Bottom Right (Clickable) */
.hero-quick-links {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    z-index: 4;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quick-link-btn {
    background: white;
    color: var(--primary-color);
    padding: 0.45rem 0.85rem;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(6, 95, 70, 0.1);
}

.quick-link-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 95, 70, 0.12), transparent);
    transition: left 0.5s ease;
}

.quick-link-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.4), 0 2px 4px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.quick-link-btn:hover::before {
    left: 100%;
}

.quick-link-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.quick-link-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.quick-link-btn:hover i {
    transform: translateX(2px);
}

/* Responsive adjustments for Hero Section */
@media (max-width: 992px) {
    .hero-section {
        padding: 2rem 0 2.5rem;
        min-height: auto;
    }
    
    .hero-content {
        padding-bottom: 20px;
    }
    
    .hero-section .carousel-item {
        min-height: auto;
        padding: 1.25rem;
    }
    
    .carousel-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-description {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .carousel-price {
        font-size: 1.75rem;
    }
    
    .carousel-image-wrapper {
        min-height: 200px;
    }
    
    .carousel-image {
        height: 200px;
        max-width: 300px;
    }
    
    .hero-badges-left {
        position: static;
        margin-top: 2rem;
        margin-left: 0;
        justify-content: center;
        max-width: 100%;
        width: 100%;
    }
    
    .feature-badge {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--primary-light);
        color: var(--primary-color);
        opacity: 1;
    }
    
    .hero-quick-links {
        position: static;
        margin-top: 1rem;
        margin-right: 0;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 3rem;
    }
    
    .hero-section .carousel-item {
        padding: 1rem;
        min-height: auto;
    }
    
    .carousel-title {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
    }
    
    .carousel-description {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .carousel-price {
        font-size: 1.5rem;
    }
    
    .carousel-original-price {
        font-size: 1.1rem;
    }
    
    .carousel-text .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .carousel-image-wrapper {
        min-height: 200px;
    }
    
    .carousel-image {
        height: 200px;
        max-width: 280px;
    }
    
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        width: 35px;
        height: 35px;
    }
    
    .hero-section .carousel-control-prev {
        left: 0.5rem;
    }
    
    .hero-section .carousel-control-next {
        right: 0.5rem;
    }
    
    .hero-badges-left {
        gap: 0.35rem;
        padding: 0 1rem;
        bottom: auto;
        position: static;
        margin-top: 1.5rem;
    }
    
    .feature-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--primary-light);
        color: var(--primary-color);
        opacity: 1;
    }
    
    .feature-badge i {
        font-size: 0.75rem;
    }
    
    .hero-quick-links {
        flex-wrap: nowrap;
        gap: 0.4rem;
        padding: 0 1rem;
        bottom: auto;
        position: static;
        margin-top: 0.75rem;
    }
    
    .quick-link-btn {
        font-size: 0.75rem;
        padding: 0.45rem 0.75rem;
        flex: 1;
        min-width: auto;
    }
    
    .quick-link-btn i {
        font-size: 0.8rem;
    }
}