﻿/*
    GraphicItemsDisplay.css
    תצוגה משותפת ועצמאית ל-List<Graphics>.
    העיצוב מבוסס על כרטיסי הקטלוג.
*/

.graphic-items-view,
.graphic-items-view * {
    box-sizing: border-box;
}

.graphic-items-view {
    --giv-text: #18324d;
    --giv-muted: #6c7782;
    --giv-accent: #e84783;
    --giv-border: #e5e9ed;

    direction: rtl;
    text-align: right;

    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 24px;
    align-items: stretch;
}

.graphic-items-view .giv-card {
    position: relative;
    min-width: 0;
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;

    border: 1px solid var(--giv-border);
    border-radius: 15px;
    background: #fff;
    overflow: hidden;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.graphic-items-view.mode-order .giv-card {
    cursor: pointer;
}

.graphic-items-view .giv-card:hover {
    border-color: #d7e0e6;
    box-shadow: 0 7px 20px rgba(24, 50, 77, .07);
}

.graphic-items-view.mode-order .giv-card.selected {
    border: 2px solid #1683ff;
    box-shadow: 0 0 0 2px rgba(22, 131, 255, .06);
}

.graphic-items-view .giv-check {
    display: none;
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;

    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #1683ff;
    color: #fff;

    font-size: 18px;
    font-weight: 800;

    box-shadow: 0 3px 10px rgba(22,131,255,.22);
}

.graphic-items-view.mode-order .giv-card.selected .giv-check {
    display: flex;
}

/* -----------------------------
   תמונה – כמו בקטלוג
   ----------------------------- */

.graphic-items-view .giv-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 22% 18%,
            rgba(230,221,207,.20),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #fcfbf9 0%,
            #f6f3ee 100%
        );
}

.graphic-items-view .giv-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    padding: 0;
    transition: transform .2s ease;
}

.graphic-items-view:not(.is-search) .giv-card:hover .giv-main-image {
    transform: scale(1.015);
}

/* תוצאות חיפוש – לא חותכים גרפיקה */
.graphic-items-view.is-search .giv-image-wrap {
    background:
        radial-gradient(
            circle at 22% 18%,
            rgba(230,221,207,.22),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #fcfbf9 0%,
            #f4f1ec 100%
        );
}

.graphic-items-view.is-search .giv-main-image {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;

    object-fit: contain;
    object-position: center;
    padding: 0;
    background: transparent;

    position: absolute;
    inset: 0;
    margin: auto;
}

.graphic-items-view.is-search .giv-main-image.giv-portrait {
    max-width: 82%;
    max-height: 90%;
}

.graphic-items-view.is-search .giv-main-image.giv-landscape {
    max-width: 90%;
    max-height: 82%;
}

.graphic-items-view.is-search .giv-main-image.giv-square {
    max-width: 88%;
    max-height: 88%;
}

.graphic-items-view.is-search .giv-card:hover .giv-main-image {
    transform: none;
}

/* קוד על התמונה – כמו בקטלוג */
.graphic-items-view .giv-code-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 4;

    padding: 6px 11px;
    border-radius: 8px;

    background: rgba(24,50,77,.94);
    color: #fff;

    font-size: 18px;
    line-height: 1;
    font-weight: 800;

    box-shadow: 0 3px 10px rgba(24,50,77,.18);
    direction: ltr;
}

/* חדש */
.graphic-items-view .giv-new-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;

    padding: 5px 10px;
    border-radius: 999px;

    background: #fff;
    color: var(--giv-accent);

    font-size: 12px;
    font-weight: 800;

    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

/* -----------------------------
   מידע וכפתור – כמו בקטלוג
   ----------------------------- */

.graphic-items-view .giv-info {
    padding: 12px 14px 14px;
    text-align: right;

    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;

    min-height: 142px;
}

.graphic-items-view .giv-info:after {
    content: "";
    flex: 1 1 auto;
    min-height: 0;
}

.graphic-items-view .giv-name {
    margin: 0 0 7px;

    color: var(--giv-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;

    text-align: center;
}

.graphic-items-view .giv-name.giv-name-medium {
    font-size: 14px;
    line-height: 1.4;
}

.graphic-items-view .giv-name.giv-name-long {
    font-size: 12.5px;
    line-height: 1.35;
}

.graphic-items-view .giv-order-button {
    width: 100%;
    min-height: 42px;

    margin: 4px 0 6px;
    padding: 9px 14px;

    border: 0;
    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            #ec2f7b 0%,
            #ff846b 100%
        );

    color: #fff;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-shadow: 0 5px 14px rgba(232,71,131,.16);

    transition:
        transform .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}

.graphic-items-view .giv-order-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(232,71,131,.22);
    color: #fff;
}

/* -----------------------------
   תמונות נוספות
   ----------------------------- */

.graphic-items-view .giv-thumbs {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    direction: rtl;
    gap: 5px;

    min-height: 46px;
    padding: 4px 0 0;
    margin: 0;

    overflow-x: auto;
    scrollbar-width: thin;
}

/* אם יש רק תמונה אחת – לא נוצרת השורה בכלל */
.graphic-items-view .giv-thumb {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;

    border: 1px solid #dfe4e8;
    border-radius: 6px;

    background: #fff;
    padding: 2px;

    cursor: pointer;
    overflow: hidden;
}

.graphic-items-view .giv-thumb:hover,
.graphic-items-view .giv-thumb.active {
    border-color: var(--giv-accent);
}

.graphic-items-view .giv-thumb img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 4px;
}

/* בחיפוש לא מציגים תמונות נוספות */
.graphic-items-view.is-search .giv-thumbs {
    display: none !important;
}

.graphic-items-view .giv-empty {
    grid-column: 1 / -1;

    width: 100%;
    padding: 34px 20px;

    border: 1px dashed #dce4ea;
    border-radius: 14px;

    background: #fafbfd;
    color: #78838d;

    text-align: center;
    font-size: 15px;
}

@media (max-width: 991px) {
    .graphic-items-view {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .graphic-items-view {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .graphic-items-view .giv-image-wrap {
        aspect-ratio: 1 / 1;
    }
}
