/**
 * HappilyHosted Order System - Styles
 * Extends homepage theme with order-specific components
 */

/* ============================================
   CSS Variables (matching homepage orange theme)
   ============================================ */
:root {
    --hh-primary: #e67e22;
    --hh-primary-dark: #d35400;
    --hh-primary-light: #f39c12;
    --hh-success: #27ae60;
    --hh-danger: #e74c3c;
    --hh-warning: #f1c40f;
    --hh-info: #3498db;
    --hh-dark: #2c3e50;
    --hh-gray: #7f8c8d;
    --hh-light: #ecf0f1;
    --hh-white: #ffffff;
    --hh-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --hh-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --hh-radius: 8px;
    --hh-radius-lg: 16px;
    --hh-transition: all 0.3s ease;
}

/* ============================================
   Base Overrides
   ============================================ */
.order-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
}

.order-content {
    padding: 40px 0 60px;
}

.order-subheader {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    padding: 30px 0;
}

.order-subheader h1 {
    margin-bottom: 5px;
}

/* ============================================
   Cart Badge
   ============================================ */
.cart-link {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--hh-danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   Checkout Progress Bar
   ============================================ */
.checkout-progress-container {
    background: var(--hh-white);
    padding: 25px 0;
    border-bottom: 1px solid var(--hh-light);
    box-shadow: var(--hh-shadow);
}

.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hh-light);
    color: var(--hh-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: var(--hh-transition);
    border: 3px solid var(--hh-light);
}

.progress-step .step-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--hh-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active .step-number {
    background: var(--hh-primary);
    color: white;
    border-color: var(--hh-primary);
}

.progress-step.active .step-label {
    color: var(--hh-primary);
}

.progress-step.current .step-number {
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.3);
    animation: stepPulse 2s infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(230, 126, 34, 0.1); }
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--hh-light);
    margin: 0 10px;
    margin-bottom: 28px;
    transition: var(--hh-transition);
    max-width: 80px;
}

.progress-line.active {
    background: var(--hh-primary);
}

/* ============================================
   Cards
   ============================================ */
.order-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    box-shadow: var(--hh-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--hh-transition);
}

.order-card:hover {
    box-shadow: var(--hh-shadow-lg);
}

.order-card-header {
    border-bottom: 2px solid var(--hh-light);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.order-card-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--hh-dark);
}

.order-card-header p {
    margin: 5px 0 0;
    color: var(--hh-gray);
}

/* ============================================
   Pricing Cards (Product Selection)
   ============================================ */
.plan-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    box-shadow: var(--hh-shadow);
    overflow: hidden;
    transition: var(--hh-transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hh-shadow-lg);
}

.plan-card.featured {
    border: 3px solid var(--hh-primary);
}

.plan-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: 20px;
    right: -35px;
    background: var(--hh-primary);
    color: white;
    padding: 5px 40px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(45deg);
    z-index: 10;
}

.plan-header {
    background: linear-gradient(135deg, var(--hh-primary) 0%, var(--hh-primary-dark) 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.plan-header h3 {
    color: white;
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
}

.plan-header .plan-description {
    opacity: 0.9;
    font-size: 14px;
    margin: 0;
}

.plan-pricing {
    text-align: center;
    padding: 25px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--hh-light);
}

.plan-pricing .price {
    font-size: 48px;
    font-weight: 800;
    color: var(--hh-dark);
    line-height: 1;
}

.plan-pricing .price-period {
    font-size: 16px;
    color: var(--hh-gray);
    font-weight: 400;
}

.plan-pricing .annual-price {
    font-size: 14px;
    color: var(--hh-success);
    margin-top: 8px;
    font-weight: 600;
}

.plan-features {
    padding: 25px 20px;
    flex: 1;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--hh-light);
    display: flex;
    align-items: center;
    font-size: 14px;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li i {
    color: var(--hh-success);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.plan-footer {
    padding: 20px;
    text-align: center;
}

.plan-footer .btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Cart Items
   ============================================ */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: var(--hh-white);
    border-radius: var(--hh-radius);
    margin-bottom: 15px;
    box-shadow: var(--hh-shadow);
    transition: var(--hh-transition);
}

.cart-item:hover {
    box-shadow: var(--hh-shadow-lg);
}

.cart-item-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--hh-radius);
    background: linear-gradient(135deg, var(--hh-primary) 0%, var(--hh-primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.cart-item-icon.domain {
    background: linear-gradient(135deg, var(--hh-info) 0%, #2980b9 100%);
}

.cart-item-details {
    flex: 1;
    padding: 0 20px;
}

.cart-item-details h4 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 700;
    color: var(--hh-dark);
}

.cart-item-details p {
    margin: 0;
    color: var(--hh-gray);
    font-size: 14px;
}

.cart-item-details .free-badge {
    display: inline-block;
    background: var(--hh-success);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 8px;
}

.cart-item-pricing {
    text-align: right;
    min-width: 120px;
}

.cart-item-pricing .price {
    font-size: 20px;
    font-weight: 700;
    color: var(--hh-dark);
}

.cart-item-pricing .price.strikethrough {
    text-decoration: line-through;
    color: var(--hh-gray);
    font-size: 14px;
}

.cart-item-pricing .discount-price {
    color: var(--hh-success);
    font-size: 20px;
    font-weight: 700;
}

.cart-item-actions {
    margin-left: 15px;
}

.cart-item-actions .btn-remove {
    background: transparent;
    border: none;
    color: var(--hh-danger);
    padding: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--hh-transition);
}

.cart-item-actions .btn-remove:hover {
    opacity: 1;
}

/* ============================================
   Order Summary
   ============================================ */
.order-summary {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    box-shadow: var(--hh-shadow);
    padding: 25px;
    position: sticky;
    top: 20px;
}

.order-summary h3 {
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--hh-light);
    font-size: 20px;
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
}

