/**
 * Configure Product - Dark Theme Override
 * DP Nexus · 2026 Edition
 * 
 * Overrides the default white styles for product configuration pages.
 * Covers: Bedrock VPS/VDS, AI VDS, Premium Servers (Hostkey products)
 * Load this file after the standard cart CSS.
 */

/* ══════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart {
    background: #0d1117 !important;
    color: #e2e8f0 !important;
}

html body #order-standard_cart::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(180deg, rgba(0,155,222,0.04) 0%, transparent 40%),
        linear-gradient(135deg, #0d1117 0%, #0f172a 50%, #0d1117 100%);
    z-index: -1;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   HEADER / PAGE TITLE
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .header-lined {
    background: transparent !important;
    border-bottom: 1px solid rgba(0,155,222,0.15) !important;
    padding-bottom: 20px !important;
    margin-bottom: 30px !important;
}

html body #order-standard_cart .header-lined h1 {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.8rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #c8dff0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════════════════════════
   PRODUCT INFO SECTION
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .product-info {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.15) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 24px !important;
}

html body #order-standard_cart .product-info .product-title {
    color: #ffffff !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
}

html body #order-standard_cart .product-info p:last-child {
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
}

/* ══════════════════════════════════════════════════════════════
   SUB HEADINGS - 横线移到左右两侧，标题下无横线
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .sub-heading {
    background: transparent !important;
    border: none !important;
    /* 增大上边距，防止与上方 info text 重叠 */
    margin: 44px 0 16px !important;
    padding: 8px 0 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

/* 紧跟在 field-container 之后的 sub-heading 额外加间距 */
html body #order-standard_cart .field-container + .sub-heading,
html body #order-standard_cart .field-container ~ .sub-heading {
    margin-top: 48px !important;
}

html body #order-standard_cart .sub-heading::before,
html body #order-standard_cart .sub-heading::after {
    content: '' !important;
    flex: 1 !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(0,155,222,0.4), transparent) !important;
}

html body #order-standard_cart .sub-heading span.primary-bg-color {
    background: transparent !important;
    color: #009bde !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    white-space: nowrap !important;
}

/* ══════════════════════════════════════════════════════════════
   FIELD CONTAINER & FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .field-container {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.12) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

html body #order-standard_cart .form-group {
    margin-bottom: 16px !important;
}

html body #order-standard_cart .form-group:last-child {
    margin-bottom: 0 !important;
}

/* Labels */
html body #order-standard_cart label,
html body #order-standard_cart .form-group label {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* Text Inputs */
html body #order-standard_cart input[type="text"],
html body #order-standard_cart input[type="password"],
html body #order-standard_cart input[type="email"],
html body #order-standard_cart input[type="number"],
html body #order-standard_cart input[type="url"],
html body #order-standard_cart input[type="tel"],
html body #order-standard_cart input.form-control,
html body #order-standard_cart select.form-control,
html body #order-standard_cart textarea.form-control,
html body #order-standard_cart .form-control {
    background: #0f172a !important;
    border: 1px solid rgba(0,155,222,0.25) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2) !important;
}

html body #order-standard_cart input[type="text"]:focus,
html body #order-standard_cart input[type="password"]:focus,
html body #order-standard_cart input[type="email"]:focus,
html body #order-standard_cart input[type="number"]:focus,
html body #order-standard_cart input[type="url"]:focus,
html body #order-standard_cart input[type="tel"]:focus,
html body #order-standard_cart input.form-control:focus,
html body #order-standard_cart select.form-control:focus,
html body #order-standard_cart textarea.form-control:focus,
html body #order-standard_cart .form-control:focus {
    border-color: #009bde !important;
    box-shadow: 0 0 0 3px rgba(0,155,222,0.2), inset 0 1px 3px rgba(0,0,0,0.2) !important;
    outline: none !important;
}

html body #order-standard_cart input::placeholder,
html body #order-standard_cart .form-control::placeholder {
    color: rgba(255,255,255,0.35) !important;
}

/* Select Dropdowns - 修复文字显示不全 */
html body #order-standard_cart select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23aaa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-color: #0f172a !important;
    padding: 12px 36px 12px 14px !important;
    min-height: 46px !important;
    height: auto !important;
    line-height: 1.5 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    min-width: 150px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 选择框的 option 文字 */
