/* Inherit Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #f5f5f5;
    background-image: radial-gradient(circle, rgba(7,53,72,0.5) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center;
    min-height: 100vh;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(18, 18, 18, 0.95);
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}


.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f5f5f5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: #f5f5f5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #00a7e6;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Checkout Specific Styles */
.checkout-container {
    max-width: 1200px;
    margin: 100px auto 40px;
    padding: 20px;
}

.checkout-title {
    font-size: 2.5rem;
    color: #00a7e6;
    margin-bottom: 40px;
    text-align: center;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
}

/* Form Styles */
.checkout-form {
    background: rgba(28, 28, 28, 0.95);
    border-radius: 15px;
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h2 {
    color: #00a7e6;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, textarea {
    background: rgba(18, 18, 18, 0.8) !important;
    border: 1px solid #333 !important;
    border-radius: 8px;
    padding: 12px 15px;
    color: #f5f5f5 !important;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* Override browser's default autofill styles */
.checkout-form input:-webkit-autofill,
.checkout-form input:-webkit-autofill:hover,
.checkout-form input:-webkit-autofill:focus,
.checkout-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(18, 18, 18, 0.8) inset !important;
    -webkit-text-fill-color: #f5f5f5 !important;
    caret-color: #f5f5f5 !important;
    border-color: #333 !important;
    -webkit-transition: background-color 5000s ease-in-out 0s;
    transition: background-color 5000s ease-in-out 0s;
}

input:focus, textarea:focus {
    border-color: #00a7e6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 167, 230, 0.2);
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-method {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(18, 18, 18, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    color: #f5f5f5;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method svg {
    width: 24px;
    height: 24px;
}

.payment-method:hover {
    border-color: #00a7e6;
    background: rgba(0, 167, 230, 0.1);
}

.payment-method.active {
    border-color: #00a7e6;
    background: rgba(0, 167, 230, 0.15);
}

/* Order Summary */
.order-summary {
    background: rgba(28, 28, 28, 0.95);
    border-radius: 15px;
    padding: 30px;
    height: fit-content;
}

.order-summary h2 {
    color: #00a7e6;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-info h3 {
    color: #f5f5f5;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.item-type {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.item-quantity {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-top: 5px;
}

.item-price {
    color: #00a7e6;
    font-weight: bold;
}

.summary-totals {
    margin-top: 20px;
    padding-top: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #f5f5f5;
}

.summary-line.total {
    color: #00a7e6;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-details {
    margin-top: 20px;
}

#payment-element {
    background: rgba(18, 18, 18, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.error-message {
    color: #ff4444;
    margin-top: 10px;
    font-size: 0.9rem;
}

.place-order-button {
    width: 100%;
    background: #00a7e6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.place-order-button:hover {
    background: #0086b8;
}

.place-order-button:disabled {
    background: #666;
    cursor: not-allowed;
}

.terms {
    text-align: center;
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 20px;
    color: #a0a0a0;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-title {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .payment-methods {
        flex-direction: column;
    }

    .card-details {
        grid-template-columns: 1fr;
    }
}

/* Cart Icon Styles */
.cart-icon {
    position: relative;
    margin-right: 20px;
    color: #f5f5f5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cart-icon:hover {
    color: #00a7e6;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #00a7e6;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

/* Login Button */
.login-button, #logout-button {
    text-decoration: none;
    color: #fff;
    background-color: #00a7e6;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.login-button:hover, #logout-button:hover {
    background-color: #0090cc;
    transform: scale(1.05);
}
.terms a,
.terms a:visited {
    color: #00a7e6;
    text-decoration: underline;
}

.terms a:hover {
    color: #0086b8;
}

/* Promo Code Section */
.promo-code-section {
    margin: 20px 0;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
}

#promo-code {
    flex: 1;
    background: rgba(18, 18, 18, 0.8) !important;
    border: 1px solid #333 !important;
    border-right: none !important;
    border-radius: 8px 0 0 8px;
    padding: 12px 15px;
    color: #f5f5f5 !important;
    font-size: 1rem;
    height: 46px;
}

#promo-code:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.apply-promo-btn {
    padding: 0 20px;
    background: #00a7e6;
    color: white;
    border: 1px solid #333;
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 46px;
    line-height: 44px;
    white-space: nowrap;
}

.apply-promo-btn:hover:not(:disabled) {
    background: #0086b8;
}

.apply-promo-btn:disabled {
    background: #666;
    border-color: #666;
    cursor: not-allowed;
}

#promo-message {
    margin-top: 10px;
    font-size: 0.9rem;
}

#promo-message.error-message {
    color: #ff4444;
}

#promo-message.success-message {
    color: #00e676;
}

.summary-line.discount {
    color: #00e676;
}

.summary-line.discount.hidden {
    display: none;
}