/**
 * 产品落地页 CSS 样式
 *
 * 针对移动端落地页设计 (最大宽 480px 居中)
 * 类名与 PHP HTML 输出和 JS 交互保持一致
 * 支持 RTL 方向
 *
 * @package Land_Custom
 */

/* =============================================
 * 全局基础
 * ============================================= */

.land-landing {
    max-width: var(--land-max-width, 750px);
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    overflow-x: hidden;
}

.land-landing *,
.land-landing *::before,
.land-landing *::after {
    box-sizing: border-box;
}

/* =============================================
 * 产品图片轮播 (.land-gallery)
 * ============================================= */

.land-gallery {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.land-gallery-slider {
    position: relative;
    width: 100%;
}

.land-gallery-slide {
    display: none;
    width: 100%;
}

.land-gallery-slide.active {
    display: block;
}

.land-gallery-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 轮播指示圆点 */
.land-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.land-gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    padding: 0;
}

.land-gallery-dot.active {
    background: #fff;
}

/* 无图占位 */
.land-gallery-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 14px;
}

/* =============================================
 * 产品信息区 (.land-hero-info)
 * ============================================= */

.land-hero-info {
    background: #fff;
    padding: 16px;
}

.land-product-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #222;
    line-height: 1.3;
}

/* 价格 */
.land-price {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.land-price-current {
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
}

.land-price-original {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

/* 政策徽章 */
.land-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.land-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e8f5e9;
    color: #2e7d32;
}

.land-badge-icon {
    font-style: normal;
    font-weight: 700;
}

/* Shop Now 按钮 */
.land-btn-shop {
    display: block;
    width: 100%;
    padding: 14px;
    background: #25d366;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.land-btn-shop:hover {
    background: #1da851;
    color: #fff;
}

/* =============================================
 * 产品描述 (.land-description)
 * ============================================= */

.land-description {
    background: #fff;
    margin: 12px 0;
    padding: 16px;
}

.land-description-content {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.land-description-content p {
    margin: 0 0 8px;
}

.land-description-content a {
    display: block;
}

.land-description-content img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* =============================================
 * 下单区 (.land-order-section)
 * ============================================= */

.land-order-section {
    background: #fff;
    margin: 12px 0;
    padding: 16px;
}

.land-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #222;
}

/* 套餐卡片列表 */
.land-packages-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.land-package-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    position: relative;
}

.land-package-card:hover {
    border-color: #ccc;
}

.land-package-card.active {
    border-color: #e74c3c;
    box-shadow: 0 0 0 1px #e74c3c;
    background: #fff;
}

.land-package-image img {
    width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 8px;
}

.land-package-info {
    margin-bottom: 6px;
}

.land-package-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.land-package-name-ar {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.land-package-price {
    margin-top: 4px;
}

.land-package-original {
    display: block;
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.land-package-current {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
}

.land-package-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* =============================================
 * 价格汇总
 * ============================================= */

.land-order-summary {
    padding: 12px 0;
    border-top: 1px solid #eee;
    margin-bottom: 8px;
}

.land-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.land-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.land-total-price {
    font-size: 22px;
    font-weight: 700;
    color: #e74c3c;
}

/* =============================================
 * 付款方式
 * ============================================= */

.land-payment-method {
    padding: 8px 0;
    margin-bottom: 8px;
}

.land-subtitle {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #333;
}

.land-cod-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    color: #166534;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
}

.land-cod-icon {
    font-style: normal;
}

/* =============================================
 * 配送承诺
 * ============================================= */

.land-delivery-promises {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 8px;
    border-top: 1px solid #eee;
}

.land-promise {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.land-promise-icon {
    font-size: 22px;
    font-style: normal;
}

.land-promise-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* =============================================
 * 订单表单 (.land-order-form)
 * ============================================= */

.land-order-form {
    padding-top: 8px;
}

.land-form-group {
    margin-bottom: 14px;
}

.land-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.land-required {
    color: #e74c3c;
    margin-left: 2px;
}

.land-form-input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.land-form-input:focus {
    border-color: #25d366;
    background: #fff;
}

.land-form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* 下拉选择框样式: 与文本输入框风格统一, 支持自定义箭头 */
.land-form-select {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    cursor: pointer;
    padding-right: 32px;
    background-color: #fafafa;
}

.land-form-select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* =============================================
 * Confirm 按钮
 * ============================================= */

.land-btn-confirm {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: #e74c3c;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.land-btn-confirm:hover {
    background: #c0392b;
}

.land-btn-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =============================================
 * 注意事项 (.land-notice)
 * ============================================= */

.land-notice {
    background: #333;
    color: #fff;
    margin: 12px;
    padding: 16px;
    border-radius: 12px;
}

.land-notice-content {}

.land-notice-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #fff;
}

.land-notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.land-notice-list li {
    font-size: 13px;
    line-height: 1.6;
    padding: 4px 0 4px 16px;
    color: #ddd;
    position: relative;
}

.land-notice-list li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #25d366;
}

