/* Custom Theme CSS - Quiet Corner Winery Brand */
/* Based on dark-theme structure with QC brand colors and static-qc aesthetic */
/* This file contains ALL styles from dark-theme.css adapted for custom theme */

:root {
    /* Custom QC Brand Color Variables */
    /* Using burgundy and gold brand colors with light backgrounds and dark text */
    --bs-body-color: #333333;
    --bs-body-color-rgb: 51, 51, 51;
    --bs-body-bg: #f7f7f7;
    --bs-body-bg-rgb: 247, 247, 247;
    --bs-emphasis-color: #253551;
    --bs-emphasis-color-rgb: 37, 53, 81;
    --bs-secondary-color: rgba(51, 51, 51, .75);
    --bs-secondary-color-rgb: 51, 51, 51;
    --bs-secondary-bg: #ffffff;
    --bs-secondary-bg-rgb: 255, 255, 255;
    --bs-tertiary-color: rgba(51, 51, 51, .5);
    --bs-tertiary-color-rgb: 51, 51, 51;
    --bs-tertiary-bg: #f0f0f0;
    --bs-tertiary-bg-rgb: 240, 240, 240;
    --bs-primary-text-emphasis: #253551;
    --bs-secondary-text-emphasis: #666666;
    --bs-success-text-emphasis: #198754;
    --bs-info-text-emphasis: #0c5460;
    --bs-warning-text-emphasis: #bfb53c;
    --bs-danger-text-emphasis: #a71930;
    --bs-light-text-emphasis: #495057;
    --bs-dark-text-emphasis: #212529;
    --bs-primary-bg-subtle: #f5e5e5;
    --bs-secondary-bg-subtle: #f0f0f0;
    --bs-success-bg-subtle: #d1e7dd;
    --bs-info-bg-subtle: #cff4fc;
    --bs-warning-bg-subtle: #fff3cd;
    --bs-danger-bg-subtle: #f8d7da;
    --bs-light-bg-subtle: #f8f9fa;
    --bs-dark-bg-subtle: #e2e2e2;
    --bs-primary-border-subtle: #e8d5d5;
    --bs-secondary-border-subtle: #d9d9d9;
    --bs-success-border-subtle: #a3cfbb;
    --bs-info-border-subtle: #9eeaf9;
    --bs-warning-border-subtle: #ffe69c;
    --bs-danger-border-subtle: #f1aeb5;
    --bs-light-border-subtle: #e9ecef;
    --bs-dark-border-subtle: #c0c0c0;
    --bs-heading-color: inherit;
    --bs-link-color: #253551;
    --bs-link-hover-color: #1a2637;
    --bs-link-color-rgb: 37, 53, 81;
    --bs-link-hover-color-rgb: 26, 38, 55;
    --bs-code-color: #d63384;
    --bs-highlight-color: #333333;
    --bs-highlight-bg: #fff3cd;
    --bs-border-color: #d0d0d0;
    --bs-border-color-translucent: rgba(0, 0, 0, .1);
    --bs-form-valid-color: #198754;

    /* Custom brand colors */
    --dark-red: #253551;
    --gold: #bfb53c;
    --white: #ffffff;
    --black: #333333;
    --dark-blue: #0c5460;
    --royal-blue: #253551;
    --bs-primary: #253551;
    --bs-secondary: #666666;
    --text-dark: #333333;
    --text-light: #666666;
}

/* Body and main layout custom theme */
body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 40px;
}

/* Header and footer styling */
.site-header, 
.site-footer {
    background: #253551;
    color: #ffffff;
    padding: 1.5em 2em;
    text-align: center;
    position: relative;
    border-bottom: none;
}

.site-footer {
    border-top: none;
    border-bottom: none;
}

/* Section titles */
.section-title {
    color: #ffffff;
    background-color: #253551;
    border: 1px solid var(--bs-border-color);
    text-align: center;
    padding-bottom: 0.75rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #253551;
    font-weight: 600;
}

/* Modern button fonts */
button, .btn, .login-btn, .logout-btn, .cart-btn, 
.add-to-cart-btn, .slider-btn, .nav-btn, .checkout-btn,
.reset-btn, .activities-btn, .edit-member-btn {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
}

/* Reward cards */
.reward-slide {
    background: #d1e7dd;
    color: #333333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Buttons */
.add-to-cart-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #198754;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    padding-bottom: 2px;
}

