html, body {
    overscroll-behavior: none;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.sp-container {
    background-color: #f5f5f7;
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d1d1f;
}

/* ===== Reset WooCommerce Button Styles ===== */
.sp-container .woocommerce div.product form.cart .button,
.sp-container .single_add_to_cart_button,
.sp-container .add_to_cart_button,
.sp-container .product_type_simple {
    float: none !important;
    display: block !important;
    width: 100% !important;
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.sp-container .woocommerce div.product form.cart .button:not(.sp-btn),
.sp-container .single_add_to_cart_button:not(.sp-btn),
.sp-container .add_to_cart_button:not(.sp-btn) {
    display: none !important;
}

.sp-actions .sp-btn.loading::after,
.sp-actions .sp-btn.added::after {
    display: none !important;
}

/* ===== Hero Area ===== */
.sp-hero {
    max-width: 1080px;
    margin: 0 auto 60px;
    padding: 0 24px;
}

.sp-hero__wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    display: flex;
    overflow: hidden;
    /* 移除 min-height，让高度由内容决定 */
}

/* Product Gallery */
.sp-gallery {
    flex: 1;
    background: #f0f0f2;
    position: relative;
    overflow: hidden;
    /* 改为 flex 容器，并拉伸子元素 */
    display: flex;
    align-items: stretch; /* 拉伸子元素 */
}

.sp-gallery__img {
    width: 100%;
    height: 100%; /* 改为 100% 填充容器 */
    object-fit: cover; /* 使用 cover 保持比例并填满容器 */
    display: block;
}

/* Product Info */
.sp-info {
    flex: 0 0 480px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto; /* 改为自动高度 */
}

.sp-info > div:last-child {
    margin-top: auto;
    padding-top: 32px;
}

.sp-info__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sp-pill {
    background: #f5f5f7;
    color: #6e6e73;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.sp-pill--link {
    text-decoration: none;
    transition: all 0.2s ease;
}

.sp-pill--link:hover {
    background: #e5e5e7;
    color: #1d1d1f;
    transform: translateY(-1px);
}

.sp-pill--tag {
    background: #e8f4f8;
    color: #0071e3;
}

.sp-pill--tag:hover {
    background: #d0e8f2;
    color: #0077ed;
}

.sp-rating {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
}

.sp-rating__star {
    color: #f5a623;
    margin-right: 2px;
}

.sp-rating__count {
    color: #86868b;
    margin-left: 4px;
}

.sp-info__title {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.sp-info__price {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1d1d1f;
}

.sp-info__price ins {
    text-decoration: none;
}

.sp-info__price del {
    color: #86868b;
    font-size: 0.7em;
    margin-right: 8px;
}

.sp-info__short-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #424245;
    margin: 16px 0 24px;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 8px;
}

.sp-info__short-desc::-webkit-scrollbar {
    width: 4px;
}

.sp-info__short-desc::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 2px;
}

.sp-info__short-desc::-webkit-scrollbar-thumb {
    background: #c0c0c5;
    border-radius: 2px;
}

.sp-info__short-desc p {
    margin: 0 0 12px;
}

.sp-info__short-desc p:last-child {
    margin-bottom: 0;
}

/* Product Description Card Section */
.sp-description-section {
    max-width: 1080px;
    margin: 0 auto 60px;
    padding: 0 24px;
}

.sp-description-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.sp-description-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f5f5f7;
}