.summary-row.subtotal {
    border-top: 1px solid var(--hh-light);
    margin-top: 10px;
    padding-top: 15px;
}

.summary-row.discount {
    color: var(--hh-success);
}

.summary-row.total {
    border-top: 2px solid var(--hh-dark);
    margin-top: 15px;
    padding-top: 20px;
    font-size: 20px;
    font-weight: 700;
}

.summary-row.total .amount {
    color: var(--hh-primary);
    font-size: 28px;
}

.promo-code-form {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.promo-code-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    font-size: 14px;
    transition: var(--hh-transition);
}

.promo-code-form input:focus {
    border-color: var(--hh-primary);
    outline: none;
}

.promo-code-form button {
    padding: 12px 20px;
    white-space: nowrap;
}

.promo-applied {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--hh-success);
    border-radius: var(--hh-radius);
    padding: 12px 15px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-applied .promo-code {
    font-weight: 700;
    color: var(--hh-success);
}

.promo-applied .remove-promo {
    background: transparent;
    border: none;
    color: var(--hh-danger);
    cursor: pointer;
    font-size: 18px;
}

/* ============================================
   Billing Cycle Selector
   ============================================ */
.billing-cycle-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.billing-cycle-option {
    flex: 1;
    padding: 15px;
    background: var(--hh-white);
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    cursor: pointer;
    transition: var(--hh-transition);
    text-align: center;
}

.billing-cycle-option:hover {
    border-color: var(--hh-primary);
}

.billing-cycle-option.active {
    border-color: var(--hh-primary);
    background: rgba(230, 126, 34, 0.05);
}

.billing-cycle-option .cycle-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--hh-dark);
    display: block;
}

.billing-cycle-option .cycle-price {
    font-size: 14px;
    color: var(--hh-gray);
    margin-top: 5px;
    display: block;
}

.billing-cycle-option .cycle-savings {
    display: inline-block;
    background: var(--hh-success);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

/* ============================================
   Domain Search
   ============================================ */
.domain-search-box {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    box-shadow: var(--hh-shadow-lg);
    padding: 40px;
    margin: -50px auto 40px;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.domain-search-box h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--hh-dark);
}

.domain-search-form {
    display: flex;
    gap: 10px;
}

.domain-search-form input[type="text"] {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    font-size: 18px;
    transition: var(--hh-transition);
}

.domain-search-form input[type="text"]:focus {
    border-color: var(--hh-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}

.domain-search-form .btn {
    padding: 18px 40px;
    font-size: 18px;
}

.domain-results {
    margin-top: 30px;
}

.domain-result {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--hh-white);
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    margin-bottom: 15px;
    transition: var(--hh-transition);
}

.domain-result.available {
    border-color: var(--hh-success);
    background: rgba(39, 174, 96, 0.05);
}

.domain-result.unavailable {
    border-color: var(--hh-danger);
    background: rgba(231, 76, 60, 0.05);
    opacity: 0.7;
}

.domain-result .domain-name {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--hh-dark);
}

.domain-result .domain-status {
    margin: 0 20px;
    font-weight: 600;
}

.domain-result .domain-status.available {
    color: var(--hh-success);
}

.domain-result .domain-status.unavailable {
    color: var(--hh-danger);
}

.domain-result .domain-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--hh-primary);
    margin-right: 20px;
}

/* ============================================
   Forms
   ============================================ */
.order-form .form-group {
    margin-bottom: 20px;
}

.order-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--hh-dark);
}

.order-form label .required {
    color: var(--hh-danger);
}

.order-form .form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    font-size: 16px;
    transition: var(--hh-transition);
}

