/* Components CSS - Reusable component styles */

/* Card components */
.card-minimal {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-minimal:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Button components */
.btn-minimal {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Form components */
.form-minimal input,
.form-minimal select,
.form-minimal textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid #dbdbdb;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    transition: border-color 0.3s ease;
}

.form-minimal input:focus,
.form-minimal select:focus,
.form-minimal textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* Product grid (shop catalog) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
}

.product-card {
    display: block;
    color: inherit;
    background: var(--color-surface);
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.product-card-image {
    aspect-ratio: 1 / 1;
    background-color: #f0f0f0;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 2rem;
}

.product-card-body {
    padding: 0.75rem 1rem 1rem;
}

.product-card-category {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin: 0 0 0.25rem;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

.product-card-price {
    font-weight: 600;
    margin: 0;
}

.product-card-stock {
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

/* Product detail */
.product-detail-image,
.product-detail-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #f0f0f0;
}

.product-detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 3rem;
}

/* Cart table */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.cart-table th {
    background-color: #fafafa;
    font-weight: 500;
}

.cart-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Admin layout */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 96px);
}

.admin-sidebar {
    flex: 0 0 220px;
    background-color: #fafafa;
    border-right: 1px solid #eee;
    padding: 1.5rem 0;
}

.admin-sidebar a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #333;
}

.admin-sidebar a:hover,
.admin-sidebar a.is-active {
    background-color: rgba(0, 0, 0, 0.06);
    color: #000;
}

.admin-main {
    flex: 1;
    padding: 2rem;
}

/* Auth component */
.auth-inline {
    background: var(--color-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    max-width: 400px;
    margin: 0 auto;
}

.auth-inline .field {
    margin-bottom: var(--spacing-md);
}

.auth-inline .button {
    width: 100%;
}

/* Modal component */
.modal-minimal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-minimal.is-active {
    display: flex;
}

.modal-content-minimal {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Navigation improvements */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-burger {
    cursor: pointer;
}

/* Notification component */
.notification-minimal {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

.notification-minimal.is-success {
    background: var(--color-success);
    color: white;
}

.notification-minimal.is-warning {
    background: var(--color-warning);
    color: #363636;
}

.notification-minimal.is-danger {
    background: var(--color-danger);
    color: white;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--color-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Section containers */
.section-minimal {
    padding: var(--spacing-xxl) var(--spacing-lg);
}

@media (max-width: 768px) {
    .section-minimal {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* =====================================================================
   Editorial product catalog — "passport-stamped boutique inventory"
   Palette: cream paper #fbf7ef, ink #1a1f2e, ochre stamp #8c6a3a,
            sold-out crimson #8b1e2c.
   Type:    Playfair Display (titles + price), Montserrat (caps meta).
   ===================================================================== */

.catalog-page {
    background: #fbf7ef;
    color: #1a1f2e;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.catalog-header {
    text-align: center;
    padding: 3.5rem 1.5rem 2rem;
    border-bottom: 1px solid rgba(26, 31, 46, 0.08);
}

.catalog-header__eyebrow {
    display: inline-block;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #8c6a3a;
    margin: 0 0 0.75rem;
}

.catalog-header__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-style: italic;
    font-weight: 400;
    line-height: 1.05;
    color: #1a1f2e;
    margin: 0 0 0.85rem;
}

.catalog-header__count {
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(26, 31, 46, 0.5);
    margin: 0;
}

.catalog-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    flex: 1;
}

.catalog-empty {
    text-align: center;
    padding: 6rem 1rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    color: rgba(26, 31, 46, 0.4);
}

.catalog-footer {
    text-align: center;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(26, 31, 46, 0.08);
}

.catalog-cartlink {
    display: inline-block;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #1a1f2e;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid currentColor;
    transition: color 0.3s ease, transform 0.3s ease;
}

.catalog-cartlink:hover,
.catalog-cartlink:focus-visible {
    color: #8c6a3a;
}

/* ---------- Grid ---------- */
.pc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1rem;
    padding: 2.5rem 0 1rem;
}

@media (min-width: 640px) {
    .pc-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .pc-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem 1.75rem;
    }
}

@media (min-width: 1400px) {
    .pc-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ---------- Card ---------- */
.pc-card {
    display: block;
    color: inherit;
    text-decoration: none;
    position: relative;
    isolation: isolate;
    transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
}

.pc-card:hover,
.pc-card:focus-visible {
    color: inherit;
    transform: translateY(-4px);
    outline: none;
}

.pc-card:focus-visible .pc-title {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

/* ---------- Image frame ---------- */
.pc-imagewrap {
    position: relative;
    aspect-ratio: 4 / 5;
    margin: 0;
    overflow: hidden;
    background: #ede5d5;
    border: 1px solid rgba(26, 31, 46, 0.08);
}

.pc-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
}

.pc-card:hover .pc-image {
    transform: scale(1.04);
}

.pc-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(26, 31, 46, 0.28);
    background:
        repeating-linear-gradient(135deg,
            transparent 0,
            transparent 22px,
            rgba(26, 31, 46, 0.035) 22px,
            rgba(26, 31, 46, 0.035) 23px);
}

/* ---------- Passport-stamp origin chip ---------- */
.pc-stamp {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: rgba(251, 247, 239, 0.94);
    border: 1.25px solid #c5a572;
    color: #8c6a3a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(-4deg);
    box-shadow:
        inset 0 0 0 2px rgba(251, 247, 239, 0.5),
        0 1px 0 rgba(0, 0, 0, 0.04);
    z-index: 2;
    line-height: 1;
    pointer-events: none;
}

.pc-stamp__top {
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.42rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.18rem;
    opacity: 0.85;
}

.pc-stamp__code {
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
}

/* ---------- Card body ---------- */
.pc-body {
    padding-top: 0.75rem;
}

.pc-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(26, 31, 46, 0.5);
    margin: 0 0 0.4rem;
    min-height: 0.7rem;
}

.pc-number {
    color: #8c6a3a;
}

.pc-meta__dot {
    flex: 0 0 auto;
    width: 3px;
    height: 3px;
    background: currentColor;
    opacity: 0.4;
}

.pc-category {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.pc-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.98rem;
    line-height: 1.25;
    font-weight: 400;
    color: #1a1f2e;
    margin: 0 0 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(26, 31, 46, 0.12);
}

.pc-price {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #1a1f2e;
    margin: 0;
    letter-spacing: 0.01em;
}

.pc-arrow {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.95rem;
    color: rgba(26, 31, 46, 0.4);
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1), color 0.3s ease;
}

