/* ===========================
   CharliClaire.com — Public CSS
   Minimal, mobile-first
   =========================== */

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

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    color: #222;
    background: #fff;
}

img, picture, svg {
    display: block;
    max-width: 100%;
}

ul, ol {
    list-style: none;
}

a {
    color: #0055a5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Skip Link (accessibility) --- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: #0055a5;
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

/* --- Site Header & Nav --- */
.site-header {
    border-bottom: 1px solid #ddd;
    padding: 0.75rem 1rem;
}

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

.site-logo {
    order: 1;
    margin-right: auto;
    color: #222;
    font-size: 1.125rem;
    font-weight: 700;
}

.site-logo:hover {
    text-decoration: none;
}

.site-cart-link {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid #0055a5;
    border-radius: 999px;
    background: #0055a5;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.site-cart-link:hover {
    background: #004080;
    border-color: #004080;
    text-decoration: none;
}

.site-cart-icon {
    font-size: 1rem;
    line-height: 1;
}

.site-cart-count {
    font-variant-numeric: tabular-nums;
}

.site-header .site-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.nav-toggle {
    order: 3;
    background: none;
    border: 1px solid #888;
    padding: 0.35rem 0.6rem;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

/* Mobile nav: collapsed by default */
.nav-menu {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: 0.5rem;
}

.nav-menu.open {
    display: flex;
}

.nav-menu li a {
    display: block;
    padding: 0.5rem 0;
    border-top: 1px solid #eee;
}

/* Desktop: show nav inline, hide toggle */
@media (min-width: 768px) {
    .site-nav {
        flex-wrap: nowrap;
        width: 100%;
    }

    .site-logo {
        margin-right: 0;
    }

    .nav-toggle {
        display: none;
    }

    .nav-menu {
        order: 2;
        display: flex;
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-start;
        flex-direction: row;
        gap: 1.25rem;
        padding-top: 0;
        margin-left: 1.5rem;
    }

    .nav-menu li a {
        border-top: none;
        padding: 0;
    }

    .site-cart-link {
        order: 3;
        margin-left: 1rem;
        flex: 0 0 auto;
        background: #fff;
        color: #0055a5;
    }

    .site-cart-link:hover {
        background: #f0f5fb;
        border-color: #0055a5;
    }
}

/* --- Main Content --- */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    main {
        flex: 1 0 auto;
        width: 100%;
    }
}

/* --- Site Footer --- */
.site-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    font-size: 0.875rem;
    color: #4b5563;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
}

.footer-inner > nav {
    flex: 1 1 auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.footer-links a {
    color: #1f2937;
}

.footer-external a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
}

.footer-external a::after {
    content: "\2197";
    font-size: 0.8em;
}

.footer-external a:hover {
    text-decoration: none;
    border-color: #9ca3af;
    background: #f9fafb;
}

.footer-copy {
    color: #6b7280;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .footer-copy {
        margin-left: auto;
        text-align: right;
    }
}

/* --- Focus States (WCAG 2.1 AA) --- */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 2px solid #0055a5;
    outline-offset: 2px;
}

/* --- Progress Bar --- */
.progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    height: 1.25rem;
    overflow: hidden;
}

.progress-fill {
    background: #0055a5;
    height: 100%;
    transition: width 0.3s ease;
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Product Card --- */
.product-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    padding: 0.75rem;
    position: relative;
}

.product-card:hover {
    border-color: #c8c8c8;
}

.product-card h4 {
    font-size: 1rem;
    margin: 0.5rem 0 0.25rem;
    line-height: 1.3;
}

.product-card .price {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.product-card-image-link {
    display: block;
    color: inherit;
}

.product-card-image {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    background: #f1f1f1;
}

.product-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    padding: 0.75rem;
    border-radius: 4px;
    background: #f1f1f1;
    color: #666;
    text-align: center;
    font-size: 0.9rem;
}

.shop-area-block {
    margin-top: 1.5rem;
}

.shop-category-block {
    margin-top: 1rem;
}

.shop-category-heading {
    margin-bottom: 0.5rem;
}

.shop-product-meta {
    color: #555;
    font-size: 0.9rem;
}

.cart-page h1 {
    margin-bottom: 1rem;
}

.cart-alert {
    padding: 0.65rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 0.9rem;
}

.cart-alert-success {
    border-color: #1f7a43;
    background: #eef9f1;
    color: #14542e;
}

.cart-alert-error {
    border-color: #b83b2c;
    background: #fff3f1;
    color: #7c2319;
}

.cart-items {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cart-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cart-item-title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.cart-item-meta {
    color: #555;
}

.cart-item-line-total {
    margin-top: 0.2rem;
    font-weight: 700;
}

.cart-total {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.cart-checkout-form {
    max-width: 460px;
}

.cart-checkout-note {
    margin-top: 0.35rem;
    color: #555;
}

@media (max-width: 479px) {
    .cart-item {
        flex-direction: column;
    }
}

.product-adjacent-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.product-adjacent-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 132px;
    height: 205px;
    max-height: 205px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.product-adjacent-card:hover {
    border-color: #c8c8c8;
}

.product-adjacent-card-image,
.product-adjacent-card-placeholder {
    display: block;
    width: 100%;
    height: 169px;
    object-fit: cover;
    object-position: top center;
    background: #f1f1f1;
}

.product-adjacent-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    color: #666;
    padding: 0.3rem;
    line-height: 1.2;
}

.product-adjacent-card-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    text-align: center;
    font-size: 17px;
    line-height: 1;
    font-weight: 700;
}

.product-adjacent-card-disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* --- Product Gallery --- */
.product-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- Badge: Sold Out --- */
.badge-sold-out {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
}

/* --- Forms --- */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #888;
    border-radius: 3px;
    background: #fff;
    color: #222;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: #f0f0f0;
}

.btn-primary {
    background: #0055a5;
    color: #fff;
    border-color: #0055a5;
}

.btn-primary:hover {
    background: #004080;
}