.add-to-cart-btn:hover {
    background: #157347;
    color: #ffffff;
}

.back-btn {
    background: #253551;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: #1a2637;
    color: #ffffff;
}

    .modal-category-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
    }

    .modal-category-header h2 {
        margin: 0;
    }

.slider-btn {
    background: #253551;
    color: #ffffff;
    border: none;
}

.slider-btn:hover {
    background: #1a2637;
}

/* Navigation buttons */
.nav-btn {
    background: #253551;
    color: #ffffff;
    border: 1px solid #1a2637;
}

.nav-btn:hover {
    background: #1a2637;
    color: #ffffff;
}

/* Modal */
.modal {
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: #ffffff;
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Modal close button styles */
.close,
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    color: #333333;
    cursor: pointer;
    z-index: 1000;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.close:hover,
.close-modal:hover {
    color: #a71930;
    opacity: 0.8;
}

/* Forms */
.modal-form input,
.modal-form select,
.modal-form textarea {
    padding: 0.8em;
    border-radius: 6px;
    font-size: 1em;
    background: #ffffff;
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: #253551;
    background: #ffffff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(37, 53, 81, 0.25);
}

.modal-form label {
    color: #333333;
    font-weight: bold;
    margin-bottom: 0.5em;
}

/* Form button styles */
.login-submit-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.5em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, color 0.2s;
}

.login-submit-btn:hover {
    background: #253551;
    color: #ffffff;
}

.modal-form .login-submit-btn,
.modal-form .modal-save-btn {
    margin-top: 1.2em;
    align-self: flex-end;
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, color 0.2s;
}

.modal-form .login-submit-btn:hover,
.modal-form .modal-save-btn:hover {
    background: #253551;
    color: #ffffff;
}

.reset-btn {
    background: #f0f0f0;
    color: #bfb53c;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    padding: 0.5em 1em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1em;
    margin-left: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, color 0.2s;
}

.reset-btn:hover {
    background: #fff3cd;
    color: #333333;
}

/* Connect Facebook button */
.connect-facebook-btn {
    background: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    justify-content: center;
}

.connect-facebook-btn:hover {
    background: #166fe5;
    transform: translateY(-1px);
}

.connect-facebook-btn:active {
    transform: translateY(0);
}

.connect-facebook-btn i {
    font-size: 1.2em;
}

/* Social buttons container */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

/* Connect X (Twitter) button */
.connect-x-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    justify-content: center;
}

.connect-x-btn:hover {
    background: #333333;
    transform: translateY(-1px);
}

.connect-x-btn:active {
    transform: translateY(0);
}

.connect-x-btn i {
    font-size: 1.2em;
}

/* Responsive social buttons */
@media (min-width: 768px) {
    .social-buttons {
        flex-direction: row;
        gap: 1em;
    }
    
    .connect-facebook-btn,
    .connect-x-btn {
        flex: 1;
    }
}

/* Cart modal */
.cart-modal-content {
    background: #ffffff;
    padding: 2em 2.5em;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
    color: var(--bs-body-color);
}

.cart-list {
    margin-top: 1em;
    margin-bottom: 2em;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7em 0;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: 1.05em;
    background: transparent;
}

.cart-item-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1em;
    border: 1px solid var(--bs-border-color);
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.cart-item-name {
    font-weight: 600;
    color: #333333;
}

.cart-item-cost {
    color: #666666;
    font-size: 0.95em;
}