/* =============================================
 * 加载遮罩
 * ============================================= */

.land-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.land-loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.land-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #fff;
    border-top-color: #25d366;
    border-radius: 50%;
    animation: land-spin 0.8s linear infinite;
}

@keyframes land-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
 * 响应式 - 大屏幕
 * ============================================= */

@media (min-width: 751px) {
    .land-landing {
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }
}

/* =============================================
 * 空白模板下的落地页适配
 * 页面使用空白模板时, 落地页全屏顶格显示
 * ============================================= */

/* 空白模板: 去掉 html 和 body 的外边距和内边距, 确保页面顶格显示 */
html.land-blank-template,
html body.land-blank-template {
    margin: 0 !important;
    padding: 0 !important;
}

/* 兼容: body 上的 land-blank-template class (html 上没有该 class) */
body.land-blank-template {
    margin: 0 !important;
    padding: 0 !important;
    background: #f5f5f5;
}

/* 落地页在空白模板中: 全屏顶格, 无圆角无间距 */
.land-blank-template .land-landing {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

/* =============================================
 * 浮动语言切换器 (可伸缩组件)
 * 悬浮左侧顶部, 显示当前语言国旗+名称, hover 展开所有选项
 * ============================================= */

/* 外层容器: 固定定位在页面左上角 */
.land-lang-switcher-wrap {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 切换按钮: 圆角药丸形, 显示国旗+名称 */
.land-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    z-index: 2;
    white-space: nowrap;
}

.land-lang-toggle:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.land-lang-toggle-flag {
    font-size: 20px;
    line-height: 1;
}

.land-lang-toggle-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1;
}

/* 语言选项面板: 默认折叠, hover 时显示 */
.land-lang-switcher {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transform-origin: top left;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    white-space: nowrap;
    min-width: 140px;
}

/* hover 时展开 */
.land-lang-switcher-wrap:hover .land-lang-switcher,
.land-lang-switcher-wrap.is-open .land-lang-switcher {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 每个语言选项 */
.land-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #666;
    background: #f5f5f5;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.land-lang-switch:hover {
    background: #e0e0e0;
    color: #333;
}

.land-lang-switch.active {
    background: #25d366;
    color: #fff;
}

.land-lang-flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

/* 语言名称文本 */
.land-lang-name {
    font-size: 13px;
    line-height: 1;
}

/* 移动端: 调整间距 */
@media (max-width: 750px) {
    .land-lang-switcher-wrap {
        left: 8px;
        top: 8px;
    }
}

/* =============================================
 * 货币切换器 (.land-currency-switcher)
 * 位于价格下方, 与落地页风格统一
 * 重写 WOOCS ddslick 下拉样式
 * ============================================= */