.sp-description-card__title {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.sp-description-card__content {
    font-size: 16px;
    line-height: 1.7;
    color: #424245;
    position: relative;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
}

.sp-description-card__content p {
    margin: 0 0 16px;
}

.sp-description-card__content p:last-child {
    margin-bottom: 0;
}

.sp-desc-toggle {
    display: none !important;
}

/* Description Modal */
.sp-desc-modal {
    display: none;
    position: fixed;
    z-index: 9998;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.sp-desc-modal.active {
    display: flex;
    opacity: 1;
}

.sp-desc-modal__content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.sp-desc-modal.active .sp-desc-modal__content {
    transform: scale(1);
}

.sp-desc-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f5f5f7;
}

.sp-desc-modal__title {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.sp-desc-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #424245;
    font-size: 20px;
}

.sp-desc-modal__close:hover {
    background: #e5e5e7;
    transform: rotate(90deg);
}

.sp-desc-modal__body {
    font-size: 16px;
    line-height: 1.7;
    color: #424245;
}

.sp-desc-modal__body p {
    margin: 0 0 16px;
}

.sp-desc-modal__body p:last-child {
    margin-bottom: 0;
}

/* ===== Button Styles ===== */
.sp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.sp-actions .sp-btn {
    padding: 12px 32px !important;
    border-radius: 980px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    background: #ff9500 !important;
    color: #000000 !important;
    width: 100% !important;
    line-height: 1.5 !important;
    min-height: auto !important;
}

.sp-actions .sp-btn.sp-btn--primary,
.sp-actions #btnAddToCart {
    background: #ff9500 !important;
    color: #000000 !important;
}

.sp-actions .sp-btn.sp-btn--primary:hover,
.sp-actions #btnAddToCart:hover {
    background: #ffaa33 !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

.sp-actions .sp-btn.sp-btn--primary:active,
.sp-actions #btnAddToCart:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.sp-actions .sp-btn.sp-btn--primary.sp-loading,
.sp-actions #btnAddToCart.sp-loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.sp-actions .sp-btn.sp-btn--primary.sp-added,
.sp-actions #btnAddToCart.sp-added {
    background: #34c759 !important;
    color: #ffffff !important;
    pointer-events: none !important;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2) !important;
}

.sp-actions .sp-btn.sp-btn--secondary,
.sp-actions #btnBuyNow {
    background: #ff9500 !important;
    color: #000000 !important;
}

.sp-actions .sp-btn.sp-btn--secondary:hover,
.sp-actions #btnBuyNow:hover {
    background: #ffaa33 !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

.sp-actions .sp-btn.sp-btn--secondary:active,
.sp-actions #btnBuyNow:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.sp-actions .sp-btn.sp-btn--secondary.sp-loading,
.sp-actions #btnBuyNow.sp-loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.sp-unavailable {
    background: #f5f5f7;
    color: #86868b;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
}

/* ===== Already Purchased ===== */
.sp-already-purchased {
    width: 100%;
}

.sp-already-purchased .sp-btn {
    background: #34c759 !important;
    color: #ffffff !important;
    padding: 16px 32px !important;
    border-radius: 980px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: default !important;
    text-align: center !important;
    text-decoration: none !important;
    display: block !important;
    width: 100% !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2) !important;
    opacity: 0.9 !important;
    pointer-events: none !important;
}

/* ===== Button States ===== */
.sp-btn.sp-btn--disabled {
    background: #c7c7cc !important;
    color: #8e8e93 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.sp-actions .sp-btn.sp-added {
    background: #34c759 !important;
    color: #ffffff !important;
    pointer-events: none !important;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2) !important;
}

.sp-actions .sp-btn.sp-added:hover {
    background: #34c759 !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2) !important;
}

/* ===== Ingredients & Notes Section ===== */
.sp-ingredients-section {
    max-width: 1080px;
    margin: 0 auto 60px;
    padding: 0 24px;
}

.sp-ingredients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.sp-ingredient-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sp-ingredient-card--full {
    grid-column: 1 / -1;
}

.sp-ingredient-card__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1d1d1f;
    padding-bottom: 12px;
    border-bottom: 2px solid #f5f5f7;
}

.sp-ingredient-card__content {
    font-size: 15px;
    line-height: 1.7;
    color: #424245;
}

.sp-ingredient-card__content p {
    margin: 0 0 12px;
}

.sp-ingredient-card__content p:last-child {
    margin-bottom: 0;
}

.sp-ingredient-card__content ul,
.sp-ingredient-card__content ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

.sp-ingredient-card__content li {
    margin-bottom: 8px;
}

.sp-ingredient-content {
    font-size: 17px !important;
    line-height: 1.7;
}

.sp-ingredient-content p {
    font-size: 17px;
    margin-bottom: 12px;
}

