/* ════════════════════════════════════════
   Trinket Cart — Public Shop
   Mobile-first, desktop enhanced
════════════════════════════════════════ */

#tc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
}

.tc-section-title {
    font-size: 1.6em;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(128,128,128,.3);
}

/* ── Categories ── */
.tc-category-section { margin-bottom: 48px; }

.tc-category-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 16px;
    padding: 8px 14px;
    background: #f4f4f4;
    border-left: 4px solid #3a6bbf;
    border-radius: 0 6px 6px 0;
    color: #333;
}

/* ════════════════════════════════════════
   PRODUCT GRID
   Mobile: 1 col  |  Desktop: max 3 col
════════════════════════════════════════ */
.tc-product-grid {
    display: grid;
    grid-template-columns: 1fr;      /* mobile: 1 per row */
    gap: 20px;
}

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

@media ( min-width: 1000px ) {
    .tc-product-grid {
        grid-template-columns: repeat( 3, 1fr );   /* max 3 per row */
    }
}

/* ════════════════════════════════════════
   PRODUCT CARD
   Mobile: image left, info right
   Desktop: image top, info below
════════════════════════════════════════ */
.tc-product-card {
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;

    /* Mobile: horizontal layout */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.tc-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

/* Desktop: stack vertically */
@media ( min-width: 700px ) {
    .tc-product-card {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Gallery ── */
.tc-gallery {
    background: #f8f8f8;
    flex-shrink: 0;

    /* Mobile: fixed left column width */
    width: 130px;
}

@media ( min-width: 700px ) {
    .tc-gallery {
        width: 100%;   /* full width on desktop */
    }
}

.tc-gallery-main { overflow: hidden; }

.tc-product-img {
    display: block;
    width: 100%;
    object-fit: cover;
    transition: opacity .25s ease;

    /* Mobile: square-ish thumbnail */
    height: 120px;
}

@media ( min-width: 700px ) {
    .tc-product-img {
        height: 200px;   /* taller on desktop */
    }
}

.tc-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 12px;
    height: 120px;
}

@media ( min-width: 700px ) {
    .tc-no-img { height: 200px; }
}

/* Thumbnail strip — hidden on mobile to save space */
.tc-thumb-strip {
    display: none;
}

@media ( min-width: 700px ) {
    .tc-thumb-strip {
        display: flex;
        gap: 6px;
        padding: 8px;
        overflow-x: auto;
        background: #f0f0f0;
        scrollbar-width: thin;
    }
    .tc-thumb-strip::-webkit-scrollbar { height: 4px; }
    .tc-thumb-strip::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
}

.tc-thumb {
    width: 56px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: .75;
    transition: opacity .15s, border-color .15s;
}
.tc-thumb:hover  { opacity: 1; }
.tc-thumb.active { border-color: #3a6bbf; opacity: 1; }

/* ── Product info panel ── */
.tc-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

@media ( min-width: 700px ) {
    .tc-product-info { padding: 16px; }
}

.tc-product-name {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 5px;
    line-height: 1.3;
}

@media ( min-width: 700px ) {
    .tc-product-name { font-size: 1.05em; }
}

.tc-product-desc {
    font-size: .82em;
    color: #555;
    margin: 0 0 8px;
    line-height: 1.45;
    flex: 1;
}

.tc-product-price {
    font-size: 1.05em;
    font-weight: 700;
    color: #2c7a3e;
    margin: 0 0 10px;
}

/* ── Qty stepper ── */
.tc-qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.tc-qty-btn {
    width: 34px;
    height: 34px;
    background: #f4f4f4;
    border: none;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    color: #333;
    transition: background .15s;
    flex-shrink: 0;
    line-height: 1;
}
.tc-qty-btn:hover  { background: #e0e0e0; }
.tc-qty-btn:active { background: #d0d0d0; }

.tc-qty {
    width: 40px;
    height: 34px;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    font-size: .95em;
    -moz-appearance: textfield;
}
.tc-qty::-webkit-inner-spin-button,
.tc-qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Add to Cart button ── */
.tc-add-btn {
    width: 100%;
    padding: 9px 12px;
    background: #3a6bbf;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .88em;
    font-weight: 600;
    transition: background .2s;
    text-align: center;
}
.tc-add-btn:hover { background: #2d57a0; }

/* ════════════════════════════════════════
   CART
════════════════════════════════════════ */
#tc-cart-items { margin-bottom: 16px; }

.tc-cart-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(128,128,128,.3);
}
.tc-cart-row:last-child { border-bottom: none; }

.tc-cart-item-name {
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
}
.tc-cart-item-price {
    font-size: .85em;
    opacity: .65;
    white-space: nowrap;
    text-align: right;
}
.tc-cart-item-sub {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
    min-width: 56px;
}

.tc-cart-item-qty {
    width: 48px;
    padding: 5px 4px;
    border: 1px solid rgba(128,128,128,.4);
    border-radius: 5px;
    text-align: center;
    background: transparent;
    color: inherit;
    font-size: .9em;
}

.tc-remove-btn {
    background: none;
    border: none;
    color: #cc0000;
    cursor: pointer;
    font-size: 1em;
    padding: 4px 6px;
    flex-shrink: 0;
    line-height: 1;
}

#tc-cart-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 2px solid rgba(128,128,128,.3);
}
#tc-cart-total { flex: 1; font-size: 1.1em; font-weight: 700; }

/* ════════════════════════════════════════
   CHECKOUT FORM
════════════════════════════════════════ */
#tc-checkout-form { max-width: 640px; margin-top: 20px; }

.tc-form-row      { display: flex; gap: 16px; }
.tc-two-col > *   { flex: 1; }
.tc-three-col > * { flex: 1; }
.tc-form-group    { margin-bottom: 16px; }
.tc-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: .9em;
}
.tc-form-group input,
.tc-form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(128,128,128,.4);
    border-radius: 6px;
    font-size: .95em;
    box-sizing: border-box;
    font-family: inherit;
    background: transparent;
    color: inherit;
}
.tc-form-group textarea { resize: vertical; }
.tc-req { color: #cc0000; }

.tc-notice {
    background: rgba(240,184,73,.15);
    border-left: 3px solid #f0b849;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: .88em;
    color: inherit;
    opacity: .85;
    margin-bottom: 18px;
}

.tc-form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.tc-error { color: #cc0000; margin-top: 10px; font-size: .9em; }

/* Order summary in checkout */
#tc-order-summary {
    background: rgba(128,128,128,.1);
    border: 1px solid rgba(128,128,128,.3);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
    max-width: 640px;
}
#tc-order-summary h4 { margin: 0 0 10px; color: inherit; }
.tc-summary-line { display: flex; justify-content: space-between; font-size: .9em; padding: 3px 0; }
.tc-summary-total { font-weight: 700; border-top: 1px solid rgba(128,128,128,.3); padding-top: 8px; margin-top: 6px; }

/* ════════════════════════════════════════
   SHARED BUTTONS
════════════════════════════════════════ */
#tc-checkout-btn, #tc-submit-btn {
    padding: 10px 22px;
    background: #2c7a3e;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: .95em;
    font-weight: 700;
    transition: background .2s;
}
#tc-checkout-btn:hover, #tc-submit-btn:hover { background: #225f30; }

#tc-continue-btn, #tc-back-btn {
    padding: 10px 18px;
    background: transparent;
    color: inherit;
    border: 1px solid rgba(128,128,128,.5);
    border-radius: 7px;
    cursor: pointer;
    font-size: .9em;
    transition: opacity .2s;
}
#tc-continue-btn:hover, #tc-back-btn:hover { opacity: .7; }

#tc-new-order-btn {
    padding: 10px 24px;
    background: #3a6bbf;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: .95em;
    font-weight: 700;
    margin-top: 16px;
}

