/* =====================================================
   shop.css — Global styles, CSS variables, typography
   DizzyBazaar
   ===================================================== */

/* --- Google Font import --- */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Barlow:wght@400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
    /* Palette */
    --bg-primary:    #ffffff;
    --bg-secondary:  #fdf7f9;
    --bg-card:       #ffffff;
    --bg-input:      #ffffff;
    --accent:        #cc3d82;
    --accent-hover:  #a82d6b;
    --accent-muted:  rgba(204, 61, 130, 0.1);

    /* Text */
    --text-primary:   #1a1a1a;
    --text-secondary: #555555;
    --text-muted:     #8a7580;

    /* Borders */
    --border:         #e8dce3;
    --border-light:   #f2e9ee;

    /* Status colours */
    --success:  #22c55e;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;

    /* Spacing */
    --radius:    8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typography */
    --font-heading: 'Barlow Condensed', 'Arial Narrow', 'Impact', sans-serif;
    --font-body:    'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Transitions */
    --transition: 0.18s ease;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

ul, ol {
    list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 0.65em 1.4em;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

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

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

.btn--secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

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

.btn--ghost:hover {
    background-color: var(--accent-muted);
    color: var(--accent);
}

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

.btn--danger:hover {
    background-color: #dc2626;
    color: #fff;
}

.btn--lg {
    padding: 0.8em 2em;
    font-size: 1.1rem;
}

.btn--sm {
    padding: 0.4em 0.9em;
    font-size: 0.825rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.65em 0.9em;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8em center;
    padding-right: 2.2em;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.form-check input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-check label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 0;
}

/* --- Alerts / Messages --- */
.alert {
    padding: 0.8em 1em;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert--error {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.alert--success {
    background-color: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #15803d;
}

.alert--warning {
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}

.alert ul {
    padding-left: 1.2em;
    list-style: disc;
}

/* --- Condition badges --- */
.badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.badge--new               { background: #cc3d82; color: #fff; }
.badge--opened-never-used { background: #f8e6ef; color: #8f2758; }
.badge--like-new          { background: #d8eee4; color: #275346; }
.badge--used              { background: #efe2c9; color: #5f4b30; }
.badge--faulty-spares     { background: #f3d3d0; color: #8c302f; }

/* --- Layout utilities --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.container--narrow {
    max-width: 680px;
}

.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;
}
