/* ==========================================================================
   CROWNWELL PRESS -- Page-Specific Styles
   Supplements styles.css with components specific to individual pages.
   ========================================================================== */


/* ==========================================================================
   FLEX UTILITY (used by header layout)
   ========================================================================== */

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ==========================================================================
   IMPRINT CARDS (Homepage)
   ========================================================================== */

.imprint-card {
    border: 1px solid var(--color-border);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    transition: border-color var(--transition-base);
}

.imprint-card:hover {
    border-color: var(--color-antique-gold);
}

.imprint-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: 0.04em;
    margin-bottom: var(--space-md);
}

.imprint-card p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
}


/* ==========================================================================
   CATEGORY CARDS (Catalog page)
   ========================================================================== */

.category-card {
    padding: var(--space-xl);
    border: 1px solid var(--color-border);
    transition: border-color var(--transition-base);
}

.category-card:hover {
    border-color: var(--color-antique-gold);
}

.category-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-antique-gold);
    margin-bottom: var(--space-sm);
}

.category-card p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.75;
}


/* ==========================================================================
   CATALOG FILTER BAR
   ========================================================================== */

.catalog-filter-bar {
    padding: var(--space-xl) 0;
    border-bottom: var(--border-muted);
}

.filter-select-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-select-group .form-label {
    font-size: 0.65rem;
    margin-bottom: 0;
}

.filter-select-group .form-select {
    min-width: 180px;
}

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

@media (max-width: 767px) {
    .catalog-filters {
        flex-direction: column;
    }

    .filter-select-group .form-select {
        min-width: 0;
        width: 100%;
    }
}


/* ==========================================================================
   CATALOG EMPTY STATE
   ========================================================================== */

.catalog-empty-state {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.catalog-empty-state p {
    font-size: var(--text-base);
    color: var(--color-text-muted);
}


/* ==========================================================================
   BREADCRUMB NAVIGATION
   ========================================================================== */

.breadcrumb-nav {
    background-color: var(--color-bg-secondary);
    padding: var(--space-lg) 0;
    border-bottom: var(--border-muted);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-muted);
}

.breadcrumb li::after {
    content: '/';
    color: var(--color-border);
}

.breadcrumb li:last-child::after {
    content: '';
}

.breadcrumb li a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumb li a:hover {
    color: var(--color-antique-gold);
    text-decoration: none;
}

.breadcrumb li[aria-current="page"] {
    color: var(--color-text-primary);
}


/* ==========================================================================
   BOOK DETAIL -- Supplementary Styles
   ========================================================================== */

.book-detail-subtitle {
    font-family: var(--font-heading);
    font-size: var(--text-md);
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.book-detail-volume {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-antique-gold);
    margin-bottom: var(--space-lg);
}

.imprint-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-antique-gold);
    border: 1px solid var(--color-antique-gold);
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Format option labels inside the format selector */
.format-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-body);
    margin-bottom: var(--space-xs);
}

.format-price {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--color-antique-gold);
}

.format-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    min-width: 120px;
}

/* Book cover placeholder (used in book detail) */
.book-cover-placeholder {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 2 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    border: 1px solid var(--color-border);
}

.book-cover-placeholder-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--color-text-on-dark);
    line-height: 1.3;
}

.book-cover-placeholder-author {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-muted-on-dark);
    margin-top: var(--space-md);
}


/* ==========================================================================
   SPECIFICATIONS TABLE (Book Detail)
   ========================================================================== */

.specs-table {
    border-top: 2px solid var(--color-antique-gold);
}

.specs-table td.spec-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    width: 160px;
    white-space: nowrap;
}


/* ==========================================================================
   GOLD RULE (horizontal divider in content)
   ========================================================================== */

hr.gold-rule {
    height: 1px;
    background-color: var(--color-antique-gold);
    margin: var(--space-xl) 0;
}


/* ==========================================================================
   STORE PAGE -- Book Covers and Grid
   ========================================================================== */

.book-grid {
    display: grid;
    gap: var(--space-xl);
}

.book-grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .book-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .book-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.book-cover {
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.book-cover-title {
    font-family: var(--font-heading);
    font-size: var(--text-md);
    font-weight: 400;
    color: var(--color-text-on-dark);
    line-height: 1.4;
}

.book-card-info {
    padding: var(--space-lg);
}

.book-card-category {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-top: var(--space-xs);
}


/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 767px) {
    .book-detail {
        grid-template-columns: 1fr;
    }

    .book-cover-placeholder {
        max-width: 300px;
        margin: 0 auto;
    }

    .book-detail-format-select {
        flex-direction: column;
    }

    .format-option {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }
}


/* ==========================================================================
   SNIPCART E-COMMERCE INTEGRATION
   ========================================================================== */

/* Cart icon in header */
.header-cart-btn {
    display: flex;
    align-items: center;
    position: relative;
    color: var(--color-text-body-on-dark);
    transition: color var(--transition-base);
    margin-left: var(--space-lg);
    text-decoration: none;
}

.header-cart-btn:hover {
    color: var(--color-antique-gold);
    text-decoration: none;
}

.header-cart-btn .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-antique-gold);
    color: var(--color-ink-black);
    border-radius: 50%;
    line-height: 1;
}

.header-cart-btn .cart-count:empty {
    display: none;
}

/* Add to Cart button area in book cards */
.book-card-actions {
    padding: 0 var(--space-lg) var(--space-lg);
}

.book-card-actions .btn {
    width: 100%;
}

/* Snipcart theme overrides to match Crownwell brand */
.snipcart-modal__container {
    z-index: 600 !important;
}

.snipcart-cart-header {
    background-color: var(--color-surface-dark) !important;
}

.snipcart-cart-header__title {
    font-family: var(--font-heading) !important;
    letter-spacing: 0.05em !important;
}

.snipcart-btn--highlight {
    background-color: var(--color-antique-gold) !important;
    color: var(--color-ink-black) !important;
}

.snipcart-btn--highlight:hover {
    background-color: #9A7324 !important;
}

/* Hide cart count badge on mobile when zero */
@media (max-width: 767px) {
    .header-cart-btn {
        margin-left: var(--space-md);
    }
}
