/**
 * Global Typography & Base Styles
 * Mobile Accessories E-commerce — Modernized
 * Load AFTER theme-variables.css and Bootstrap
 */

/* ── Global Reset & Font Application ── */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--gray-800);
    background-color: var(--gray-50);
    letter-spacing: var(--tracking-normal);
    padding-top: 60px;
    /* Offset for sticky navbar */
}

/* ── Headings — Plus Jakarta Sans ── */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--gray-900);
    margin-bottom: 0.5em;
}

h1,
.h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-extrabold);
}

h2,
.h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-bold);
}

h3,
.h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-bold);
}

h4,
.h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-semibold);
}

h5,
.h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
}

h6,
.h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-semibold);
}

/* ── Paragraphs ── */
p {
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
    margin-bottom: 1rem;
}

/* ── Links ── */
a {
    color: var(--text-accent, var(--primary));
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ── Small Text & Captions ── */
small,
.small,
.text-muted {
    font-size: var(--font-size-sm);
    color: var(--gray-500) !important;
}

.text-caption {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    font-weight: var(--font-semibold);
}

/* ── Selection Color ── */
::selection {
    background-color: var(--accent-light);
    color: var(--gray-900);
}

/* ── Focus Styles — Accessible ── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Form Inputs — Modern Feel ── */
.form-control,
.form-select {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    border-color: var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    color: var(--gray-800);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Buttons — Polished ── */
.btn {
    font-family: var(--font-primary);
    font-weight: var(--font-medium);
    font-size: var(--font-size-sm);
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    transition: all var(--transition-fast);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

/* ── Cards — Refined default ── */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

/* ── Tables (if used) ── */
th {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

td {
    color: var(--gray-600);
}

/* ── Badges — Softer ── */
.badge {
    font-family: var(--font-primary);
    font-weight: var(--font-semibold);
    font-size: var(--font-size-xs);
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
}

/* ── Breadcrumbs ── */
.breadcrumb {
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
}

/* ── Modals — Slightly refined ── */
.modal-title {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
}

.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-xl);
}

/* ── Responsive Font Scaling ── */
@media (max-width: 767px) {

    h1,
    .h1 {
        font-size: 1.75rem;
    }

    h2,
    .h2 {
        font-size: 1.5rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    h4,
    .h4 {
        font-size: 1.125rem;
    }
}