/* -------------------- CSS VARIABLES FOR THEMING -------------------- */
:root {
    /* Dark Mode (Default) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --border-color: #333;
    --header-bg: #1e3c72;
    --accent-color: #4a9eff;
    --accent-dark: #0077cc;
    --product-bg: #1a1a1a;
    --input-bg: #2a2a2a;
    --input-border: #444;
    --input-text: #e8e8e8;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --hover-overlay: rgba(255, 255, 255, 0.05);
}

/* Light Mode */
body.light-mode {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9faff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #ddd;
    --header-bg: #1e3c72;
    --accent-color: #1e90ff;
    --accent-dark: #0077cc;
    --product-bg: #f9f9ff;
    --input-bg: #ffffff;
    --input-border: #ddd;
    --input-text: #333;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-overlay: rgba(0, 0, 0, 0.02);
}

/* -------------------- GENERAL -------------------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    background: var(--bg-primary) !important;
    color: var(--text-primary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout shells */
.page-shell {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: var(--bg-primary);
}

.card-surface {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 6px 16px var(--shadow-color);
    padding: 1.5rem;
    width: 100%;
}

/* -------------------- HEADER & NAV -------------------- */
header {
    background: var(--header-bg);
    color: #fff;
    padding: 1rem;
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    line-height: 1.2;
}

/* New header layout */
.site-header {
    background: #0f172a;
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .03rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.03rem;
    flex-wrap: wrap;
}

.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.45rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 2px;
}

.mobile-username {
    display: none;
    color: #e5e7eb;
    font-weight: 600;
}

.brand-title a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    letter-spacing: 0.02em;
}

.user-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 220px;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cart-row {
    width: 100%;
    text-align: right;
}

.primary-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    align-self: flex-start;
    margin-top: -2rem; /* pull nav upward to reduce vertical spacing */
}

.primary-nav a,
.user-row a,
.cart-link,
.auth-link,
.logout-link,
.admin-link,
.settings-link,
.orders-link,
.employee-files-link {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    transition: background 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.user-row a:hover,
.cart-link:hover,
.auth-link:hover,
.logout-link:hover,
.admin-link:hover,
.settings-link:hover,
.orders-link:hover,
.employee-files-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.settings-link,
.orders-link,
.employee-files-link {
    font-size: 1.1rem;
    padding: 0.35rem 0.55rem;
}

.cart-link {
    display: inline-block;
    background: rgba(125, 211, 252, 0.15);
    color: #bfdbfe;
    font-weight: 700;
}

.cart-link:hover {
    background: rgba(125, 211, 252, 0.25);
    color: #e0f2fe;
}

.username {
    color: #e5e7eb;
    font-weight: 600;
}

@media (max-width: 768px) {
    .site-header {
        align-items: center;
    }

    .header-top {
        flex-direction: column;
        align-items: center;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .user-block {
        align-items: center;
        display: none;
    }

    .user-row {
        justify-content: center;
    }

    .cart-row {
        text-align: center;
    }

    .primary-nav {
        justify-content: center;
        display: none;
    }

    .mobile-username {
        display: inline-block;
        margin-top: 0.25rem;
    }

    .site-header.menu-open .user-block,
    .site-header.menu-open .primary-nav {
        display: flex;
    }
}

nav:not(.navbar) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.nav-left a,
nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.85rem, 2vw, 1rem);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-left a:hover,
nav a:hover {
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* Back button styling */
.nav-left a:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255,255,255,0.15);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-left a:first-child:hover {
    background-color: rgba(255,255,255,0.25);
}

.nav-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: fit-content;
    margin-left: auto;
    justify-content: flex-end;
}

/* Keep Bootstrap navbar items aligned to the right when ms-auto is used */
.navbar-nav.ms-auto {
    margin-left: auto !important;
    justify-content: flex-end;
    width: 100%;
}

.navbar-collapse {
    justify-content: flex-end;
}

.user-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
}

.username {
    word-break: break-word;
    max-width: 120px;
}