/* ════════════════════════════════════════
   CONFIRMATION
════════════════════════════════════════ */
#tc-confirm-box {
    text-align: center;
    max-width: 480px;
    margin: 40px auto;
    padding: 40px;
    border: 1px solid rgba(128,128,128,.3);
    border-radius: 12px;
    background: transparent;
    color: inherit;
}
#tc-confirm-box h2 {
    color: inherit;
    margin-bottom: 12px;
}
#tc-confirm-box p {
    color: inherit;
    opacity: .85;
}
.tc-confirm-icon {
    width: 64px;
    height: 64px;
    background: #2c7a3e;
    color: #fff;
    font-size: 2em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* ════════════════════════════════════════
   MOBILE FORM STACK
════════════════════════════════════════ */
@media ( max-width: 600px ) {
    .tc-form-row { flex-direction: column; gap: 0; }
    #tc-cart-footer { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════
   SEARCH BAR
════════════════════════════════════════ */
#tc-search-wrap {
    position: relative;
    margin-bottom: 24px;
    max-width: 480px;
}
#tc-search-input {
    width: 100%;
    padding: 11px 40px 11px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color .2s;
}
#tc-search-input:focus {
    outline: none;
    border-color: #3a6bbf;
}
#tc-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1em;
    color: #999;
    cursor: pointer;
    display: none;
    padding: 4px;
}
#tc-search-clear:hover { color: #333; }

#tc-search-results {
    margin-bottom: 24px;
}
.tc-search-heading {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 12px;
    color: #555;
}
.tc-search-empty {
    color: #888;
    font-style: italic;
}

/* ════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════ */
#tc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#tc-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    cursor: pointer;
}
#tc-lightbox-box {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 16px;
}
#tc-lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
#tc-lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    z-index: 2;
}
#tc-lightbox-prev,
#tc-lightbox-next {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 2.5em;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 6px;
    transition: background .15s;
    line-height: 1;
    flex-shrink: 0;
}
#tc-lightbox-prev:hover,
#tc-lightbox-next:hover { background: rgba(255,255,255,.3); }
#tc-lightbox-prev.tc-hidden,
#tc-lightbox-next.tc-hidden { visibility: hidden; }

#tc-lightbox-counter {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: .85em;
    white-space: nowrap;
}