html body #order-standard_cart select.form-control option {
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 8px !important;
}

/* Radio & Checkbox */
html body #order-standard_cart input[type="radio"],
html body #order-standard_cart input[type="checkbox"] {
    accent-color: #009bde !important;
}

html body #order-standard_cart label input[type="radio"],
html body #order-standard_cart label input[type="checkbox"] {
    margin-right: 8px !important;
}

/* ══════════════════════════════════════════════════════════════
   PRODUCT CONFIGURABLE OPTIONS
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .product-configurable-options {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.12) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

/* Configurable Options 区域的选择框 - 修复文字显示 */
html body #order-standard_cart .product-configurable-options select,
html body #order-standard_cart select[id^="inputConfigOption"],
html body #order-standard_cart #inputBillingcycle {
    background-color: #0f172a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    border: 1px solid rgba(0,155,222,0.3) !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    padding: 10px 32px 10px 12px !important;
    min-height: 44px !important;
    height: auto !important;
    line-height: 1.5 !important;
    font-size: 0.9rem !important;
    width: 100% !important;
    min-width: 120px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
}

html body #order-standard_cart .product-configurable-options select option,
html body #order-standard_cart select[id^="inputConfigOption"] option,
html body #order-standard_cart #inputBillingcycle option {
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 6px 8px !important;
}

/* ══════════════════════════════════════════════════════════════
   ADDONS SECTION
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .addon-products {
    margin-top: 16px !important;
}

html body #order-standard_cart .panel-addon {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.15) !important;
    border-radius: 12px !important;
    transition: all 0.25s ease !important;
}

html body #order-standard_cart .panel-addon:hover {
    border-color: rgba(0,155,222,0.4) !important;
    box-shadow: 0 4px 20px rgba(0,155,222,0.15) !important;
}

html body #order-standard_cart .panel-addon-selected {
    border-color: #009bde !important;
    background: rgba(0,155,222,0.08) !important;
}

html body #order-standard_cart .panel-addon .panel-body {
    background: transparent !important;
    color: rgba(255,255,255,0.85) !important;
    padding: 16px !important;
}

html body #order-standard_cart .panel-addon label {
    color: #ffffff !important;
    font-weight: 600 !important;
}

html body #order-standard_cart .panel-addon .panel-price {
    background: rgba(0,155,222,0.1) !important;
    color: #009bde !important;
    padding: 10px !important;
    font-weight: 600 !important;
    text-align: center !important;
}

html body #order-standard_cart .panel-addon .panel-add {
    background: transparent !important;
    color: rgba(255,255,255,0.5) !important;
    padding: 8px !important;
    text-align: center !important;
    font-size: 0.8rem !important;
}

/* ══════════════════════════════════════════════════════════════
   INFO TEXT / ALERTS
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .info-text-sm,
html body #order-standard_cart .alert-info {
    background: rgba(0,155,222,0.08) !important;
    border: 1px solid rgba(0,155,222,0.2) !important;
    color: rgba(255,255,255,0.8) !important;
    border-radius: 8px !important;
}

html body #order-standard_cart .alert-warning {
    background: rgba(255,193,7,0.1) !important;
    border: 1px solid rgba(255,193,7,0.3) !important;
    color: rgba(255,255,255,0.85) !important;
    border-radius: 8px !important;
}

html body #order-standard_cart .alert-danger {
    background: rgba(220,53,69,0.1) !important;
    border: 1px solid rgba(220,53,69,0.3) !important;
    color: rgba(255,255,255,0.85) !important;
    border-radius: 8px !important;
}

html body #order-standard_cart .alert a.alert-link {
    color: #009bde !important;
}

/* ══════════════════════════════════════════════════════════════
   ORDER SUMMARY SIDEBAR - 修复白色背景问题
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .secondary-cart-sidebar {
    background: transparent !important;
}

html body #order-standard_cart .secondary-cart-sidebar * {
    background: transparent !important;
}

html body #order-standard_cart .order-summary {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.15) !important;
    border-top: 3px solid #009bde !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2) !important;
}

html body #order-standard_cart .order-summary * {
    background: #141d2e !important;
    color: rgba(255,255,255,0.85) !important;
}

html body #order-standard_cart .order-summary h2 {
    color: #ffffff !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(0,155,222,0.15) !important;
    background: transparent !important;
}

/* 确保 summary 内的 div 也是深色 */
html body #order-standard_cart .order-summary div,
html body #order-standard_cart .order-summary p,
html body #order-standard_cart .order-summary span,
html body #order-standard_cart .order-summary ul,
html body #order-standard_cart .order-summary li {
    background: transparent !important;
}