.pc-card:hover .pc-arrow {
    transform: translateX(6px);
    color: #8c6a3a;
}

/* ---------- Sold out ---------- */
.pc-card--sold .pc-image {
    filter: grayscale(1);
    opacity: 0.5;
}

.pc-card--sold .pc-title,
.pc-card--sold .pc-price,
.pc-card--sold .pc-meta {
    color: rgba(26, 31, 46, 0.4);
}

.pc-card--sold .pc-stamp {
    opacity: 0.5;
}

.pc-soldbanner {
    position: absolute;
    top: 50%;
    left: -12%;
    right: -12%;
    background: #8b1e2c;
    color: #fbf7ef;
    text-align: center;
    font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.45rem 0;
    transform: translateY(-50%) rotate(-6deg);
    box-shadow: 0 2px 10px rgba(139, 30, 44, 0.28);
    z-index: 3;
    pointer-events: none;
}

/* ---------- Small-screen tightening ---------- */
@media (max-width: 480px) {
    .catalog-header { padding: 2.5rem 1rem 1.5rem; }
    .catalog-container { padding: 0 1rem 3rem; }
    .pc-grid { gap: 1.75rem 0.75rem; padding-top: 2rem; }
    .pc-stamp { width: 2.2rem; height: 2.2rem; top: 0.4rem; right: 0.4rem; }
    .pc-stamp__top { font-size: 0.38rem; margin-bottom: 0.14rem; }
    .pc-stamp__code { font-size: 0.7rem; }
    .pc-title { font-size: 0.9rem; }
    .pc-price { font-size: 1rem; }
}