.remove-cart-item {
    background: #f8d7da;
    color: #a71930;
    border: 1px solid #f1aeb5;
    border-radius: 6px;
    padding: 0.4em 0.8em;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.remove-cart-item:hover {
    background: #a71930;
    color: #ffffff;
}

/* Cart summary */
.cart-summary {
    border-top: 2px solid var(--bs-border-color);
    padding-top: 1em;
    margin-top: 1em;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5em 0;
    font-size: 1.1em;
}

.cart-summary-label {
    font-weight: 600;
    color: #333333;
}

.cart-summary-value {
    color: #333333;
    font-weight: 500;
}

.cart-total {
    font-size: 1.3em;
    font-weight: bold;
    color: #253551;
}

/* Checkout button */
.checkout-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 8px;
    padding: 0.8em 2em;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 1.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.checkout-btn:hover {
    background: #253551;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.checkout-btn:disabled {
    background: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Empty cart message */
.empty-cart-message {
    text-align: center;
    color: #666666;
    padding: 2em;
    font-size: 1.1em;
}

/* Login/Logout buttons */
.login-btn,
.logout-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    margin-left: 1em;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    height: 40px;
    min-height: 40px;
}

.login-btn:hover,
.logout-btn:hover {
    background: #253551;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Cart button */
.cart-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.cart-btn:hover {
    background: #253551;
    color: #ffffff;
    transform: translateY(-1px);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #a71930;
    color: #ffffff;
    border-radius: 50%;
    padding: 0.2em 0.5em;
    font-size: 0.8em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Member profile section */
.member-profile {
    background: #ffffff;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 2em;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.member-profile h2 {
    color: #253551;
    margin-bottom: 1em;
    border-bottom: 2px solid #bfb53c;
    padding-bottom: 0.5em;
}

.member-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.info-label {
    font-weight: 600;
    color: #666666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #333333;
    font-size: 1.1em;
}

/* Edit member button */
.edit-member-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1.5em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.edit-member-btn:hover {
    background: #253551;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Activities section */
.activities-section {
    background: #ffffff;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 2em;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.activities-section h2 {
    color: #253551;
    margin-bottom: 1em;
    border-bottom: 2px solid #bfb53c;
    padding-bottom: 0.5em;
}

.activities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    padding: 1em;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-date {
    color: #666666;
    font-size: 0.9em;
}

.activity-description {
    color: #333333;
    font-weight: 500;
}

.activity-points {
    color: #253551;
    font-weight: bold;
    font-size: 1.1em;
}

/* Activities button */
.activities-btn {
    background: #bfb53c;
    color: #333333;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.activities-btn:hover {
    background: #253551;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Points display */
.points-display {
    background: linear-gradient(135deg, #253551, #1a2637);
    color: #ffffff;
    padding: 2em;
    border-radius: 10px;
    text-align: center;
    margin: 2em 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.points-display h3 {
    color: #ffffff;
    margin-bottom: 0.5em;
    font-size: 1.2em;
}

.points-value {
    font-size: 3em;
    font-weight: bold;
    color: #bfb53c;
}

.points-label {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5em;
}

/* Rewards slider container */
.rewards-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2em 0;
    margin-bottom: 2em;
    position: relative;
}

.slider-track {
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    gap: 1.5em;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

.reward-slide {
    flex: 1 1 0;
    min-width: 0;
    max-width: 320px;
    text-align: center;
    border-radius: 12px;
    padding: 1em;
    margin: 0;
    opacity: 1;
    transition: opacity 0.5s, transform 0.3s;
}

.reward-slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.reward-img {
    max-width: 100%;
    max-height: 120px;
    margin-bottom: 1em;
    border-radius: 8px;
}

.reward-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333333;
    margin-bottom: 0.5em;
}

.reward-cost {
    font-size: 1em;
    color: #666666;
    margin-bottom: 1em;
}

/* Slider navigation */
.slider-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

#slider-prev {
    left: 10px;
}

#slider-next {
    right: 10px;
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Categories section */
.categories-section {
    background: #ffffff;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 2em;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.categories-section h2 {
    color: #253551;
    margin-bottom: 1.5em;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5em;
    padding: 1em 0;
}

.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5em;
    padding: 1em 0;
}

.category-card {
    background: #f8f9fa;
    border: 2px solid #ffe69c;
    border-radius: 10px;
    padding: 1.5em;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-card:hover {
    background: #bfb53c;
    border-color: #253551;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.active {
    background: #bfb53c;
    border-color: #253551;
}

.category-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5em;
    background: #f0f0f0;
}

.category-card h4 {
    margin: 0.5em 0 0 0;
    color: #253551;
    font-size: 1.1em;
}

.category-img {
    max-width: 100%;
    max-height: 100px;
    margin-bottom: 1em;
    border-radius: 8px;
}

.category-name {
    font-weight: bold;
    color: #333333;
    font-size: 1.1em;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        margin: 20px;
    }

    .site-header, .site-footer {
        padding: 1em;
    }

    .member-info {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1em;
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }

    .points-value {
        font-size: 2.5em;
    }

    .cart-modal-content {
        padding: 1.5em;
        min-width: 280px;
    }

    .modal-form {
        padding: 1.5em;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5em;
    }

    .reward-slide {
        max-width: 280px;
    }

    .checkout-btn {
        padding: 0.7em 1.5em;
        font-size: 1em;
    }
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid var(--bs-border-color);
    border-top: 4px solid #253551;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2em auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.error-message {
    background: #f8d7da;
    color: #a71930;
    border: 1px solid #f1aeb5;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
}

/* Success messages */
.success-message {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #a3cfbb;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
}

/* Info messages */
.info-message {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #9eeaf9;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #666666;
}

.hidden {
    display: none;
}

.mt-1 { margin-top: 0.5em; }
.mt-2 { margin-top: 1em; }
.mt-3 { margin-top: 1.5em; }
.mt-4 { margin-top: 2em; }

.mb-1 { margin-bottom: 0.5em; }
.mb-2 { margin-bottom: 1em; }
.mb-3 { margin-bottom: 1.5em; }
.mb-4 { margin-bottom: 2em; }

.p-1 { padding: 0.5em; }
.p-2 { padding: 1em; }
.p-3 { padding: 1.5em; }
.p-4 { padding: 2em; }

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better keyboard navigation */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #253551;
    outline-offset: 2px;
}

/* Modal overlay and structure */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 400px;
    padding: 2em;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    background: #ffffff;
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

/* Override for wide edit member modal */
#edit-member-modal .modal-content.wide-modal {
    max-width: 800px !important;
    width: 90vw;
}

/* Wider modal for checkout step 2 and address editing */
.modal-content.wide-modal {
    max-width: 800px !important;
    width: 90vw;
}

/* Modal forms */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.modal-form label {
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #333333;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
    padding: 0.8em;
    border-radius: 6px;
    font-size: 1em;
    background: #ffffff;
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: #253551;
    background: #ffffff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(37, 53, 81, 0.25);
}

/* Member details section */
.member-details {
    margin: 2em 0;
    padding: 1.5em;
    border-radius: 8px;
}

.member-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.member-details-list li {
    margin-bottom: 0.7em;
    font-size: 1.1em;
    color: #333333;
}

.member-details-label {
    font-weight: bold;
    color: #253551;
    margin-right: 0.5em;
}

.member-details-container.visible {
    opacity: 1;
    display: block;
}

/* Login/logout message */
.login-logout-message {
    text-align: center;
    padding: 1em;
    margin: 1em 0;
    border-radius: 6px;
    font-weight: bold;
}

/* All Rewards Modal Grid */
#all-rewards-modal .modal-content {
    max-width: 95vw;
    width: 1200px;
}

