* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Irish Heritage & Noble Palette - Optimized for Readability */
    --primary-color: #2D5016;         /* Deep forest green - Irish heritage */
    --primary-hover: #1F3610;         /* Darker green for hover */
    --accent-color: #D4AF37;          /* Gold - prestige and achievement */
    --accent-hover: #B8941F;          /* Darker gold */
    --secondary-color: #8B4513;       /* Saddle brown - historical warmth */
    --secondary-hover: #6B3410;       /* Darker brown */
    
    /* Text Colors - High Contrast for Readability */
    --text-primary: #1A1A1A;          /* Near black - excellent readability */
    --text-secondary: #4A4A4A;        /* Medium gray - clear but secondary */
    --text-light: #6B6B6B;            /* Light gray for subtle text */
    --text-on-dark: #FFFFFF;          /* White on dark backgrounds */
    --text-on-dark-secondary: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
    
    /* Background Colors */
    --background: #FFFFFF;            /* Pure white */
    --background-alt: #F5F5F0;        /* Warm off-white - easier on eyes */
    --background-subtle: #FAFAF8;     /* Very subtle warm tint */
    
    /* Panel Colors */
    --panel-black: #1A1A1A;          /* Soft black - less harsh than pure black */
    --panel-dark: #2D2D2D;            /* Dark gray for depth */
    --panel-primary: var(--primary-color); /* Green panel */
    
    /* Border & Divider */
    --border-color: #D4D4D4;         /* Light border - subtle */
    --border-light: #E8E8E8;         /* Very light border */
    --divider-color: #E0E0E0;         /* Section dividers */
    
    /* Status Colors */
    --error-color: #C41E3A;           /* Deep red - clear but not harsh */
    --success-color: #2D5016;         /* Forest green - matches primary */
    --warning-color: #B8860B;         /* Dark goldenrod */
    --info-color: #1E3A5F;            /* Navy blue for information */
    
    /* Shadows - Subtle and Professional */
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background-alt);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navigation Styles (shared across all pages) */
.main-nav {
    background: var(--panel-black);
    color: var(--text-on-dark);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none; /* prevent default link purple/underlines */
    color: inherit; /* keep logo text color consistent with navbar */
}

.nav-logo:visited {
    color: inherit;
    text-decoration: none;
}

.nav-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nav-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: inherit;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-on-dark-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-on-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: var(--panel-black);
        flex-direction: column;
        padding: 32px;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Split Layout Wrapper */
.checkout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Left Panel: Black Products */
.products-panel {
    width: 45%;
    background: var(--panel-black);
    color: var(--text-on-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    position: relative;
    overflow-y: auto;
}

.products-content {
    max-width: 500px;
    width: 100%;
}

.logo-container {
    text-align: center;
    margin-bottom: 24px;
}

.hema-logo {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto;
}

.products-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-on-dark);
    text-align: center;
}

.products-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
    text-align: center;
}

.membership-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.membership-card {
    background: var(--panel-dark);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.membership-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.membership-card.selected {
    border-color: var(--primary-color);
    background: rgba(45, 80, 22, 0.1);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(45, 80, 22, 0.2);
}

.membership-card.selected::before {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: var(--text-on-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.membership-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-on-dark);
}

.membership-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-on-dark);
}

.membership-price span {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.7;
}

.membership-features {
    list-style: none;
    margin-top: 16px;
}

.membership-features li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.membership-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary-color);
    color: var(--text-on-dark);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.selected-membership {
    background: var(--panel-dark);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.selected-membership p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.9);
}

.selected-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Right Panel: White Payment Form */
.payment-panel {
    width: 55%;
    background: var(--background);
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.payment-content {
    max-width: 700px;
    width: 100%;
    padding: 40px 32px;
}

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

.form-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Address and Payment Side by Side */
.payment-section {
    margin-bottom: 0;
}

/* Membership Type Selector */
.membership-type-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: var(--background-alt);
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: var(--primary-color);
}

