:root {
    --primary: #1e64b8;
    /* A nice professional blue */
    --primary-hover: #154c8f;
    --bg: #ffffff;
    --bg-light: #f3f4f6;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --radius: 6px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
.top-header {
    background-color: #fff;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.top-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo a {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--text);
    font-weight: 600;
}

/* Advanced Search Bar */
.search-form.advanced-search {
    flex: 1;
    max-width: 800px;
    display: flex;
    border-radius: var(--radius);
}

.advanced-search .search-select,
.advanced-search .search-input-wrapper {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    border: 1px solid var(--border);
}

.advanced-search .search-select {
    border-right: none;
    min-width: 150px;
}

.advanced-search .search-select:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.advanced-search .search-input-wrapper {
    flex: 1;
    border-right: none;
}

.advanced-search label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.advanced-search select,
.advanced-search input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    color: #111827;
    background-color: transparent;
    width: 100%;
    padding: 0;
}

.advanced-search select {
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="none" stroke="%236b7280" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 1rem;
    padding-right: 1.5rem;
    cursor: pointer;
}

.advanced-search button {
    background-color: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    padding: 0 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.advanced-search button:hover {
    background-color: var(--primary-hover);
}

/* Header Icons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
    font-size: 0.85rem;
    position: relative;
}

.header-action svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.header-action:hover {
    color: var(--primary);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Main Navigation */
.main-nav {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

.main-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.main-nav a:hover {
    color: var(--primary);
    background-color: #f9fafb;
}

.main-nav a.active {
    background-color: var(--primary);
    color: #fff;
}

.main-nav a.sale {
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
    color: #fff;
}

.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0 4rem;
}

/* Hero Section */
.hero {
    background-color: #e5e7eb;
    /* Fallback while image loads */
    border-radius: var(--radius, 8px);
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    min-height: 350px;
    position: relative;
    overflow: hidden;

    /* Clean image background with no dark overlay */
    background-image: url('../assets/images/coverimg.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.hero-content {
    max-width: 55%;
    z-index: 2;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
    /* Dark text for a bright background */
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: #374151;
    /* Darker gray for readability */
    margin-bottom: 2rem;
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 1.5rem;
    }

    .hero-content {
        max-width: 100%;
    }
}

/* Sections */
.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.category-card {
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.category-card img {
    height: 48px;
    width: auto;
}

.category-card span {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 1rem;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.add-to-cart-form button {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

/* Footer */
.main-footer {
    background-color: var(--primary);
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #fff;
}

.footer-col p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-col ul a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    font-size: 0.85rem;
}

/* Forms & Other UI elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: #fff;
    color: var(--text);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(30, 100, 184, 0.2);
}

.form-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--bg-light);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Dashboard Profile Styles */
.dashboard-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.dashboard-sidebar {
    width: 250px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
}

.dashboard-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-nav li {
    border-bottom: 1px solid var(--border);
}

.dashboard-nav li:last-child {
    border-bottom: none;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.dashboard-nav a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.dashboard-nav li.active a {
    background: var(--bg-light);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.dashboard-content {
    flex: 1;
}

.profile-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-card .card-header {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: #334155;
}

.profile-card .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-card .card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
}

.pref-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    color: #475569;
    font-size: 0.95rem;
}

.dashboard-tabs-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.dashboard-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.dashboard-tabs .tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

.dashboard-tabs .tab-btn:hover {
    color: var(--primary);
}

.dashboard-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.form-select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
    }
}

/* Stock Status */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    width: fit-content;
}

.stock-status.in-stock {
    color: #16a34a;
}

.stock-status.out-stock {
    color: var(--danger);
}

.stock-status svg {
    flex-shrink: 0;
}
/* Remove default numeric up-down arrows from all quantity inputs globally */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type='number'] {
    -moz-appearance: textfield;
}

.product-card {
    position: relative;
}
.product-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}
.add-to-cart-form {
    position: relative;
    z-index: 2;
}