.sp-notes-content {
    font-size: 17px !important;
    line-height: 1.7;
}

.sp-notes-content p {
    font-size: 17px;
    margin-bottom: 16px;
}

/* ===== Teaching Content Section ===== */
.sp-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
}

.sp-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.sp-section-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
}

.sp-section-subtitle {
    font-size: 20px;
    color: #86868b;
    font-weight: 400;
}

.sp-video-card {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    margin-bottom: 60px;
}

.sp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.sp-video-wrapper video,
.sp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.sp-steps__header {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
}

.sp-steps-slider {
    position: relative;
    margin: 40px 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f8f8;
    padding: 20px;
}

.sp-steps-slider__container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sp-step-slide {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: none;
}

.sp-step-slide.active {
    display: block;
}

.sp-step-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.sp-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.sp-slider-nav:hover {
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.sp-slider-nav:active,
.sp-slider-nav:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(0.98);
}

.sp-slider-nav--prev {
    left: 24px;
}

.sp-slider-nav--next {
    right: 24px;
}

.sp-slider-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sp-slider-nav svg {
    color: #1d1d1f;
    transition: transform 0.2s ease;
}

.sp-slider-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* ===== Reviews Section ===== */
.sp-reviews-section {
    max-width: 980px;
    margin: 60px auto 0;
    padding: 0 24px;
}

.sp-reviews-summary {
    margin-top: 20px;
}

.sp-reviews-rating {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.sp-reviews-average {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
}

.sp-reviews-number {
    font-size: 32px;
    color: #1d1d1f;
}

.sp-reviews-count {
    font-size: 16px;
    color: #86868b;
}

.sp-no-reviews {
    text-align: center;
    color: #86868b;
    font-size: 16px;
    padding: 20px 0;
}

.sp-reviews-content {
    margin-top: 40px;
}

/* ===== Lightbox ===== */
.sp-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-lightbox.active {
    display: flex;
    opacity: 1;
}

.sp-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

.sp-lightbox__close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sp-lightbox__close:hover {
    transform: scale(1.1);
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
    .sp-hero__wrapper {
        flex-direction: column;
    }

    .sp-info {
        flex: auto;
        padding: 32px;
    }

    .sp-gallery {
        height: 400px; /* 移动端给一个固定高度 */
        min-height: 400px;
        aspect-ratio: auto; /* 移除宽高比约束 */
    }

    .sp-gallery__img {
        object-fit: cover; /* 移动端也使用 cover */
    }

    .sp-info__short-desc {
        font-size: 15px;
        max-height: 100px;
        margin: 12px 0 20px;
    }

    .sp-ingredients-grid {
        grid-template-columns: 1fr;
    }

    .sp-description-card {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .sp-steps-slider {
        padding: 15px;
    }

    .sp-steps-slider__container {
        gap: 15px;
    }

    .sp-slider-nav {
        width: 40px;
        height: 40px;
    }

    .sp-slider-nav--prev {
        left: 10px;
    }

    .sp-slider-nav--next {
        right: 10px;
    }

    .sp-reviews-rating {
        flex-direction: column;
        gap: 10px;
    }

    .sp-slider-nav {
        -webkit-tap-highlight-color: transparent;
    }

    .sp-slider-nav:active {
        transform: translateY(-50%) scale(0.95);
    }

    .sp-desc-modal__content {
        padding: 24px;
        width: 95%;
    }

    .sp-desc-modal__title {
        font-size: 20px;
    }

    .sp-description-card {
        padding: 24px;
    }

    .sp-description-card__title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .sp-container {
        padding-top: 80px;
    }

    .sp-info__title {
        font-size: 28px;
    }

    .sp-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sp-info__meta {
        gap: 6px;
    }

    .sp-pill {
        font-size: 11px;
        padding: 5px 10px;
    }

    .sp-gallery {
        height: 300px;
        min-height: 300px;
    }

    .sp-info__short-desc {
        font-size: 14px;
        max-height: 80px;
        margin: 10px 0 16px;
    }

    .sp-actions .sp-btn {
        padding: 12px 24px !important;
        font-size: 1rem !important;
        border-radius: 980px !important;
    }
}