#all-rewards-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5em;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1em 0;
    justify-items: center;
}

#all-rewards-list .reward-slide {
    max-width: 320px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

#all-rewards-list .reward-img {
    max-height: 140px;
    object-fit: contain;
}

#category-rewards-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5em;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1em 0;
    justify-items: center;
}

#category-rewards-list .reward-slide {
    max-width: 320px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

#category-rewards-list .reward-img {
    max-height: 140px;
    object-fit: contain;
}

/* Reward details modal */
.reward-details-container {
    display: flex;
    gap: 2em;
    align-items: flex-start;
    color: #333333;
}

.reward-details-image {
    flex-shrink: 0;
    width: 100%;
    max-width: 420px;
}

.reward-details-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--bs-border-color);
    display: block;
}

.reward-details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.reward-details-actions {
    margin-top: auto;
    padding-top: 1em;
}

.add-to-cart-btn-large {
    background: #198754;
    color: #ffffff;
    border: none;
    padding: 0.85em 1.5em;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: background-color 0.2s ease;
}

.add-to-cart-btn-large:hover {
    background: #157347;
    color: #ffffff;
}

.add-to-cart-btn-large:disabled {
    background: #a8a8a8;
    cursor: not-allowed;
    color: #ffffff;
}

@media (max-width: 768px) {
    .reward-details-container {
        flex-direction: column;
        gap: 1.25em;
    }

    .reward-details-image {
        max-width: 100%;
    }
}

/* Cart item styles */
.cart-item-name {
    font-weight: bold;
    color: #333333;
}

.cart-item-count,
.cart-item-points {
    font-weight: bold;
    color: #333333;
}

/* Registration Form Styles */
.register-btn {
    background: #198754;
    color: #ffffff;
    border: none;
    padding: 0.7em 1.5em;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: background 0.3s ease;
    margin-right: 0.5em;
}

.register-btn:hover {
    background: #253551;
    transform: translateY(-2px);
}

.registration-form .form-section {
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid var(--bs-border-color);
}

.registration-form .form-section:last-of-type {
    border-bottom: none;
}

