/* MTG Digital Shelf — Frontend Styles */

/* ── Shop loop product image fix ─────────────────────────────────
   The core issue: WooCommerce / Storefront sets object-fit:cover
   which crops the card. We override to contain so the full card
   is always visible with a dark background padding.
──────────────────────────────────────────────────────────────────*/

/* WooCommerce product thumbnail on the shop loop */
ul.products li.product .woocommerce-loop-product__link img,
ul.products li.product img.attachment-woocommerce_thumbnail,
ul.products li.product img.wp-post-image,
ul.products li.product .mds-scryfall-image {
    width: 100% !important;
    height: 200px !important;       /* fixed height — smaller card */
    object-fit: contain !important; /* show FULL card, no crop */
    object-position: center center !important;
    background: #090b10 !important;
    display: block !important;
    padding: 8px !important;        /* breathing room around the card */
}

/* Image wrapper background so the padding area looks clean */
ul.products li.product .woocommerce-loop-product__link,
ul.products li.product a:first-child {
    background: #090b10;
    display: block;
}

/* Remove any transform/scale on hover that could look odd with contain */
ul.products li.product:hover img {
    transform: none !important;
}

/* ── Product page single image ────────────────────────────────── */
.woocommerce div.product .woocommerce-product-gallery__image img,
.woocommerce div.product .woocommerce-product-gallery img {
    object-fit: contain !important;
    background: #090b10 !important;
    padding: 12px !important;
    border-radius: 6px;
}

/* ── Scryfall image class (used in hooks) ─────────────────────── */
.mds-scryfall-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background: #090b10;
    padding: 8px;
    display: block;
}

/* ── General plugin styles ───────────────────────────────────── */
.mds-set-badge {
    display: inline-block;
    background: #c89b3c;
    color: #0c0e14;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 6px;
}
.mds-foil-tag  { color: #ce93d8; }
.mds-ref-price { font-size: 11px; color: #999; margin-top: 2px; }

.mds-payment-info { background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 6px; padding: 20px 24px; margin-top: 20px; }
.mds-payment-info h3 { font-size: 14px; color: #2e7d32; margin-bottom: 8px; }

/* ── Shortcode product grid ──────────────────────────────────── */
.mds-sc-wrap { background: #0c0e14; padding: 28px 20px; border-radius: 8px; margin: 0 0 32px; }
.mds-sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #c89b3c; }
.mds-sc-title { font-family: Georgia, serif; font-size: 18px; color: #c89b3c; margin: 0; letter-spacing: 2px; text-transform: uppercase; }
.mds-sc-count { font-size: 12px; color: #8a7d65; }

.mds-sc-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }
@media(max-width:1100px){ .mds-sc-grid{ grid-template-columns: repeat(4,1fr); } }
@media(max-width:860px) { .mds-sc-grid{ grid-template-columns: repeat(3,1fr); } }
@media(max-width:600px) { .mds-sc-grid{ grid-template-columns: repeat(2,1fr); } }

.mds-sc-card { background: #12151f; border: 1px solid #1e2130; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; }
.mds-sc-card:hover { transform: translateY(-3px); border-color: #c89b3c; box-shadow: 0 6px 18px rgba(200,155,60,.2); }

.mds-sc-img-link { display: block; text-decoration: none; background: #090b10; }

/* Shortcode card image — full card, no crop */
.mds-sc-img-wrap { position: relative; background: #090b10; overflow: hidden; }
.mds-sc-img-wrap img {
    width: 100%;
    height: 180px;           /* small fixed height */
    object-fit: contain;     /* full card visible */
    object-position: center;
    display: block;
    padding: 8px;
    background: #090b10;
}
.mds-sc-noimg { display: flex; align-items: center; justify-content: center; font-size: 36px; color: #2a2d4a; height: 180px; }

.mds-sc-badge { position: absolute; top: 6px; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.mds-badge-foil { right: 6px; background: #6a1b9a; color: #e1bee7; }
.mds-badge-sale { left: 6px; background: #b71c1c; color: #ffcdd2; }

.mds-sc-info { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; }
.mds-sc-set { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.mds-sc-name { font-family: Georgia, serif; font-size: 13px; font-weight: 600; color: #e8dfc8; text-decoration: none; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.mds-sc-name:hover { color: #c89b3c; }
.mds-sc-price, .mds-sc-price .woocommerce-Price-amount { font-family: Georgia, serif; font-size: 15px; font-weight: 700; color: #c89b3c; }
.mds-sc-price ins { text-decoration: none; }
.mds-sc-ref { font-size: 10px; color: #444; margin-bottom: 8px; }

.mds-sc-btn { display: block; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 8px 0; margin-top: auto; border-radius: 4px; text-decoration: none; transition: background .2s, color .2s; border: 1px solid; }
.mds-btn-add    { background: transparent; border-color: #c89b3c; color: #c89b3c; }
.mds-btn-add:hover { background: #c89b3c; color: #0c0e14; }
.mds-btn-select { background: transparent; border-color: #2a2d4a; color: #8a7d65; }
.mds-btn-select:hover { background: #1a1d2e; border-color: #c89b3c; color: #c89b3c; }