.radio-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.radio-price {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Eircode Lookup */
.eircode-lookup {
    display: flex;
    gap: 8px;
}

.eircode-lookup input {
    flex: 1;
}

.lookup-button {
    padding: 12px 20px;
    font-size: 14px;
    background: var(--primary-color);
    color: var(--text-on-dark);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap;
}

.lookup-button:hover:not(:disabled) {
    background: var(--primary-hover);
}

.lookup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Address Header */
.address-header {
    margin-bottom: 20px;
}

.address-header h2 {
    margin-bottom: 0;
}

/* Payment Summary Box */
.payment-summary-box {
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.summary-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.summary-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Feedback Toast */
.feedback-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success-color);
    color: var(--text-on-dark);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.feedback-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
}

.toast-message {
    font-size: 15px;
    font-weight: 500;
}

/* Order Summary (hidden, kept for compatibility) */
.order-summary {
    background: var(--background-alt);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}

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

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
}

/* Payment Card Form */
.payment-card-form {
    margin-bottom: 24px;
}

.payment-form-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-container {
    margin-bottom: 20px;
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    height: 180px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--text-on-dark);
}

.card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #f5d020 0%, #f53803 100%);
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-number-display {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-family: 'Courier New', monospace;
}

.card-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.card-name-display {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-expiry-display {
    font-size: 14px;
    font-weight: 500;
}

.card-form-fields {
    background: var(--background-alt);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.card-form-fields .form-group {
    margin-bottom: 16px;
}

.card-form-fields .form-group:last-of-type {
    margin-bottom: 20px;
}

.card-form-fields input {
    font-family: 'Courier New', monospace;
}

.card-brands {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.card-brand {
    font-size: 12px;
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-brand.visa {
    color: #1a1f71;
}

.card-brand.mastercard {
    color: #eb001b;
}

.card-brand.amex {
    color: #006fcf;
}

/* Error Message */
.error-message {
    background: #fee;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

/* Privacy Notice */
.privacy-notice {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.privacy-notice p {
    margin-bottom: 8px;
}

.privacy-notice p:last-child {
    margin-bottom: 0;
}

.privacy-notice a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-on-dark);
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
}

.submit-button:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* GDPR Banner */
.gdpr-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-primary);
    color: var(--text-on-dark);
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.gdpr-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.gdpr-content p {
    margin: 0;
    flex: 1;
    font-size: 14px;
}

.gdpr-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.gdpr-buttons {
    display: flex;
    gap: 12px;
}

.gdpr-button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.gdpr-button.accept {
    background: var(--primary-color);
    color: var(--text-on-dark);
}

.gdpr-button.accept:hover {
    background: var(--primary-hover);
}

.gdpr-button.decline {
    background: transparent;
    color: var(--text-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gdpr-button.decline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-on-dark);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Payment Placeholder */
.payment-placeholder {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-wrapper {
        flex-direction: column;
    }

    .products-panel {
        width: 100%;
        min-height: auto;
        padding: 32px 24px;
    }

    .payment-panel {
        width: 100%;
    }

    .payment-content {
        padding: 32px 24px;
    }

    .membership-options {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 12px;
    }

    .membership-card {
        min-width: 260px;
        padding: 16px;
    }

    .hema-logo {
        width: 100px;
        height: 100px;
    }

    .products-title {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .products-panel {
        padding: 24px 16px;
    }

    .products-title {
        font-size: 22px;
    }

    .products-subtitle {
        font-size: 14px;
    }

    .payment-content {
        padding: 24px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .membership-options {
        flex-direction: column;
        gap: 12px;
    }

    .membership-card {
        padding: 16px;
    }

    .address-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .feedback-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        padding: 12px 20px;
    }

    .payment-details-box {
        padding: 16px;
    }

    .card-front {
        height: 160px;
        padding: 16px;
    }

    .card-number-display {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .gdpr-content {
        flex-direction: column;
        text-align: center;
    }

    .gdpr-buttons {
        width: 100%;
        justify-content: center;
    }

    .eircode-lookup {
        flex-direction: column;
    }

    .lookup-button {
        width: 100%;
    }

    .hema-logo {
        width: 80px;
        height: 80px;
    }
}