html body #order-standard_cart .summary-container {
    color: rgba(255,255,255,0.85) !important;
}

html body #order-standard_cart .summary-container .order-summary-item {
    display: flex !important;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

html body #order-standard_cart .summary-container .order-summary-item:last-child {
    border-bottom: none !important;
}

html body #order-standard_cart .summary-container .order-summary-total {
    background: rgba(0,155,222,0.1) !important;
    margin: 16px -24px -24px !important;
    padding: 16px 24px !important;
    border-radius: 0 0 12px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

html body #order-standard_cart .summary-container .order-summary-total .amt {
    color: #ffffff !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
}

/* ══════════════════════════════════════════════════════════════
   CONTINUE BUTTON
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart #btnCompleteProductConfig,
html body #order-standard_cart .btn-primary,
html body #order-standard_cart .btn.btn-primary {
    background: linear-gradient(135deg, #009bde 0%, #007ab8 100%) !important;
    background-color: #009bde !important;
    border: none !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    padding: 14px 28px !important;
    box-shadow: 0 4px 20px rgba(0,155,222,0.4), 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    display: inline-block !important;
}

/* Shimmer effect */
html body #order-standard_cart #btnCompleteProductConfig::after,
html body #order-standard_cart .btn-primary::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent) !important;
    transition: left 0.5s ease !important;
    pointer-events: none !important;
}

html body #order-standard_cart #btnCompleteProductConfig:hover,
html body #order-standard_cart .btn-primary:hover {
    background: linear-gradient(135deg, #00b0f0 0%, #009bde 100%) !important;
    background-color: #009bde !important;
    box-shadow: 0 8px 30px rgba(0,155,222,0.5), 0 4px 12px rgba(0,0,0,0.3) !important;
    transform: translateY(-2px) !important;
    color: #ffffff !important;
}

html body #order-standard_cart #btnCompleteProductConfig:hover::after,
html body #order-standard_cart .btn-primary:hover::after {
    left: 100% !important;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR CATEGORIES
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .cart-sidebar .panel {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.12) !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
}

html body #order-standard_cart .cart-sidebar .panel-heading {
    background: transparent !important;
    color: rgba(255,255,255,0.7) !important;
    padding: 12px 16px !important;
    font-weight: 500 !important;
}

html body #order-standard_cart .cart-sidebar .list-group-item {
    background: transparent !important;
    color: rgba(255,255,255,0.6) !important;
    border-color: rgba(0,155,222,0.1) !important;
    padding: 10px 16px !important;
}

html body #order-standard_cart .cart-sidebar .list-group-item:hover,
html body #order-standard_cart .cart-sidebar .list-group-item.active {
    background: rgba(0,155,222,0.1) !important;
    color: #009bde !important;
}

