/* ==========================================
   特斯拉风格产品详情页 CSS - 修复视频黑边222
   ========================================== */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #222;
    background: #fff;
}

/* ==========================================
   顶部导航 - 固定
   ========================================== */
.custom-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    height: 60px;
}

.custom-container {
    max-width: 100%;
    margin: 0;
    padding: 0 40px;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.back-btn,
.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #222;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-btn:hover,
.cart-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.back-btn svg {
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-3px);
}

.cart-btn {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 4px;
}

/* ==========================================
   主要内容区
   ========================================== */
.custom-main {
    padding: 0;
    margin-top: 60px;
}

/* ==========================================
   产品展示区 - 特斯拉左右分屏
   ========================================== */
.product-showcase {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 0;
    margin-bottom: 0;
    background: #fff;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 60px);
}

/* 产品图片 - 左侧全屏 */
.product-image-wrapper {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    background: #fff;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.product-image:hover img {
    transform: scale(1.02);
}

/* 产品信息 - 右侧 */
.product-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 80px 60px;
    background: #fff;
    min-height: calc(100vh - 60px);
    justify-content: center;
}

.product-name {
    font-size: 48px;
    font-weight: 700;
    color: #222;
    line-height: 1.1;
    margin: 0 0 20px 0;
    letter-spacing: -1px;
}

.product-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.product-tag {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.product-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.product-pricing {
    font-size: 52px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 10px 0 30px 0;
    line-height: 1;
}

.product-pricing del {
    font-size: 32px;
    color: #999;
    margin-right: 15px;
    text-decoration: line-through;
}

.product-description {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    line-height: 1.8;
    color: #666;
    font-size: 15px;
    margin-bottom: 20px;
}

/* 购物车按钮 */
.product-cart-actions {
    margin: 0 0 30px 0;
}

.add-to-cart-form {
    width: 100%;
}

.btn-add-cart,
.btn-purchased {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-cart {
    background: #222;
    color: white;
}

.btn-add-cart:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-purchased {
    background: #4CAF50;
    color: white;
    cursor: not-allowed;
    opacity: 0.9;
}

/* 菜谱描述盒子 */
.recipe-desc-box {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
    border-radius: 0;
}

.recipe-desc-box h3 {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    padding-bottom: 0;
    border-bottom: none;
}

.recipe-desc-content {
    line-height: 1.8;
    color: #666;
    font-size: 15px;
}

/* ==========================================
   食材区域
   ========================================== */
.ingredients-area {
    background: white;
    padding: 80px 40px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: #222;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #ff6b6b;
}

.ingredients-content {
    line-height: 2;
    color: #555;
    font-size: 16px;
}

.ingredients-content ul {
    list-style: none;
    padding: 0;
}

.ingredients-content li {
    padding: 12px 0 12px 35px;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.ingredients-content li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #ff6b6b;
    font-weight: 700;
    font-size: 20px;
}

.ingredients-content li:last-child {
    border-bottom: none;
}

/* ==========================================
   教学内容区域
   ========================================== */
.teaching-area {
    background: white;
    padding: 80px 40px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* 教学图片 */
.teaching-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.teaching-img-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #f8f8f8;
}

.teaching-img-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.teaching-img-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.teaching-img-item:hover img {
    transform: scale(1.05);
}

/* ==========================================
   教学视频 - 修复黑边
   ========================================== */
.teaching-video {
    margin-top: 40px;
}

.video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    background: #000;
}

/* 通用iframe样式 - 消除黑边 */
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}

/* YouTube特殊处理 - 完全填充 */
.video-player iframe[src*="youtube.com"],
.video-player iframe[src*="youtu.be"] {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border: none;
}

/* 未购买预览 */
.video-player.preview {
    position: relative;
}

.video-player.preview iframe {
    filter: blur(20px);
    opacity: 0.5;
    pointer-events: none;
}

.video-blur {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-blur iframe {
    filter: blur(20px);
    opacity: 0.5;
    pointer-events: none;
}

/* 已购买保护 */
.video-player.protected {
    position: relative;
}

.video-protection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   响应式设计
   ========================================== */

/* 平板 */
@media (max-width: 1024px) {
    .product-showcase {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .product-image-wrapper {
        position: relative;
        height: 60vh;
        top: 0;
    }

    .product-info-wrapper {
        padding: 60px 40px;
        min-height: auto;
    }

    .product-name {
        font-size: 40px;
    }

    .product-pricing {
        font-size: 44px;
    }

    .ingredients-area,
    .teaching-area {
        padding: 60px 40px;
    }

    .teaching-images {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 手机 */
@media (max-width: 768px) {
    .custom-container {
        padding: 0 20px;
    }

    .header-content {
        height: 55px;
    }

    .custom-header {
        height: 55px;
    }

    .custom-main {
        margin-top: 55px;
    }

    .product-showcase {
        min-height: auto;
    }

    .product-image-wrapper {
        height: 50vh;
    }

    .product-info-wrapper {
        padding: 40px 25px;
    }

    .product-name {
        font-size: 32px;
    }

    .product-pricing {
        font-size: 36px;
    }

    .section-title {
        font-size: 28px;
    }

    .ingredients-area,
    .teaching-area {
        padding: 40px 25px;
    }

    .teaching-images {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .teaching-img-item img {
        height: 220px;
    }

    .back-btn,
    .cart-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .custom-container {
        padding: 0 15px;
    }

    .product-image-wrapper {
        height: 40vh;
    }

    .product-info-wrapper {
        padding: 30px 20px;
    }

    .product-name {
        font-size: 26px;
    }

    .product-pricing {
        font-size: 32px;
    }

    .btn-add-cart,
    .btn-purchased {
        height: 50px;
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
    }

    .ingredients-area,
    .teaching-area {
        padding: 30px 20px;
    }

    .teaching-img-item img {
        height: 200px;
    }
}