/* 客户前台布局与 typography tokens */
:root {
    --site-nav-height: 40px;
    --text-body: 1rem;
    --text-sm: 0.8125rem;
    --heading-page: 1.75rem;
    --price-list: 1rem;
    --price-detail: 1.5rem;
}

main {
    padding-top: var(--site-nav-height);
}

/* 导航栏下拉菜单激活状态样式 */
.dropdown-item.active {
    background-color: #8B4513 !important;
    color: white !important;
    font-weight: bold;
}

.dropdown-item.active:hover {
    background-color: #A0522D !important;
    color: white !important;
}

/* 帽子主题样式 */
.hero-section {
    position: relative;
    overflow: hidden;
}

.home-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2) !important;
}

.category-card:hover {
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.2) !important;
}

/* 帽子商品卡片特殊样式 */
.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(139, 69, 19, 0.2);
}

.product-card .card-img-top {
    border-bottom: 3px solid #8B4513;
}

/* 按钮样式优化 */
.btn-primary, .btn-success {
    background: linear-gradient(45deg, #8B4513, #D2691E);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-success:hover {
    background: linear-gradient(45deg, #A0522D, #CD853F);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.btn-outline-secondary {
    border-color: #8B4513;
    color: #8B4513;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: #8B4513;
    transform: translateY(-2px);
}

/* 价格标签样式 */
.price-section h4 {
    color: #8B4513 !important;
    font-weight: 600;
    font-size: var(--price-list);
}

.price-section .product-price,
.price-section h2.product-price {
    color: #8B4513 !important;
    font-weight: 600;
    font-size: var(--price-detail);
}

/* 标题颜色统一（Hero / 导航 / 页脚除外） */
h1, h2, h3, h4, h5, h6 {
    color: #8B4513;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section h5,
.hero-section h6,
.navbar h1, .navbar h2, .navbar h3, .navbar h4, .navbar h5, .navbar h6,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6 {
    color: inherit;
}

.text-success {
    color: #8B4513 !important;
}

/* 徽章样式 */
.badge.bg-danger {
    background: #8B4513 !important;
}

/* 导航栏品牌标识 */
.navbar-brand {
    color: #FFD700 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.navbar-brand i {
    color: #FFD700;
}

/* 自定义样式 */
body {
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    /* padding-top: 56px; 为固定导航栏留出空间 */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card {
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.price-section h3 {
    font-size: 2rem;
    font-weight: bold;
}

.btn {
    border-radius: 5px;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.badge {
    font-size: 0.8rem;
}

.alert {
    border-radius: 8px;
}

/* 固定商品图片尺寸 */
.product-image-container {
    width: 100%;
    max-width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 商品卡片中的图片尺寸 */
.card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
}

/* 商品详情页图片尺寸 */
.product-detail-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* 统一商品展示box样式 */
.product-showcase-box {
    position: relative;
    width: 100%;
    max-width: 500px;
    min-height: 500px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transition: all 0.3s ease;
}

.product-showcase-box:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 视频容器标准样式 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: all 0.3s ease;
}

.video-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}
.video-container:hover {
    transform: translateY(-5px);
    opacity: 0.8;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(64px, 6.25vw, 340px);
  height: clamp(64px, 6.25vw, 340px);
  border-radius: 50%;
  background: rgba(12, 12, 13, 0.3);
  transition: all 0.5s ease-in-out;
}
.play-btn img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(28px, 2.5vw, 120px);
  height: clamp(28px, 2.5vw, 120px);
}
.play-btn:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(28px, 2.5vw, 120px);
  height: clamp(28px, 2.5vw, 120px);
}

.video-play-button {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 11;
}

.play-button-circle {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    width: 80px;
    height: 80px;
}

.play-button-circle:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.play-text {
    display: none;
}


/* 响应式设计 */
@media (max-width: 767.98px) {
    .jumbotron h1 {
        font-size: 2rem;
    }

    .price-section h3 {
        font-size: 1.5rem;
    }

    .product-image-container {
        height: auto;
        max-height: 360px;
        min-height: 220px;
    }

    .product-showcase-box {
        min-height: auto;
        height: auto;
    }
}

/* 商品水平布局样式 */
.product-horizontal-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.product-image-section {
    flex: 0 0 auto;
    width: 420px;
}

.product-info-section {
    flex: 1;
    min-width: 300px;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .product-horizontal-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .product-image-section {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .product-showcase-box {
        min-height: auto;
    }
}



/* 视频弹窗 */
.video-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.video-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.video-modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-modal-header h3 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #eee;
    color: #333;
}

.video-modal-body {
    padding: 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* 客户订单号（短号 + 复制） */
.order-id-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem 0.5rem;
}

.order-id-label {
    color: #6c757d;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.order-id-short {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.orders-page .order-card-header .order-id-row {
    margin-bottom: 0.25rem;
}

.orders-page .order-meta-time {
    display: block;
}

/* 主站 FAB（购物车 / 我的订单 / 在线客服） */
.fab-stack-desktop {
    position: fixed;
    right: 0;
    bottom: 80px;
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.fab-stack-item {
    position: static;
}

#cart-float-mobile {
    position: fixed;
    right: 20px;
    bottom: 156px;
    z-index: 999;
}

#orders-float-mobile {
    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 999;
}

#contact-float-mobile {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
}

.fab-cart-link,
.fab-orders-link,
.fab-chat-btn {
    color: white;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    text-decoration: none;
}

.fab-cart-link {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.fab-orders-link {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.fab-chat-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.fab-cart-link:hover,
.fab-orders-link:hover,
.fab-chat-btn:hover {
    transform: translateX(-5px);
    color: white;
}

.fab-cart-mobile-btn,
.fab-orders-mobile-btn,
.fab-chat-mobile-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: white;
}

.fab-cart-mobile-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.fab-orders-mobile-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    position: relative;
}

.fab-chat-mobile-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.fab-cart-mobile-btn:hover,
.fab-orders-mobile-btn:hover,
.fab-chat-mobile-btn:hover {
    transform: scale(1.1);
    color: white;
}

.fab-icon {
    font-size: 1.5rem;
}

.fab-cart-link .fab-icon,
.fab-orders-link .fab-icon,
.fab-chat-btn .fab-icon {
    margin-right: 8px;
}

.fab-label {
    font-weight: 500;
}

#cart-float-badge {
    display: none;
    margin-left: 10px;
    min-width: 20px;
}

#cart-float-mobile-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    padding: 3px 6px;
    font-size: 0.75rem;
}

#orders-float-badge {
    display: none;
    margin-left: 10px;
    min-width: 20px;
}

#orders-float-mobile-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    padding: 3px 6px;
    font-size: 0.75rem;
}

#chat-unread-badge {
    display: none;
    margin-left: 10px;
    min-width: 20px;
    z-index: 1000;
}

/* 主站页脚（方案 C：紧凑 + 移动 legal collapse） */
.site-footer {
    padding: 1rem 0;
}

.site-footer-logo {
    font-size: 1rem;
    font-weight: 600;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    align-items: center;
}

.site-footer-links a {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    text-decoration: none;
}

.site-footer-links a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.site-footer-legal p {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.site-footer .footer-legal-toggle {
    font-size: 0.8125rem;
    text-decoration: none;
}

.site-footer .footer-legal-toggle:hover {
    color: rgba(255, 255, 255, 0.85) !important;
}

@media (min-width: 768px) {
    .site-footer .footer-legal-toggle {
        display: none !important;
    }

    .site-footer .footer-legal-detail.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible;
    }
}