/* ══════════════════════════════════════════════════════════════
   METRICS SECTION (if present)
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart ul.metrics-list,
html body #order-standard_cart .metrics-section {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.12) !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    list-style: none !important;
}

html body #order-standard_cart ul.metrics-list li {
    color: rgba(255,255,255,0.8) !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

html body #order-standard_cart ul.metrics-list li:last-child {
    border-bottom: none !important;
}

/* ══════════════════════════════════════════════════════════════
   CUSTOM FIELDS
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .custom-field-required {
    color: #ff6b6b !important;
}

html body #order-standard_cart .field-help-text {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.8rem !important;
    margin-top: 4px !important;
    display: block !important;
}

/* ══════════════════════════════════════════════════════════════
   RANGE SLIDER (if present)
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .irs-bar,
html body #order-standard_cart .irs--modern .irs-bar {
    background: linear-gradient(135deg, #009bde, #007ab8) !important;
}

html body #order-standard_cart .irs-handle,
html body #order-standard_cart .irs--modern .irs-handle {
    border-color: #009bde !important;
    background: #009bde !important;
}

/* ══════════════════════════════════════════════════════════════
   ROW & COL ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .secondary-cart-body {
    background: transparent !important;
    padding: 0 !important;
}

html body #order-standard_cart .secondary-cart-body > p:first-of-type {
    color: rgba(255,255,255,0.6) !important;
    margin-bottom: 20px !important;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS GENERAL
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .btn-default {
    background: #141d2e !important;
    border: 1px solid rgba(0,155,222,0.25) !important;
    color: rgba(255,255,255,0.8) !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    transition: all 0.2s ease !important;
}

html body #order-standard_cart .btn-default:hover {
    background: rgba(0,155,222,0.15) !important;
    border-color: #009bde !important;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════
   FORM TEXT / INFO TEXT
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .form-text,
html body #order-standard_cart .text-muted,
html body #order-standard_cart .ns-info {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.8rem !important;
    margin-top: 8px !important;
    line-height: 1.5 !important;
}

html body #order-standard_cart .ns-info-wrapper {
    text-align: center !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
}

/* ══════════════════════════════════════════════════════════════
   LOADER SPINNER
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart .loader {
    color: #009bde !important;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    html body #order-standard_cart .field-container {
        padding: 16px !important;
    }
    
    html body #order-standard_cart .order-summary {
        margin-top: 24px !important;
    }
    
    html body #order-standard_cart #btnCompleteProductConfig {
        width: 100% !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   BROWSER AUTOFILL OVERRIDE
   覆盖浏览器自动填充导致的白色背景
   ══════════════════════════════════════════════════════════════ */
html body #order-standard_cart input:-webkit-autofill,
html body #order-standard_cart input:-webkit-autofill:hover,
html body #order-standard_cart input:-webkit-autofill:focus,
html body #order-standard_cart input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    box-shadow: 0 0 0 1000px #0f172a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(0,155,222,0.25) !important;
    border-radius: 8px !important;
    caret-color: #ffffff !important;
    transition: background-color 99999s ease-in-out 0s !important;
}

/* 专门针对 Hostname 和 Root Password 字段 */
html body #order-standard_cart #inputHostname,
html body #order-standard_cart #inputRootpw {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════
   ADDITIONAL INFORMATION 区域 - 专项修复 v8
   1. sub-heading 与上方内容重叠问题
   2. Operating System select 文字被截断问题
   ══════════════════════════════════════════════════════════════ */

/* 修复1：product-configurable-options 之后的 sub-heading 需要额外顶部间距
   WHMCS 模板结构：.product-configurable-options 紧跟 .sub-heading (Additional Information)
   用更宽松的兄弟选择器覆盖所有情况 */
html body #order-standard_cart .product-configurable-options + .sub-heading,
html body #order-standard_cart .product-configurable-options ~ .sub-heading {
    margin-top: 56px !important;
    padding-top: 12px !important;
}

html body #order-standard_cart .ns-info-wrapper + .sub-heading,
html body #order-standard_cart .ns-info + .sub-heading,
html body #order-standard_cart p + .sub-heading,
html body #order-standard_cart .form-group + .sub-heading {
    margin-top: 52px !important;
}

/* 修复2：所有 select 元素 - 强制足够高度保证文字不被截断
   覆盖 WHMCS 通过 {$customfield.input} 输出的原生 select
   以及 configurable options 中的 select */
html body #order-standard_cart select,
html body #order-standard_cart select.form-control,
html body #order-standard_cart .field-container select,
html body #order-standard_cart .product-configurable-options select,
html body #order-standard_cart .form-group select {
    min-height: 48px !important;
    height: auto !important;
    line-height: 1.6 !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    white-space: normal !important;
}

/* 兜底：最大特异性确保 WHMCS 生成的 customfield select 被覆盖 */
html body #order-standard_cart .field-container .form-group select {
    min-height: 48px !important;
    height: auto !important;
    line-height: 1.6 !important;
    padding: 12px 36px 12px 14px !important;
}

/* Additional information 区域内所有 select 修复 */
html body #order-standard_cart .additional-info-section select,
html body #order-standard_cart [id*="customfield"] select,
html body #order-standard_cart select[name*="customfield"],
html body #order-standard_cart .field-container select {
    background-color: #0f172a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23aaa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border: 1px solid rgba(0,155,222,0.25) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 12px 36px 12px 14px !important;
    min-height: 48px !important;
    height: auto !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
    width: 100% !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
