/* Gem Gems v5.0.0 — component frontend base.
   Deliberately minimal: this file only provides the wrapper contract, the
   builder placeholders and the Product Details templates. All per-component
   styling is generated from the Component Designer and injected as scoped
   CSS, so nothing here competes with it (section 88/89). */

.gg-c { min-width: 0; }
.gg-c > * { max-width: 100%; }

/* Media safety (sections 22-26): a component never lets an image or video
   blow out the column it was placed in. */
.gg-c img { max-width: 100%; height: auto; }
.gg-c video { max-width: 100%; }
.gg-c iframe { max-width: 100%; }

/* Builder-only affordances — never rendered on the frontend. */
.gg-builder-placeholder,
.gg-builder-error {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    align-items: center;
}
.gg-builder-placeholder {
    border: 2px dashed #b9bcc4;
    background: #f6f7f7;
    color: #50575e;
}
.gg-builder-placeholder strong { font-size: 13px; letter-spacing: .08em; color: #1d2327; }
.gg-builder-placeholder span { font-size: 13px; }
.gg-builder-placeholder code,
.gg-builder-error code { background: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.gg-builder-error {
    border: 2px solid #d63638;
    background: #fcf0f1;
    color: #8a2424;
}
.gg-builder-error strong { font-size: 13px; letter-spacing: .06em; }

/* ---- Product Details templates (sections 39-40) ---- */
.ggsm-details { width: 100%; margin: 0; }

.ggsm-details-table { border-collapse: collapse; }
.ggsm-details-table th,
.ggsm-details-table td { padding: 10px 12px; border-bottom: 1px solid var(--gg-border, #e8e9ef); text-align: left; vertical-align: top; }
.ggsm-details-table th { width: 38%; font-weight: 600; color: var(--gg-muted, #6f7890); }
.ggsm-details-luxury th { color: var(--gg-navy, #030735); background: var(--gg-surface, #f7f8fb); }
.ggsm-details-luxury td { font-weight: 600; }

.ggsm-details-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.ggsm-detail-pair { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gg-border, #e8e9ef); }

.ggsm-details-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ggsm-detail-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--gg-border, #e8e9ef); border-radius: var(--gg-radius, 12px); background: var(--gg-white, #fff); }

.ggsm-details-list { list-style: none; padding: 0; }
.ggsm-details-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gg-border, #e8e9ef); }

.ggsm-detail-label { color: var(--gg-muted, #6f7890); font-size: 13px; }
.ggsm-detail-value { color: var(--gg-text, #1b2340); font-weight: 600; }

.ggsm-product-info-block { display: flex; flex-direction: column; gap: 12px; }

/* Mobile: tables become stacked rows so nothing is squeezed unreadably
   (section 40). */
@media (max-width: 600px) {
    .ggsm-details-two-column { grid-template-columns: 1fr; }
    .ggsm-details-table,
    .ggsm-details-table tbody,
    .ggsm-details-table tr,
    .ggsm-details-table th,
    .ggsm-details-table td { display: block; width: 100%; }
    .ggsm-details-table tr { padding: 8px 0; border-bottom: 1px solid var(--gg-border, #e8e9ef); }
    .ggsm-details-table th { border: 0; padding: 0 0 2px; font-size: 12px; }
    .ggsm-details-table td { border: 0; padding: 0; font-weight: 600; }
    .ggsm-detail-pair,
    .ggsm-details-list li { flex-direction: column; gap: 2px; }
}

/* ---- v5.1.0: CTA buttons, documents, badges ---- */
.ggsm-cta-group { display: flex; flex-wrap: wrap; gap: 10px; }
.ggsm-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
    border: 1px solid transparent; border-radius: var(--gg-radius-sm, 8px); font-weight: 700; text-decoration: none !important; cursor: pointer; font-size: 14px; }
.ggsm-cta-cart, .ggsm-cta-buy { background: var(--gg-gold, #d5aa4c); color: #10152c !important; }
.ggsm-cta-buy { background: var(--gg-navy, #030735); color: #fff !important; }
.ggsm-cta-line { background: #06c755; color: #fff !important; }
.ggsm-cta-phone { background: var(--gg-navy, #030735); color: #fff !important; }
.ggsm-cta-facebook { background: #1877f2; color: #fff !important; }
.ggsm-cta-inquiry, .ggsm-cta-share, .ggsm-cta-copy { background: transparent; border-color: var(--gg-border, #e8e9ef); color: var(--gg-text, #1b2340); }
.ggsm-cta-external { background: var(--gg-navy, #030735); color: #fff !important; }
.ggsm-cta:hover { filter: brightness(.95); }
.ggsm-cta.is-copied { background: #edfaef; color: #007017 !important; border-color: #007017; }

.ggsm-documents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ggsm-document { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px;
    border: 1px solid var(--gg-border, #e8e9ef); border-radius: var(--gg-radius-sm, 8px); background: var(--gg-white, #fff); }
.ggsm-document-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 8px; border-radius: 999px; background: var(--gg-surface, #f7f8fb); color: var(--gg-muted, #6f7890); }
.ggsm-document-link { font-weight: 600; text-decoration: none; }
.ggsm-document-meta { color: var(--gg-muted, #6f7890); margin-left: auto; }

.ggsm-product-badges-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.ggsm-badge-hot { background: #e8590c; }
.ggsm-badge-rare { background: #7048e8; }
.ggsm-badge-reserved { background: #f59f00; color: #241c00; }
.ggsm-badge-sold_out, .ggsm-badge-sold { background: #868e96; }
.ggsm-badge-status { background: var(--gg-navy, #030735); }
.ggsm-badge-coming_soon { background: #1971c2; }
.ggsm-badge-available { background: #2f9e44; }

.gg-builder-placeholder.is-hidden { border-style: solid; border-color: #f59f00; background: #fff9db; }

/* ---- v5.2.0: [gg_code] instance safety (sections 45-47) ---- */
.gg-code-instance {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}
.gg-code-instance * { box-sizing: border-box; }
.gg-code-instance img { max-width: 100%; height: auto; }
.gg-code-instance iframe, .gg-code-instance video { max-width: 100%; }

/* Animation (respects prefers-reduced-motion) */
.gg-code-animate { opacity: 0; }
.gg-code-animate.gg-code-in-view { opacity: 1; transition: opacity .6s ease, transform .6s ease; }
.gg-code-animate[data-gg-animation="fade"] { transform: none; }
.gg-code-animate[data-gg-animation="slide-up"] { transform: translateY(24px); }
.gg-code-animate[data-gg-animation="slide-up"].gg-code-in-view { transform: translateY(0); }
.gg-code-animate[data-gg-animation="slide-down"] { transform: translateY(-24px); }
.gg-code-animate[data-gg-animation="slide-down"].gg-code-in-view { transform: translateY(0); }
.gg-code-animate[data-gg-animation="slide-left"] { transform: translateX(24px); }
.gg-code-animate[data-gg-animation="slide-left"].gg-code-in-view { transform: translateX(0); }
.gg-code-animate[data-gg-animation="slide-right"] { transform: translateX(-24px); }
.gg-code-animate[data-gg-animation="slide-right"].gg-code-in-view { transform: translateX(0); }
.gg-code-animate[data-gg-animation="zoom"] { transform: scale(.94); }
.gg-code-animate[data-gg-animation="zoom"].gg-code-in-view { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
    .gg-code-animate { opacity: 1 !important; transform: none !important; transition: none !important; }
}
