/* ===== Subscription Page — matches wireframe design system ===== */
:root {
    --primary: #E86F2C;
    --primary-light: #FF8F54;
    --primary-dark: #C45A1E;
    --accent: #6C5CE7;
    --accent-light: #A29BFE;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --bg-main: #FAFBFE;
    --bg-card: #FFFFFF;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --border: #E8ECF1;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --gradient-primary: linear-gradient(135deg, #E86F2C 0%, #FF6B6B 100%);
    --gradient-accent: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
    --gradient-hero: linear-gradient(135deg, #FFF5F0 0%, #F0EEFF 50%, #E8F8F5 100%);
}

* { box-sizing: border-box; }

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.sub-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.sub-header .brand {
    font-weight: 800;
    font-size: 22px;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.sub-header .brand span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sub-header .nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}
.sub-header .nav-link:hover {
    background: #F0F0F5;
    color: var(--text-primary);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: var(--gradient-hero);
    padding: 48px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(232,111,44,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108,92,231,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.hero-section h1 .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-section p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title .badge-count {
    background: var(--gradient-primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.product-card .product-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: linear-gradient(135deg, #F0EEFF 0%, #FFF5F0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .product-img .icon-placeholder {
    font-size: 48px;
    opacity: 0.6;
    color: var(--accent);
}
.product-card .product-body {
    padding: 14px 16px;
}
.product-card .product-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.product-card .product-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-card .product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}
.product-card .product-price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.btn-add-cart {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(232,111,44,0.3);
}
.btn-add-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(232,111,44,0.4);
}
.btn-add-cart:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== CART PANEL ===== */
.cart-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
    overflow: hidden;
}
.cart-header {
    background: var(--gradient-primary);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.cart-header .cart-badge {
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}
.cart-body {
    padding: 16px 20px;
    max-height: 280px;
    overflow-y: auto;
}
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #F0F2F5;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 12px; color: var(--text-secondary); }
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px;
}
.cart-item-qty button {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.cart-item-qty button:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.cart-item-qty span {
    font-weight: 700;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}
.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}
.btn-remove-item:hover { color: var(--danger); }
.cart-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}
.cart-empty i {
    font-size: 36px;
    margin-bottom: 8px;
    display: block;
}

/* ===== CUSTOMER FORM ===== */
.customer-form {
    padding: 0 20px 16px;
    border-top: 1px solid #F0F2F5;
}
.customer-form h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 16px 0 12px;
}
.form-field { margin-bottom: 10px; }
.form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,111,44,0.1);
}
.form-field input::placeholder { color: var(--text-muted); }

/* ===== CART FOOTER ===== */
.cart-footer {
    padding: 16px 20px;
    background: #FAFBFE;
    border-top: 1px solid #F0F2F5;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.cart-total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
.cart-total-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}
.cart-total-amount small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.btn-checkout {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(232,111,44,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232,111,44,0.4);
}
.btn-checkout:active { transform: translateY(0); }
.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== QR PANEL ===== */
.qr-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 28px 20px;
    text-align: center;
    margin-top: 16px;
}
.qr-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}
.qr-image img { max-width: 250px; border-radius: 12px; }
.qr-amount {
    margin-top: 14px;
}
.qr-amount-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}
.qr-status {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== PAYMENT RESULT ===== */
.payment-result {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}
.payment-result .result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}
.payment-result .result-icon.success {
    background: #E8F8F5;
    color: var(--success);
}
.payment-result h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}
.payment-result p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== MOBILE CHECKOUT BAR ===== */
.mobile-checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    display: none !important;
}
/* Only show on mobile when cart has items */
@media (max-width: 767px) {
    .mobile-checkout-bar.has-items {
        display: block !important;
    }
}
.mobile-checkout-bar .bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}
.mobile-checkout-bar .bar-total {
    font-size: 13px;
    color: var(--text-secondary);
}
.mobile-checkout-bar .bar-total strong {
    display: block;
    font-size: 18px;
    color: var(--primary);
    font-weight: 800;
}
.mobile-checkout-bar .bar-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(232,111,44,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .cart-col { margin-top: 24px; }
    .cart-panel { position: static; }
}
@media (max-width: 767px) {
    .hero-section { padding: 32px 0 28px; }
    .hero-section h1 { font-size: 26px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card .product-img { height: 100px; }
    .product-card .product-body { padding: 10px 12px; }
    .product-card .product-price { font-size: 15px; }
    .cart-col { display: none; }
    .main-content { padding: 20px 12px 100px; }
    .sub-header .nav-link { font-size: 12px; padding: 6px 8px; }
}
@media (max-width: 375px) {
    .product-grid { grid-template-columns: 1fr; }
}