.registration-form .form-section h3 {
    color: #333333;
    font-size: 1.2em;
    margin-bottom: 1em;
    font-weight: 600;
}

.registration-form .form-row {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
}

.registration-form .form-row .form-group {
    flex: 1;
}

.registration-form .form-group {
    margin-bottom: 1em;
}

.registration-form label {
    display: block;
    margin-bottom: 0.5em;
    color: #333333;
    font-weight: 500;
}

.registration-form .required {
    color: #a71930;
    font-weight: bold;
}

.registration-form input[type="text"],
.registration-form input[type="email"],
.registration-form input[type="password"],
.registration-form select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background: #ffffff;
    color: var(--bs-body-color);
    font-size: 1em;
}

.registration-form input:focus,
.registration-form select:focus {
    outline: none;
    border-color: #253551;
    box-shadow: 0 0 0 3px rgba(37, 53, 81, 0.2);
}

.registration-form select:disabled {
    background: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
}

.checkbox-group {
    margin-bottom: 1em;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25em;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #253551;
}

.checkbox-label span {
    flex: 1;
    color: #333333;
}

.field-hint {
    display: block;
    font-size: 0.85em;
    color: #666666;
    margin-top: 0.25em;
    font-style: italic;
}

.registration-form input.error,
.registration-form select.error {
    border-color: #a71930 !important;
    box-shadow: 0 0 0 3px rgba(167, 25, 48, 0.2) !important;
}

.registration-form input.valid,
.registration-form select.valid {
    border-color: #0f5132 !important;
}

.registration-form input:focus.error,
.registration-form select:focus.error {
    border-color: #a71930 !important;
    box-shadow: 0 0 0 3px rgba(167, 25, 48, 0.3) !important;
}

.extended-fields-section {
    transition: all 0.3s ease;
}

.extended-fields-section[style*="display: none"] {
    display: none !important;
}

/* Responsive hardening */
.site-header .header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.site-header .header-actions > button {
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    height: 40px;
    min-height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.details-rewards-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2em;
}

.rewards-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.modal-content {
    width: min(92vw, 400px);
    max-height: 90vh;
}

.modal-content.wide-modal,
#edit-member-modal .modal-content.wide-modal {
    width: min(92vw, 800px);
}

.close,
.close-modal {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn,
.slider-btn,
.cart-plus-btn,
.cart-minus-btn {
    min-width: 44px;
    min-height: 44px;
}

@media (max-width: 1024px) {
    body {
        margin: 20px;
    }

    .rewards-buttons-container {
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    body {
        margin: 16px;
    }

    .details-rewards-row {
        flex-direction: column;
        align-items: stretch;
    }

    .site-header .header-actions {
        justify-content: stretch;
    }

    .site-header .header-actions > button {
        flex: 1 1 calc(50% - 0.6rem);
        height: 44px;
        min-height: 44px;
    }

    .rewards-buttons-container {
        width: 100%;
    }

    .rewards-buttons-container .activities-btn {
        width: 100%;
    }

    .registration-form .form-row {
        gap: 0.6rem;
        padding-left: 0;
        padding-right: 0;
    }

    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    #slider-prev {
        left: 4px;
    }

    #slider-next {
        right: 4px;
    }
}

@media (max-width: 640px) {
    .cart-item {
        flex-wrap: wrap;
        row-gap: 0.6rem;
        padding: 0.5em 0;
    }

    .cart-item-qty {
        margin-left: auto;
    }

    .cart-item-points {
        width: 100%;
        text-align: right;
    }

    .remove-cart-item {
        min-height: 44px;
        padding: 0.6em 1em;
    }
}

@media (max-width: 480px) {
    body {
        margin: 12px;
    }

    .section-title {
        font-size: 1.3em;
    }

    .site-header,
    .site-footer {
        padding: 1em;
    }

    .site-header .header-actions > button {
        flex: 1 1 100%;
        height: 44px;
        min-height: 44px;
    }

    .field-hint {
        font-size: 0.9em;
    }

    .modal-content {
        width: 94vw;
        padding: 1.25em;
    }

    .modal-content.wide-modal,
    #edit-member-modal .modal-content.wide-modal,
    #all-rewards-modal .modal-content {
        width: 94vw;
    }

    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .login-btn,
    .logout-btn,
    .cart-btn,
    .slider-btn,
    .edit-member-btn,
    .activities-btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .member-profile,
    .activities-section {
        break-inside: avoid;
    }
}