.order-form .form-control:focus {
    border-color: var(--hh-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}

.order-form .form-control.error {
    border-color: var(--hh-danger);
}

.order-form .error-message {
    color: var(--hh-danger);
    font-size: 13px;
    margin-top: 5px;
}

.order-form .help-text {
    color: var(--hh-gray);
    font-size: 13px;
    margin-top: 5px;
}

.order-form select.form-control,
select.form-control,
#country {
    color: #2c3e50 !important;
    -webkit-text-fill-color: #2c3e50 !important;
    background-color: #ffffff !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 12px 35px 12px 14px !important;
    opacity: 1 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.order-form select.form-control option,
select.form-control option,
#country option {
    color: #2c3e50 !important;
    -webkit-text-fill-color: #2c3e50 !important;
    background-color: #ffffff !important;
    padding: 10px;
}

.order-form select.form-control:focus,
select.form-control:focus,
#country:focus {
    color: #2c3e50 !important;
    -webkit-text-fill-color: #2c3e50 !important;
    background-color: #ffffff !important;
}

/* Override autofill styles */
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #2c3e50 !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    background-color: #ffffff !important;
}

/* ============================================
   Payment Methods
   ============================================ */
.payment-methods {
    margin-top: 25px;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--hh-white);
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--hh-transition);
}

.payment-method:hover {
    border-color: var(--hh-primary);
}

.payment-method.selected {
    border-color: var(--hh-primary);
    background: rgba(230, 126, 34, 0.05);
}

.payment-method input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    accent-color: var(--hh-primary);
}

.payment-method-icon {
    width: 50px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.payment-method-icon img {
    max-width: 100%;
    max-height: 100%;
}

.payment-method-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.payment-method-info p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--hh-gray);
}

.payment-form {
    padding: 25px;
    background: #fafafa;
    border-radius: var(--hh-radius);
    margin-top: 20px;
    display: none;
}

.payment-form.active {
    display: block;
}

#card-element {
    padding: 15px;
    background: white;
    border: 2px solid var(--hh-light);
    border-radius: var(--hh-radius);
}

#card-errors {
    color: var(--hh-danger);
    font-size: 14px;
    margin-top: 10px;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--hh-primary) 0%, var(--hh-primary-dark) 100%);
    border: none;
    color: white;
    padding: 14px 30px;
    font-weight: 700;
    border-radius: var(--hh-radius);
    transition: var(--hh-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(230, 126, 34, 0.4);
    background: linear-gradient(135deg, var(--hh-primary-light) 0%, var(--hh-primary) 100%);
}

.btn-secondary {
    background: var(--hh-white);
    border: 2px solid var(--hh-light);
    color: var(--hh-dark);
    padding: 14px 30px;
    font-weight: 700;
    border-radius: var(--hh-radius);
    transition: var(--hh-transition);
}

.btn-secondary:hover {
    border-color: var(--hh-primary);
    color: var(--hh-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--hh-success) 0%, #219a52 100%);
    border: none;
    color: white;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 18px 25px;
    border-radius: var(--hh-radius);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 15px;
    font-size: 20px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--hh-success);
    color: #1e7e34;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--hh-danger);
    color: #c82333;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid var(--hh-info);
    color: #0c5460;
}

/* ============================================
   Order Complete
   ============================================ */
.order-complete {
    text-align: center;
    padding: 60px 20px;
}

.order-complete .success-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hh-success) 0%, #219a52 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.order-complete h1 {
    color: var(--hh-success);
    margin-bottom: 15px;
}

.order-complete .order-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--hh-dark);
    background: var(--hh-light);
    padding: 10px 30px;
    border-radius: 30px;
    display: inline-block;
    margin: 20px 0;
}

/* ============================================
   Footer Styling
   ============================================ */
.order-footer {
    background: var(--hh-dark);
    color: white;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-widget h4 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--hh-transition);
}

.footer-links a:hover {
    color: var(--hh-primary);
}

.footer-badges {
    margin-top: 20px;
}

.payment-methods {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 30px 0;
}

.payment-methods span {
    margin-right: 20px;
    font-weight: 600;
}

.payment-methods img {
    margin: 0 10px;
    opacity: 0.8;
    transition: var(--hh-transition);
}

.payment-methods img:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--hh-light);
    border-top-color: var(--hh-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn.loading {
    color: transparent;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
    .checkout-progress {
        padding: 0 15px;
    }
    
    .progress-step .step-label {
        display: none;
    }
    
    .progress-line {
        margin-bottom: 0;
    }
    
    .order-summary {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 767px) {
    .billing-cycle-selector {
        flex-direction: column;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-icon {
        margin-bottom: 15px;
    }
    
    .cart-item-details {
        padding: 0;
        margin-bottom: 15px;
    }
    
    .cart-item-pricing {
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .cart-item-actions {
        margin-left: auto;
    }
    
    .domain-search-form {
        flex-direction: column;
    }
    
    .domain-search-box {
        padding: 25px;
        margin: -30px 15px 30px;
    }
    
    .domain-result {
        flex-direction: column;
        text-align: center;
    }
    
    .domain-result .domain-name,
    .domain-result .domain-status,
    .domain-result .domain-price {
        margin: 10px 0;
    }
    
    .payment-method {
        flex-wrap: wrap;
    }
}