.settings-link {
    font-size: 1.2rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

/* Theme toggle button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* -------------------- FOOTER -------------------- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--header-bg);
    color: #fff;
    margin-top: 3rem;
    box-shadow: 0 -2px 8px var(--shadow-color);
    width: 100%;
}

footer p {
    margin: 0;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.section-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: var(--accent-color);
}

.muted {
    color: var(--text-secondary);
    margin: 0.25rem 0 0.5rem 0;
}

.pill {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pill-danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.4);
}

/* -------------------- MAIN CONTENT -------------------- */
main {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* -------------------- HERO -------------------- */
.hero {
    text-align: center;
    padding: clamp(2rem, 10vh, 4rem) 1rem;
    background: linear-gradient(120deg, #007BFF, #0056b3);
    color: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.1rem);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-btn {
    display: inline-block;
    margin-top: 0.5rem;
    background: #fff;
    color: #007BFF;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    border-radius: 5px;
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    border: 2px solid #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hero-btn:hover {
    background: #e5e5e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.section-cta {
    text-align: center;
    margin-top: 1.25rem;
}

/* -------------------- ABOUT SECTION -------------------- */
.about-section {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background-color 0.3s ease;
}

.about-section h2,
.about-section h3 {
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    line-height: 1.2;
}

.about-section h3 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
}

.about-section p,
.about-section ul {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.about-section ul {
    padding-left: 1.5rem;
}

.about-section ul li {
    margin-bottom: 0.75rem;
}

/* -------------------- PRODUCTS GRID -------------------- */
.home-products-container,
.products-grid,
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
    width: 100%;
    background: var(--bg-primary);
}

.home-product-card,
.product-tile,
.product-card {
    background: var(--product-bg);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.product-tile:hover,
.product-card:hover,
.home-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-tile img,
.product-card img,
.home-product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.product-tile h3,
.product-card h3,
.home-product-card h3 {
    margin: 0.5rem 0 1rem 0;
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--accent-color);
    text-decoration: none;
    line-height: 1.4;
    flex-grow: 1;
}

.product-tile p,
.product-card p,
.product-card a,
.home-product-card a {
    margin: 0.5rem 0;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.product-tile .sold-out,
.product-card .sold-out {
    color: red;
    font-weight: bold;
    display: block;
    margin-top: 0.5rem;
}

.product-tile .add-to-cart,
.product-card .add-to-cart {
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: clamp(0.85rem, 2vw, 1rem);
    min-height: 2.5rem;
}

.product-tile .add-to-cart:hover,
.product-card .add-to-cart:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

.product-tile .add-to-cart:active,
.product-card .add-to-cart:active {
    transform: translateY(0);
}

/* View Details Button */
.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: clamp(0.85rem, 2vw, 1rem);
    min-height: 2.5rem;
}

.view-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    text-decoration: none;
}

.view-btn:active {
    transform: translateY(0);
}

/* Product detail page */
.product-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.product-image img {
    width: 100%;
    max-width: 520px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 18px var(--shadow-color);
}

.product-info {
    text-align: center;
}

.product-page .card-surface {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.product-page .product-info h2 {
    margin-bottom: 0.5rem;
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.price {
    color: var(--accent-color);
    font-weight: 700;
}

/* -------------------- FORMS -------------------- */
form {
    width: 100%;
}

.auth-card {
    max-width: 500px;
    margin: 0 auto;
}

.auth-form {
    margin-top: 1rem;
}

.form-error {
    color: #ff6b6b;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.form-success {
    color: #4ade80;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.form-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: -0.25rem 0 1rem 0;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.inline-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inline-form {
    display: inline;
}

label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: clamp(0.95rem, 2vw, 1rem);
    font-family: inherit;
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

button[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: clamp(0.95rem, 2vw, 1rem);
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    min-height: 2.5rem;
}

button[type="submit"]:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* -------------------- CART PAGE -------------------- */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.cart-table thead {
    background-color: var(--header-bg);
    color: white;
}

.cart-table th,
.cart-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.cart-table tbody tr:hover {
    background-color: var(--hover-overlay);
}

/* -------------------- ADMIN TABLES -------------------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    background: var(--bg-primary);
}

.admin-table thead {
    background-color: var(--header-bg);
    color: white;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
}

.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-table tbody tr:hover {
    background-color: var(--hover-overlay);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-completed {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.admin-search-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.admin-search-form input,
.admin-search-form select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.admin-search-form input {
    flex: 2;
    min-width: 200px;
}

.admin-search-form select {
    flex: 1;
    min-width: 150px;
}

.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination span {
    color: var(--text-primary);
    font-weight: 500;
}

/* -------------------- ORDER DETAIL PAGE -------------------- */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.info-block {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.info-block h3 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.info-block p {
    margin: 0.5rem 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.info-block a {
    color: var(--accent-color);
    text-decoration: none;
}

.info-block a:hover {
    text-decoration: underline;
}

.order-status-form {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    max-width: 500px;
}

.order-status-form label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.order-status-form label:first-of-type {
    margin-top: 0;
}

.order-status-form select,
.order-status-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.order-status-form button {
    margin-right: 0.5rem;
}

/* -------------------- SETTINGS BUTTONS -------------------- */
.settings-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.settings-buttons button,
.settings-buttons .logout-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.3s ease;
    min-height: 2.5rem;
}

.settings-buttons button[type="submit"] {
    background-color: #28a745;
    color: white;
    width: 100%;
}

.settings-buttons button[type="submit"]:hover {
    background-color: #218838;
}

.logout-btn {
    background-color: #dc3545;
    color: white;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* -------------------- CART STYLING -------------------- */
.cart-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* -------------------- CHECKOUT STYLING -------------------- */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.checkout-section {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.checkout-section h3 {
    margin-top: 0;
    color: var(--accent-color);
}

.cart-summary {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
}

.total-items {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.required {
    color: #ff6b6b;
}

.checkout-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    text-decoration: none;
}

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

    .checkout-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

.cart-list li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.cart-list li:first-child {
    font-weight: bold;
    border-bottom: 2px solid var(--accent-color);
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

.cart-list li span.service-name {
    flex: 2;
    text-align: left;
    color: var(--text-primary);
}

.cart-list li span.quantity {
    flex: 1;
    text-align: center;
    color: var(--text-primary);
}

.cart-list li:first-child span {
    text-align: center;
    flex: 1;
    color: var(--accent-color);
}

.cart-list li button.remove-from-cart {
    flex: 1;
    text-align: center;
    padding: 5px 10px;
    background-color: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cart-list li button.remove-from-cart:hover {
    background-color: #d9363e;
}

.cart-total {
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
    color: var(--text-primary);
}

/* -------------------- MEDIA QUERIES -------------------- */

/* Tablets */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    header,
    footer {
        padding: 1rem;
    }

    .hero {
        padding: clamp(1.5rem, 8vh, 3rem) 1rem;
    }

    .about-section {
        padding: 1.25rem;
    }

    nav {
        gap: 0.5rem;
    }

    .nav-left {
        gap: 0.25rem;
        width: 100%;
    }

    .nav-left a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .nav-right {
        width: 100%;
        align-items: flex-start;
        margin-left: 0;
        justify-content: flex-start;
    }

    .user-top {
        font-size: 0.8rem;
    }

    .username {
        max-width: 100%;
    }

    .settings-buttons {
        grid-template-columns: 1fr;
    }

    .home-products-container,
    .products-grid,
    .product-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .cart-table {
        font-size: 0.85rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.5rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    main {
        padding: 0.75rem;
    }

    header,
    footer {
        padding: 0.75rem;
    }

    .hero {
        padding: 1.5rem 0.75rem;
        margin-bottom: 1rem;
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .about-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .about-section h2 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .about-section ul {
        padding-left: 1.25rem;
    }

    .about-section ul li {
        margin-bottom: 0.5rem;
    }

    nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .nav-left {
        flex-direction: column;
        width: 100%;
    }

    .nav-left a {
        padding: 0.5rem;
        display: block;
        text-align: center;
    }

    .nav-right {
        align-items: stretch;
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .nav-right a {
        padding: 0.5rem;
        display: block;
        text-align: center;
    }

    .user-top {
        flex-direction: column;
        align-items: center;
    }

    .home-products-container,
    .products-grid,
    .product-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .product-tile,
    .product-card,
    .home-product-card {
        padding: 1rem;
    }

    .card-surface {
        padding: 1.25rem;
    }

    .card-surface {
        padding: 1rem;
    }

    .product-tile h3,
    .product-card h3,
    .home-product-card h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .product-tile .add-to-cart,
    .product-card .add-to-cart {
        padding: 0.6rem 1rem;
    }

    .settings-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .settings-buttons button,
    .settings-buttons .logout-btn {
        min-height: 2.25rem;
        padding: 0.6rem;
    }

    label {
        font-size: 0.95rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        padding: 0.6rem;
        font-size: 1rem;
    }

    button[type="submit"] {
        padding: 0.6rem;
        min-height: 2.25rem;
    }

    .cart-table {
        font-size: 0.8rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.4rem;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.1rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

    .about-section h2 {
        font-size: 1rem;
    }

    .product-tile,
    .product-card,
    .home-product-card {
        padding: 0.75rem;
    }

    main {
        padding: 0.5rem;
    }
}

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