.land-currency-switcher {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.land-currency-switcher .woocommerce-currency-switcher-form {
    width: auto;
    min-width: 140px;
    position: relative;
}

/* ---- ddslick 组件覆写 ---- */

/* 主容器 */
.land-currency-switcher .dd-container {
    width: 100% !important;
    position: relative;
}

/* 选中项容器 */
.land-currency-switcher .dd-select {
    width: 100% !important;
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box !important;
}

.land-currency-switcher .dd-select:hover {
    border-color: #25d366 !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.08);
}

/* 选中项链接 */
.land-currency-switcher .dd-selected {
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    padding: 8px 0 !important;
    text-decoration: none;
    line-height: 1.3 !important;
}

/* 选中项图片 (国旗) - 隐藏 */
.land-currency-switcher .dd-selected-image {
    display: none !important;
}

/* 选中项文本 - 代码+符号, 如 "SAR, ر.س" */
.land-currency-switcher .dd-selected-text {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
    display: block !important;
}

/* 选中项描述 (货币全称) */
.land-currency-switcher .dd-selected-description {
    display: block !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #888 !important;
    line-height: 1.2 !important;
    margin-top: 1px;
}

/* 下拉箭头 */
.land-currency-switcher .dd-pointer {
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top: 5px solid #999 !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: transform 0.2s ease;
}

.land-currency-switcher .dd-pointer-down {
    border-top: 5px solid #999 !important;
    border-bottom: none !important;
}

.land-currency-switcher .dd-pointer-up {
    border-bottom: 5px solid #999 !important;
    border-top: none !important;
    transform: translateY(-50%) !important;
}

/* 下拉选项列表 */
.land-currency-switcher .dd-options {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    padding: 4px 0 !important;
    z-index: 100;
    list-style: none !important;
    margin: 0 !important;
    overflow: hidden;
}

/* 每个选项项 */
.land-currency-switcher .dd-option {
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    padding: 8px 12px !important;
    text-decoration: none !important;
    transition: background 0.15s ease;
    cursor: pointer;
}

.land-currency-switcher .dd-option:hover {
    background: #f5f5f5 !important;
}

.land-currency-switcher .dd-option-selected {
    background: #f0fdf4 !important;
}

.land-currency-switcher .dd-option-selected:hover {
    background: #e6f8ea !important;
}

/* 选项图片 (国旗) - 隐藏 */
.land-currency-switcher .dd-option-image {
    display: none !important;
}

/* 选项文本 */
.land-currency-switcher .dd-option-text {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
    cursor: pointer;
}

.land-currency-switcher .dd-option-selected .dd-option-text {
    font-weight: 600 !important;
    color: #25d366 !important;
}

/* 选项描述 */
.land-currency-switcher .dd-option-description {
    display: block !important;
    font-size: 11px !important;
    color: #999 !important;
    line-height: 1.2 !important;
}

/* hidden input */
.land-currency-switcher .dd-selected-value,
.land-currency-switcher .dd-option-value {
    display: none !important;
}

/* 标签文本 */
.land-currency-switcher-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

/* WOOCS 标志隐藏 */
.land-currency-switcher .woocs_display_none {
    display: none !important;
}

/* 移动端适配 */
@media (max-width: 414px) {
    .land-currency-switcher {
        flex-wrap: wrap;
    }
    
    .land-currency-switcher .woocommerce-currency-switcher-form {
        min-width: 120px;
        flex: 1;
    }
}

/* =============================================
 * 落地页容器块 (.land-landing-page)
 * 页面级容器, 类似 WooCommerce Checkout 块
 * ============================================= */

.land-landing-page {
    max-width: var(--land-max-width, 750px);
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
}

.land-landing-page-inner {
    padding: 0;
}

/* =============================================
 * 落地页容器块编辑器样式
 * 仅在 Gutenberg 编辑器中生效
 * ============================================= */

.land-landing-page-editor {
    max-width: 750px;
    margin: 0 auto;
    border: 2px dashed #007cba;
    border-radius: 8px;
    background: #f5f5f5;
}

.land-landing-page-product-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #007cba;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
}

.land-landing-page-product-bar .dashicon {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.land-landing-page-product-label {
    flex: 1;
}

.land-landing-page-content {
    padding: 16px;
    min-height: 200px;
}

/* 块占位符样式 */
.land-block-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
}

.land-block-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.land-block-placeholder-icon .dashicon {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.land-block-placeholder-label {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.land-block-placeholder-instructions {
    font-size: 13px;
    color: #999;
}
