/* ===================================================
   Fatar Tooted Lühikood – CSS
   Disain vastab FA Tartu Kalev poe stiiliga
   =================================================== */

/* ---- Wrapper ---- */
.fatar-tooted-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
}

/* ---- Tööriba (tulemuste arv + sorteerimine) ---- */
.fatar-tooted-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.fatar-tooted-count {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.fatar-tooted-sort-form {
    display: flex;
    align-items: center;
}

.fatar-tooted-sort-select {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 7px 32px 7px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 220px;
    transition: border-color .2s;
}

.fatar-tooted-sort-select:focus {
    outline: none;
    border-color: #2d7a2d;
}

/* ---- Tootevõre ---- */
.fatar-tooted-grid {
    list-style: none;
    margin: 0 0 32px 0;
    padding: 0;
    display: grid;
    gap: 28px 24px;
}

/* Veerud */
.fatar-tooted-cols-1 { grid-template-columns: repeat(1, 1fr); }
.fatar-tooted-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fatar-tooted-cols-3 { grid-template-columns: repeat(3, 1fr); }
.fatar-tooted-cols-4 { grid-template-columns: repeat(4, 1fr); }
.fatar-tooted-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* ---- Üksik toode ---- */
.fatar-tooted-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}

.fatar-tooted-item:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

/* Pilt */
.fatar-tooted-image-link {
    display: block;
    text-decoration: none;
}

.fatar-tooted-image-wrap {
    background: #f7f7f7;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fatar-tooted-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .35s ease;
    box-sizing: border-box;
}

.fatar-tooted-item:hover .fatar-tooted-image-wrap img {
    transform: scale(1.05);
}

/* Info ala */
.fatar-tooted-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
    gap: 6px;
}

/* Pealkiri */
.fatar-tooted-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.fatar-tooted-title a {
    color: #2d7a2d;
    text-decoration: none;
    transition: color .2s;
}

.fatar-tooted-title a:hover {
    color: #1a5a1a;
    text-decoration: underline;
}

/* Hind */
.fatar-tooted-price {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 2px 0 6px;
}

.fatar-tooted-price .woocommerce-Price-amount {
    color: #333;
}

.fatar-tooted-price del {
    color: #999;
    font-weight: 400;
    margin-right: 4px;
}

.fatar-tooted-price ins {
    text-decoration: none;
    color: #c0392b;
}

/* Tegevuste riba */
.fatar-tooted-actions {
    margin-top: auto;
    padding-top: 8px;
}

/* Nupud */
.fatar-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .2s, border-color .2s, color .2s;
    line-height: 1.5;
}

/* Lisa korvi – valgel taustal, hall ääris */
.fatar-btn-korv {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

.fatar-btn-korv:hover,
.fatar-btn-korv.added {
    background-color: #2d7a2d;
    border-color: #2d7a2d;
    color: #fff;
}

/* Vali – roheline täidetud */
.fatar-btn-vali {
    background-color: #2d7a2d;
    color: #fff;
    border-color: #2d7a2d;
}

.fatar-btn-vali:hover {
    background-color: #1a5a1a;
    border-color: #1a5a1a;
    color: #fff;
}

/* Loe edasi – hall ääris */
.fatar-btn-edasi {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

.fatar-btn-edasi:hover {
    background-color: #f0f0f0;
    color: #111;
}

/* "Lisatud" märge */
.fatar-btn-korv.added::after {
    content: " ✓";
}

/* ---- Tühi olek ---- */
.fatar-tooted-empty {
    padding: 32px;
    text-align: center;
    color: #777;
    font-size: 15px;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* ---- Lehekülgimine ---- */
.fatar-tooted-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.fatar-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all .2s;
    background: #fff;
}

.fatar-page-btn:hover {
    border-color: #2d7a2d;
    color: #2d7a2d;
}

.fatar-page-btn.fatar-page-active {
    background-color: #2d7a2d;
    border-color: #2d7a2d;
    color: #fff;
    pointer-events: none;
}

/* ====== Responsive ====== */
@media (max-width: 1100px) {
    .fatar-tooted-cols-4 { grid-template-columns: repeat(3, 1fr); }
    .fatar-tooted-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .fatar-tooted-cols-3,
    .fatar-tooted-cols-4,
    .fatar-tooted-cols-5 { grid-template-columns: repeat(2, 1fr); }

    .fatar-tooted-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .fatar-tooted-sort-select {
        min-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .fatar-tooted-cols-2,
    .fatar-tooted-cols-3,
    .fatar-tooted-cols-4,
    .fatar-tooted-cols-5 { grid-template-columns: 1fr; }
}
